$tpl = new Template("./templates/{$language}", "keep"); $tpl->set_file("content", "preferences.ihtml"); $tpl->set_var(array("USER_NAME" => $steam->get_login_user()->get_name(), "USER_DESCRIPTION" => $steam->get_login_user()->get_attribute(OBJ_DESC), "USER_FIRSTNAME" => $steam->get_login_user()->get_attribute(USER_FIRSTNAME), "USER_LASTNAME" => $steam->get_login_user()->get_attribute(USER_FULLNAME), "USER_ADRESS" => $steam->get_login_user()->get_attribute(USER_ADRESS), "USER_EMAIL" => $steam->get_login_user()->get_attribute(USER_EMAIL), "USER_CALLTO" => $steam->get_login_user()->get_attribute("bid:user_callto"), "USER_IM_ADRESS" => $steam->get_login_user()->get_attribute("bid:user_im_adress"))); if ($steam->get_login_user()->get_attribute(USER_ADRESS) === 0) { $tpl->parse("USER_ADRESS", ""); } if ($steam->get_login_user()->get_attribute(USER_EMAIL) === 0) { $tpl->parse("USER_EMAIL", ""); } if ($steam->get_login_user()->get_attribute("bid:user_callto") === 0) { $tpl->parse("USER_CALLTO", ""); } if ($steam->get_login_user()->get_attribute("bid:user_im_adress") === 0) { $tpl->parse("USER_IM_ADRESS", ""); } $tpl->set_var(array("AIM_SELECTED" => $steam->get_login_user()->get_attribute("bid:user_im_protocol") === 'aim' ? "SELECTED" : "", "XMPP_SELECTED" => $steam->get_login_user()->get_attribute("bid:user_im_protocol") === 'xmpp' ? "SELECTED" : "", "SKYPE_SELECTED" => $steam->get_login_user()->get_attribute("bid:user_im_protocol") === 'skype' ? "SELECTED" : "")); $tpl->set_var(array("LANGUAGE1_SELECTED" => $steam->get_login_user()->get_attribute(USER_LANGUAGE) === 'german' ? "SELECTED" : "", "LANGUAGE2_SELECTED" => $steam->get_login_user()->get_attribute(USER_LANGUAGE) === 'english' ? "SELECTED" : "", "LANGUAGE3_SELECTED" => $steam->get_login_user()->get_attribute(USER_LANGUAGE) === 'french' ? "SELECTED" : "")); $tpl->set_var(array("HIDDEN_ON" => $steam->get_login_user()->get_attribute("bid:show_hidden") === 'on' ? "CHECKED" : "", "HIDDEN_OFF" => !$steam->get_login_user()->get_attribute("bid:show_hidden") || $steam->get_login_user()->get_attribute("bid:show_hidden") === 'off' ? "CHECKED" : "")); $tpl->set_var(array("TREEVIEW_MINI" => !$steam->get_login_user()->get_attribute("bid:treeview_mini") || $steam->get_login_user()->get_attribute("bid:treeview_mini") === 'on' ? "CHECKED" : "", "TREEVIEW_MAXI" => $steam->get_login_user()->get_attribute("bid:treeview_mini") === 'off' ? "CHECKED" : "", "TREEVIEW_OFF" => $steam->get_login_user()->get_attribute("bid:treeview") === 'off' ? "CHECKED" : "")); $tpl->parse("BUTTON_LABEL", "submit_button"); //Logout & Disconnect $steam->disconnect(); out(); function out() { //parse all out global $tpl; $tpl->parse("OUT", "content"); $tpl->p("OUT"); exit; }
// set contacts to confirm of contact $ctc = $acontact->get_attribute("USER_CONTACTS_TOCONFIRM"); if (!is_array($ctc)) { $ctc = array(); } $found = FALSE; foreach ($ctc as $tc) { if (!is_object($tc) || $tc->get_id() == $user->get_id()) { $found = TRUE; } } if (!$found) { $ctc[] = $user; $acontact->set_attribute("USER_CONTACTS_TOCONFIRM", $ctc); } $admin_steam->disconnect(); // contacts to confirm of user $new_tc = array(); foreach ($toconfirm as $tc) { if (!is_object($tc) || $tc->get_id() == $contact->get_id()) { $continue; } $new_tc[] = $tc; } $user->set_attribute("USER_CONTACTS_TOCONFIRM", $new_tc); // WRITE MAIL TO CONTACT $message = str_replace("%NAME", $contact_attributes["USER_FIRSTNAME"] . " " . $contact_attributes["USER_FULLNAME"], gettext("Dear %NAME")) . ",\n\n" . str_replace("%NAME", $user_attributes["USER_FIRSTNAME"] . " " . $user_attributes["USER_FULLNAME"], gettext("%NAME would like to add you as contact.")) . "\n\n" . gettext("Here is the memo:") . "\n\n" . $_POST["message"] . "\n\n" . "<a href=\"" . PATH_URL . "contact_confirm.php?id=" . $user->get_id() . "\">" . gettext("Confirm this contact.") . "</a>"; lms_steam::mail($contact, $user, PLATFORM_NAME . ": " . str_replace("%NAME", $user_attributes["USER_FIRSTNAME"] . " " . $user_attributes["USER_FULLNAME"], gettext("Confirmation Request from %NAME")), $message); require_once 'Cache/Lite.php'; $cache = new Cache_Lite(array("cacheDir" => PATH_CACHE)); $cache = get_cache_function($user->get_name());
private function createUnitElearningPreferences() { //create steam container for unit elearning preferences if ($GLOBALS["STEAM"]->get_login_user_name() != "root") { // MUST BE DONE AS ROOT USER $root_steam = new steam_connector(STEAM_SERVER, STEAM_PORT, STEAM_ROOT_LOGIN, STEAM_ROOT_PW); $this->unit_elearning_preferences = steam_factory::create_container($root_steam->get_id(), $this->unit_elearning_preferences_name, $this->workroom); $koala_course = new koala_group_course($this->course_group); //$this->unit_elearning_preferences->set_sanction_all($this->steam_user); $this->unit_elearning_preferences->set_sanction_all($koala_course->get_group_staff()); //$this->unit_elearning_preferences->set_sanction_all($koala_course->get_group_admins()); $root_steam->buffer_flush(); $root_steam->disconnect(); } else { $this->unit_elearning_preferences = steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $this->unit_elearning_preferences_name, $this->workroom); $koala_course = new koala_group_course($this->course_group); //$this->unit_elearning_preferences->set_sanction_all($this->steam_user); $this->unit_elearning_preferences->set_sanction_all($koala_course->get_group_staff()); //$this->unit_elearning_preferences->set_sanction_all($koala_course->get_group_admins()); $GLOBALS["STEAM"]->buffer_flush(); } // //create attributes.xml $this->unit_elearning_preferences = steam_factory::path_to_object($GLOBALS["STEAM"]->get_id(), $this->path_to_unit_elearning_preferences); if ($this->unit_elearning_preferences === 0) { $this->unit_elearning_preferences = steam_factory::path_to_object($GLOBALS["STEAM"]->get_id(), $this->path_to_unit_elearning_preferences); } if ($this->unit_elearning_preferences === 0) { throw new Exception("broke datastructure"); } $attributes_xml = new SimpleXMLElement("<attributes></attributes>"); $attributes_xml->addChild("OBJ_DESC", "storage for unit_elearning user data"); $attributes_xml->addChild("OBJ_HIDDEN", "TRUE"); $attributes_xml->addChild("OBJ_TYPE", "unit_elearning_data"); steam_factory::create_document($GLOBALS["STEAM"]->get_id(), "attributes.xml", (string) $attributes_xml->asXML(), "text/xml", $this->unit_elearning_preferences); $GLOBALS["STEAM"]->buffer_flush(); }
function setBidLastSessionTime($config_server_ip, $config_server_port, $login_name, $login_pwd, $connect = true) { try { //login und $steam def. in "./includes/login.php" $steam = new steam_connector($config_server_ip, $config_server_port, $login_name, $login_pwd); if ($steam->get_login_status()) { $steamUser = $steam->get_login_user(); $bidLastSessionTime = $steamUser->get_attribute("bid:last_session_time"); if (!$bidLastSessionTime || !$connect) { $bidLastSessionTime = array(); $bidLastSessionTime[0] = $bidLastSessionTime[1] = time(); } else { $bidLastSessionTime[0] = $bidLastSessionTime[1]; $bidLastSessionTime[1] = time(); } $steamUser->set_attribute("bid:last_session_time", $bidLastSessionTime); $steam->disconnect(); } } catch (Exception $e) { } }
$semname = $scg->get_groupname() . "." . $aktsem; $semester = steam_factory::groupname_to_object($connector->get_id(), $semname); if (!is_object($semester)) { die("Cannot find Group " . $scg->get_groupname() . "." . $aktsem . " for semester " . $aktsem); } $courses = $semester->get_subgroups(); steam_factory::load_attributes($connector->get_id(), $courses, array(OBJ_DESC, OBJ_NAME, "COURSE_UNITS_ENABLED")); echo "Listing all Courses for Semester " . $aktsem . " (" . $semname . ")"; echo "<table><tr><td>Kurs</td><td>COURSE_UNITS_ENABLED</td><td>UNITS_DOCPOOL_ENABLED</td><td>Konvertiert</td></tr><tr>"; foreach ($courses as $course) { if (is_object($course)) { echo "<tr><td>" . $course->get_name() . " (" . $course->get_attribute(OBJ_DESC) . ")</td><td>" . $course->get_attribute("COURSE_UNITS_ENABLED") . "</td><td>" . $course->get_attribute("UNITS_DOCPOOL_ENABLED") . "</td><td>"; if ($course->get_attribute("COURSE_UNITS_ENABLED") === "TRUE" && $course->get_attribute("UNITS_DOCPOOL_ENABLED") !== "TRUE") { if (isset($_GET["write"]) && $_GET["write"] == "true") { //$course->set_attribute("COURSE_UNITS_ENABLED", "TRUE"); $course->set_attribute("UNITS_DOCPOOL_ENABLED", "TRUE"); } echo "TRUE"; } echo "</td></tr>"; } } echo "</tr></table>"; echo "<br />Requestcount: " . $connector->get_request_count() . "<br />\n\r"; $connector->disconnect(); ?> </p> </center> </BODY> </HTML>