本文整理汇总了PHP中steam_factory::get_user方法的典型用法代码示例。如果您正苦于以下问题:PHP steam_factory::get_user方法的具体用法?PHP steam_factory::get_user怎么用?PHP steam_factory::get_user使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类steam_factory
的用法示例。
在下文中一共展示了steam_factory::get_user方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processData
public function processData(\IRequestObject $requestObject)
{
$params = $requestObject->getParams();
if (isset($params) && isset($params[0])) {
$this->user = \steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $params[0]);
}
if (!isset($this->user) || !$this->user instanceof \steam_user) {
$this->user = \lms_steam::get_current_user();
}
}
示例2: get_user_status_html
public function get_user_status_html($user_name)
{
$html = null;
$user = steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $user_name);
if (!$user->get_attribute("LLMS_NETWORKING_PROFILE") instanceof steam_object) {
$html = "<i>noch nie angemeldet</i>";
}
$sTeamServerDataAccess = new sTeamServerDataAccess();
if ($sTeamServerDataAccess->isLocked($user->get_id())) {
if ($html == null) {
$html = "<i>Benutzer gesperrt</i>";
} else {
$html .= " und <i>Benutzer gesperrt</i>";
}
}
if ($sTeamServerDataAccess->isTrashed($user->get_id())) {
if ($html == null) {
$html = "<i>Benutzer gelöscht</i>";
} else {
$html .= " und <i>Benutzer gelöscht</i>";
}
}
return $html;
}
示例3: isset
require_once "{$config_doc_root}/includes/derive_logoname.php";
//******************************************************
//** Precondition
//******************************************************
$workroom_id = isset($_GET["workroom"]) ? $_GET["workroom"] : "";
$environment_id = isset($_GET["environment"]) ? $_GET["environment"] : "";
$sequence_first = isset($_GET["seq_first"]) ? $_GET["seq_first"] : "";
$sequence_prev = isset($_GET["seq_prev"]) ? $_GET["seq_prev"] : "";
$sequence_next = isset($_GET["seq_next"]) ? $_GET["seq_next"] : "";
$sequence_last = isset($_GET["seq_last"]) ? $_GET["seq_last"] : "";
$sequence = $sequence_first != "" ? $sequence_first + $sequence_prev + $sequence_next + $sequence_last : "";
//login und $steam def. in "./includes/login.php"
$steam = new steam_connector($config_server_ip, $config_server_port, $login_name, $login_pwd);
$current_object = steam_factory::get_object($steam, $_GET["object"]);
$path = $current_object->get_path();
$user = steam_factory::get_user($steam, $login_name);
$user_data = $user->get_attributes(array(USER_FIRSTNAME, USER_FULLNAME, "LARS_DESKTOP"));
$attributes = $current_object->get_attributes(array(OBJ_NAME, OBJ_DESC, "OBJ_TYPE", "bid:collectiontype"), 1);
$write_allowed = $current_object->check_access_write($user, 1);
$result = $steam->buffer_flush();
$attributes = $result[$attributes];
$write_allowed = $result[$write_allowed];
$current_object_is_new_portal = strcmp($attributes["OBJ_TYPE"], "container_portal_bid") == 0;
$current_object_is_gallery = $current_object instanceof steam_container && strcmp($attributes["bid:collectiontype"], "gallery") == 0;
if ($user_data[USER_FIRSTNAME] !== 0 && $user_data[USER_FULLNAME] !== 0) {
$username = $user_data[USER_FIRSTNAME] . ' ' . $user_data[USER_FULLNAME];
} else {
$username = $login_name;
}
if ($user_data["LARS_DESKTOP"] !== 0) {
$desktop = $user_data["LARS_DESKTOP"];
示例4: getCellData
public function getCellData($cell, $contentItem)
{
if (!is_int($cell)) {
throw new \Exception("cell must be an integer!!");
}
if ($cell == $this->rawCheckbox) {
return "<input style=\"margin-top:-4px\" type=\"checkbox\" onclick=\"event.stopPropagation(); if(this.checked) { jQuery('#{$contentItem->get_id()}').removeClass('listviewer-item-unhover').addClass('listviewer-item-selected') } else { jQuery('#{$contentItem->get_id()}').removeClass('listviewer-item-selected').addClass('listviewer-item-unhover') }\"></input>";
} else {
if ($cell == $this->rawImage) {
return "<img src=\"" . PATH_URL . "explorer/asset/icons/mimetype/" . deriveIcon($contentItem->get_link_object()) . "\"></img>";
} else {
if ($cell == $this->rawName) {
$url = \ExtensionMaster::getInstance()->getUrlForObjectId($contentItem->get_link_object()->get_id(), "view");
$desc = $contentItem->get_link_object()->get_attribute("OBJ_DESC");
if (!($desc === false || $desc === 0 || $desc === "")) {
$name = $desc;
} else {
$name = str_replace("%20", " ", $contentItem->get_link_object()->get_name());
}
if ($name == "Trashbin") {
$name = "Papierkorb";
}
if (isset($url) && $url != "") {
return "<a href=\"" . $url . "\" title=\"{$desc}\"> " . $name . "</a>";
} else {
return $name;
}
} else {
if ($cell == $this->rawMarker) {
$html = "";
if ($contentItem->get_link_object()->check_access_read(\steam_factory::get_user($GLOBALS["STEAM"]->get_id(), STEAM_GUEST_LOGIN)) || $contentItem->get_link_object()->check_access_read(\steam_factory::get_group($GLOBALS["STEAM"]->get_id(), "steam"))) {
$html .= "<img onclick=\"event.stopPropagation(); this.src='" . PATH_URL . "bookmarks/asset/icons/star_inactive_16.png' \" style=\"cursor: pointer\" title=\"Öffentlich lesbar.\" src=\"" . PATH_URL . "explorer/asset/icons/public_16.png\"></img>";
}
//$html .= "<img onclick=\"event.stopPropagation(); this.src='".PATH_URL."bookmarks/asset/icons/star_inactive_16.png' \" style=\"cursor: pointer\" title=\"Als Lesezeichen markiert.\" src=\"".PATH_URL."bookmarks/asset/icons/star_16.png\"></img>";
return $html;
} else {
if ($cell == $this->rawChangeDate) {
return getReadableDate($contentItem->get_link_object()->get_attribute("OBJ_LAST_CHANGED"));
} else {
if ($cell == $this->rawSize) {
if ($contentItem->get_link_object() instanceof \steam_document) {
return getReadableSize($contentItem->get_link_object()->get_content_size());
} else {
if ($contentItem->get_link_object() instanceof \steam_container) {
try {
$html = "<div style=\"color: #ccc\">" . count($contentItem->get_link_object()->get_inventory()) . " Objekte</div>";
} catch (\steam_exception $e) {
$html = "keine Berechtigung";
}
return $html;
}
}
} else {
if ($cell == $this->rawMenu) {
$popupMenu = new \Widgets\PopupMenu();
$popupMenu->setData($contentItem);
$popupMenu->setElementId("listviewer-overlay");
return $popupMenu;
}
}
}
}
}
}
}
}
示例5: header
<?php
include_once "../../etc/koala.conf.php";
$portal = lms_portal::get_instance();
$portal->initialize(GUEST_NOT_ALLOWED);
$user = lms_steam::get_current_user();
if (!lms_steam::is_koala_admin($user)) {
header("location:/");
exit;
}
$mail_sum = 0;
$user_count = 0;
$users = $GLOBALS['STEAM']->predefined_command($GLOBALS['STEAM']->get_module('users'), 'index', array(), FALSE);
foreach ($users as $user) {
$user_count++;
$steam_user = steam_factory::get_user($GLOBALS['STEAM']->get_id(), $user);
$mail_sum += count($steam_user->get_annotations());
if ($user_count % 100 == 0) {
echo ". user_count: " . $user_count . " mail_sum: " . $mail_sum . "<br />";
} else {
echo ".";
}
flush();
}
echo "<br> #User: " . $user_count . " #Mail: " . $mail_sum;
//$semesters_group = steam_factory::groupname_to_object( $GLOBALS[ "STEAM" ]->get_id(), "Courses");
//if ($semesters_group instanceof steam_group) {
// echo "<h1>Prüfe alle Semester<h1>";
//
// $semesters = $semesters_group->get_subgroups();
// foreach ($semesters as $semester) {
示例6: getRootUser
public function getRootUser()
{
$root = steam_factory::get_user($GLOBALS["STEAM"]->get_id(), "root");
return $root->get_id();
}
示例7: h
$icon_link = $member["OBJ_ICON"] == 0 ? PATH_STYLE . "images/anonymous.jpg" : PATH_URL . "cached/get_document.php?id=" . h($member["OBJ_ICON"]) . "&type=usericon&width=30&height=40";
$content->setVariable("CONTACT_IMAGE", $icon_link);
$title = !empty($member["USER_ACADEMIC_TITLE"]) ? h($member["USER_ACADEMIC_TITLE"]) . " " : "";
$content->setVariable("CONTACT_NAME", $title . h($member["USER_FIRSTNAME"]) . " " . h($member["USER_FULLNAME"]));
!COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LINK_SEND_MESSAGE", PATH_URL . "messages_write.php?to=" . h($member["OBJ_NAME"]));
!COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LABEL_MESSAGE", gettext("Message"));
!COURSE_PARTICIPANTS_COMMUNICATION or $content->setVariable("LABEL_SEND", gettext("Send"));
!COURSE_PARTICIPANTS_FACULTY_AND_FOCUS or $content->setVariable("FACULTY_AND_FOCUS", h($member["USER_PROFILE_FACULTY"]));
if (lms_steam::is_koala_admin($user) || !COURSE_KOALAADMIN_ONLY && $is_admin) {
!COURSE_PARTICIPANTSLIST_MANAGE or $content->setVariable("TD_MANAGE_CONTACT", "<td align=\"center\"><input type=\"submit\" name=\"remove[" . h($member["OBJ_NAME"]) . "]\" value=\"" . gettext("Remove") . "\"/></td>");
}
if (COURSE_PARTICIPANTS_EXTENSIONS) {
$extensions = $group->get_extensions();
$result = "";
foreach ($extensions as $extension) {
$result .= $extension->get_member_info(steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $member["OBJ_NAME"]), $group);
}
$content->setVariable("EXTENSIONS_DATA", $result);
}
$member_desc = empty($member["OBJ_DESC"]) ? "student" : $member["OBJ_DESC"];
$status = secure_gettext($member_desc);
$content->setVariable("OBJ_DESC", h($status) . " " . ($i + 1));
$content->parse("BLOCK_CONTACT");
}
$content->parse("BLOCK_CONTACT_LIST");
} else {
$content->setVariable("LABEL_NO_MEMBERS", gettext("No members found."));
}
}
$html_handler_group->set_html_left($content->get());
$portal->set_page_main($html_handler_group->get_headline(), $html_handler_group->get_html(), "");
示例8: clearexam
function clearexam()
{
$html_id = $_POST["html_id"];
$user_id = $_POST["user_id"];
$cid = $_POST["cid"];
$exam_id = $_POST["exam_id"];
$elearning_course = elearning_mediathek::get_elearning_course_by_id($cid);
$user = steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $user_id);
$el_user = elearning_user::get_instance($user->get_name(), elearning_mediathek::get_instance()->get_course()->get_id());
$el_user->reset_elearning_unit_user_data();
echo $html_id;
}
示例9: execute
public function execute(Request $request, Response $response)
{
$sessionRegistry = SessionRegistry::getInstance();
$registry = Registry::getInstance();
$view = new TemplateView('changeGroupdata');
$maxParameterIndex = $sessionRegistry->get('maxParameterIndex');
// Benutzeraktion: neue Gruppe gewählt
if ($request->issetParameter('chooseGroup') and $request->issetParameter('groupSelect')) {
$sessionRegistry->set('activeGroup', $request->getParameter('groupSelect'));
}
// Benutzeraktion: Gruppendaten bearbeiten.
if ($request->issetParameter('changeData')) {
// eingegebenen Daten auf Korrektheit überprüfen.
$datacorrectness = true;
if ($request->issetParameter('groupname') == false or $request->issetParameter('owner') == false) {
$datacorrectness = false;
} elseif ($request->getParameter('groupname') == '' or $request->getParameter('owner') == '') {
$datacorrectness = false;
$view->assign('status', 'warning_2');
$view->assign('statusMsg', 'Bitte geben Sie alle benötigten Daten ein!');
} elseif ($request->getParameter('groupname') != '' and $request->getParameter('groupname') != $sessionRegistry->get('activeGroup') and $registry->get('ldapAccess')->groupExists($request->getParameter('groupname'), $sessionRegistry->get('school'), $sessionRegistry->get('district')) == true) {
$datacorrectness = false;
$view->assign('status', 'warning_2');
$view->assign('statusMsg', 'Dieser Gruppenname existiert bereits. Bitte wählen Sie einen anderen Namen!');
} elseif ($request->getParameter('owner') != '' and $registry->get('ldapAccess')->ultimate_userExists($request->getParameter('owner')) == false) {
$datacorrectness = false;
$view->assign('status', 'warning_2');
$view->assign('statusMsg', 'Der als Besitzer angegebene Benutzername existiert nicht!');
} elseif ($request->getParameter('parent') == $sessionRegistry->get('activeGroup')) {
$datacorrectness = false;
$view->assign('status', 'warning_2');
$view->assign('statusMsg', 'Eine Gruppe kann nicht sich selbst als Elterngruppe haben!');
} elseif ($request->getParameter('parent') != $registry->get('ldapAccess')->getParentGroupname($sessionRegistry->get('activeGroup')) and $registry->get('ldapAccess')->hasSubgroups($sessionRegistry->get('activeGroup'))) {
$datacorrectness = false;
$view->assign('status', 'warning_2');
$view->assign('statusMsg', 'Diese Gruppe besitzt noch Untergruppen, und kann daher keiner neuen Elterngruppe zugeordnet werden!');
}
/*
// falls die gruppe umbenannt wurde, auf steam-seite aktualisieren
if($datacorrectness AND $request->getParameter('groupname') != $sessionRegistry->get('activeGroup')){
$groupDN_new = str_replace('cn='.$sessionRegistry->get('activeGroup'), 'cn='.$request->getParameter('groupname') ,$registry->get('ldapAccess')->getGroupDN_2($sessionRegistry->get('activeGroup')));
$groupDN_old = $registry->get('ldapAccess')->getGroupDN_2($sessionRegistry->get('activeGroup'));
// verbindung zu steam aufbauen
$steamConnector = new steam_connector('localhost', 1900, 'root', 'h6518_W#');
// neuen steam-namen der gruppe ermitteln
$ldap_module = $steamConnector->get_server_module('persistence:ldap');
$steam_groupname_new = $steamConnector->predefined_command($ldap_module, 'dn_to_group_name', $groupDN_new, 0);
$steam_groupname_old = $steamConnector->predefined_command($ldap_module, 'dn_to_group_name', $groupDN_old, 0);
echo 'alter steam_name: '.$steam_groupname_old.'<br>';
echo 'neuer steam_name: '.$request->getParameter('groupname').'<br>';
$steamGroup = steam_factory::get_group($steamConnector, $steam_groupname_old, 0);
echo $steamGroup->set_name($request->getParameter('groupname'), 0);
}
*/
if ($datacorrectness) {
$data = array();
$data['groupname'] = $request->getParameter('groupname');
$data['owner'] = $request->getParameter('owner');
$data['description'] = $request->getParameter('description');
$data['parent'] = $request->getParameter('parent');
$done = $registry->get('ldapAccess')->setGroupInformation($sessionRegistry->get('activeGroup'), $data);
if ($done === true) {
$view->assign('status', 'ok_2');
$view->assign('statusMsg', 'Die Daten wurden geändert!');
} else {
$view->assign('status', 'warning_2');
$view->assign('statusMsg', 'Systemfehler: LDAP-Kommando fehlgeschlagen!');
}
}
}
if ($request->issetParameter('performAction')) {
if ($request->issetParameter('actionSelect')) {
// Benutzeraktion: Benutzer aus Gruppe entfernen.
if ($request->getParameter('actionSelect') == 'remove') {
$unremovedUser = array();
$groupDN = $registry->get('ldapAccess')->getGroupDN_2($sessionRegistry->get('activeGroup'));
$steamConnector = new steam_connector('localhost', 1900, 'root', 'h6518_W#');
$ldapModule = $steamConnector->get_server_module('persistence:ldap');
$steam_groupname = $steamConnector->predefined_command($ldapModule, 'dn_to_group_name', $groupDN, 0);
$steamGroup = steam_factory::get_group($steamConnector, $steam_groupname, 0);
for ($i = 1; $i <= $maxParameterIndex; $i++) {
if ($request->issetParameter('name' . $i)) {
$done = $registry->get('ldapAccess')->unsetUserData($request->getParameter('name' . $i), 'membership', $sessionRegistry->get('activeGroup'));
if ($done == false) {
$unremovedUser[] = $request->getParameter('name' . $i);
} else {
$user = steam_factory::get_user($steamConnector, $request->getParameter('name' . $i));
$steamGroup->remove_member($user, 0);
}
}
}
$steamConnector->disconnect();
if (count($unremovedUser) === 0) {
$view->assign('status', 'ok');
$view->assign('statusMsg', 'Alle markierten Benutzer wurden aus dieser Gruppe entfernt!');
//.........这里部分代码省略.........
示例10: foreach
foreach ($invent as $inven) {
//Kopfzeie setzen
if ($inven->get_attribute(HOMEWORK_TYPE) == "task") {
$sheet->writeString(3, $col, gettext("Task") . ": " . $col, $format_table_header);
$col++;
}
}
$col = 1;
$row = 5;
$max_count = 0;
$punkt_sum = 0;
foreach ($members as $member) {
$sheet->writeString($row, 0, $member["USER_FIRSTNAME"] . " " . $member["USER_FULLNAME"], $format_names);
foreach ($invent as $inven) {
if ($inven->get_attribute(HOMEWORK_TYPE) == "task") {
$u = steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $member["OBJ_NAME"]);
$solution = get_subitem($invent, $inven->get_id(), $u);
$counter = 0;
if (count($solution) > 0) {
foreach ($solution as $solu) {
$sol_point = $solu->get_attribute(HOMEWORK_POINTS);
$sheet->writeString($row, $col, $sol_point, $format_cell);
if (count($solution) > 1) {
$row++;
$counter++;
}
$punkt_sum += $sol_point;
}
if ($counter >= $max_count) {
//max_count setzen f�r den Sprung zum n�chsten User mit richigem Abstand
$max_count = $counter;
示例11: get_certs
public static function get_certs($user_name)
{
$result = array();
$user = steam_factory::get_user($GLOBALS["STEAM"]->get_id(), $user_name);
$courses = lms_steam::user_get_booked_courses($user->get_id());
foreach ($courses as $course) {
$unit = elearning_mediathek::get_elearning_unit($course["OBJ_ID"]);
if ($unit === false) {
continue;
}
$elearning_user = new elearning_user($user_name, $course["OBJ_ID"]);
if ($elearning_user->has_exam_cert()) {
$result[] = $elearning_user->get_exam_cert();
}
}
return $result;
}
示例12: isset
$user_id = isset($_GET["user"]) ? $_GET["user"] : (isset($_POST["user"]) ? $_POST["user"] : 0);
$group_id = isset($_GET["group"]) ? $_GET["group"] : (isset($_POST["group"]) ? $_POST["group"] : 0);
//******************************************************
//** sTeam Stuff
//******************************************************
$steam = new steam_connector($config_server_ip, $config_server_port, $login_name, $login_pwd);
if (!$steam || !$steam->get_login_status()) {
header("Location: {$config_webserver_ip}/index.html");
exit;
}
if ($login_name == "guest") {
print "Visitenkarten können nur von angemeldeten Benutzern eingesehen werden.";
return;
}
if ($user_id !== 0) {
$user = steam_factory::get_user($steam, $user_id);
$user_data = $user->get_attributes(array(OBJ_NAME, OBJ_DESC, USER_FIRSTNAME, USER_FULLNAME, USER_EMAIL, USER_ADRESS, OBJ_ICON, "bid:user_callto", "bid:user_im_adress", "bid:user_im_protocol"));
// $user_email_forwarding = $user->get_email_forwarding();
} else {
if ($group_id !== 0) {
$group = steam_factory::get_group($steam, $group_id);
$group_data = $group->get_attributes(array(OBJ_NAME, OBJ_DESC));
}
}
$user_favourites = $steam->get_login_user()->get_buddies();
if ($action == "save") {
if (count($user_favourites) == 0) {
$user_favourites = array();
}
if ($user_id !== 0) {
array_push($user_favourites, $user);
示例13: gettext
case "staff member":
$adminDescription = gettext("staff member");
break;
case "alumni":
$adminDescription = gettext("alumni");
break;
case "guest":
$adminDescription = gettext("guest");
break;
case "":
$adminDescription = gettext("student");
break;
default:
break;
}
if (COURSE_START_SEND_MESSAGE && (!COURSE_SHOW_ONLY_EXTERN_MAIL || COURSE_SHOW_ONLY_EXTERN_MAIL && is_string(steam_factory::get_user($GLOBALS['STEAM']->get_id(), $admin_attributes["OBJ_NAME"])->get_attribute("USER_EMAIL")) && steam_factory::get_user($GLOBALS['STEAM']->get_id(), $admin_attributes["OBJ_NAME"])->get_attribute("USER_EMAIL") != "" && steam_factory::get_user($GLOBALS['STEAM']->get_id(), $admin_attributes["OBJ_NAME"])->get_attribute("USER_FORWARD_MSG") === 1)) {
$adminDescription = $adminDescription . " - <a href=\"/messages_write.php?to=" . $admin->get_name() . "\">" . gettext("Nachricht senden") . "</a>";
}
$content->setVariable("ADMIN_DESC", $adminDescription);
if (COURSE_START_ADMIN_PROFILE_ANKER) {
$content->parse("PROFILE_ANKER");
} else {
$content->parse("PROFILE_NO_ANKER");
}
$content->parse("BLOCK_ADMIN");
$visible_staff++;
}
}
if ($visible_staff > 0) {
$content->setCurrentBlock("BLOCK_ADMIN_HEADER");
$content->setVariable("LABEL_ADMINS", gettext("Staff members"));
示例14: frameResponse
public function frameResponse(\FrameResponseObject $frameResponseObject)
{
$path = $this->params;
$user = \lms_steam::get_current_user();
$public = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_PUBLIC_GROUP, CLASS_GROUP);
$id = $path[0];
$portal = \lms_portal::get_instance();
$portal_user = $portal->get_user();
try {
$steam_group = !empty($id) ? \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $id) : FALSE;
} catch (\Exception $ex) {
include "bad_link.php";
exit;
}
$group_is_private = FALSE;
if ($steam_group && is_object($steam_group)) {
switch ((string) $steam_group->get_attribute("OBJ_TYPE")) {
case "course":
$group = new \koala_group_course($steam_group);
// TODO: Passt der backlink?
$backlink = PATH_URL . SEMESTER_URL . "/" . $group->get_semester()->get_name() . "/" . h($group->get_name()) . "/";
break;
default:
$group = new \koala_group_default($steam_group);
// TODO: Passt der backlink?
$backlink = PATH_URL . "groups/" . $group->get_id() . "/";
// Determine if group is public or private
$parent = $group->get_parent_group();
if ($parent->get_id() == STEAM_PRIVATE_GROUP) {
$group_is_private = TRUE;
}
break;
}
}
if ($group_is_private) {
if (!$steam_group->is_member($user) && !\lms_steam::is_koala_admin($user)) {
throw new \Exception(gettext("You have no rights to access this group"), E_USER_RIGHTS);
}
}
if (!$group instanceof \koala_group) {
throw new \Exception("Variable group not set.");
}
if (COURSE_PARTICIPANTS_STAFF_ONLY && !$group->is_admin($user)) {
header("location:../");
exit;
}
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (is_array($_POST["remove"])) {
$id = key($_POST["remove"]);
$member_to_kick = \steam_factory::username_to_object($GLOBALS["STEAM"]->get_id(), $id);
$group->remove_member($member_to_kick);
$portal->set_confirmation(str_replace("%NAME", h($member_to_kick->get_attribute("USER_FIRSTNAME")) . " " . h($member_to_kick->get_attribute("USER_FULLNAME")), gettext("User %NAME successfully removed from group members.")));
// clear caches:
$cache = get_cache_function($member_to_kick->get_name());
$cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), TRUE);
$cache->drop("lms_steam::user_get_groups", $member_to_kick->get_name(), FALSE);
$cache->drop("lms_steam::user_get_profile", $member_to_kick->get_name());
$cache->drop("lms_portal::get_menu_html", $member_to_kick->get_name(), TRUE);
$cache = get_cache_function($group->get_id());
$cache->drop("lms_steam::group_get_members", $group->get_id());
}
}
$cache = get_cache_function($group->get_id(), CACHE_LIFETIME_STATIC);
switch (get_class($group)) {
case "koala_group_course":
$html_handler_group = new \koala_html_course($group);
$html_handler_group->set_context("members");
$members = $cache->call("lms_steam::group_get_members", $group->steam_group_learners->get_id());
break;
default:
$html_handler_group = new \koala_html_group($group);
$html_handler_group->set_context("members");
$members = $cache->call("lms_steam::group_get_members", $group->get_id());
break;
}
$is_admin = $group->is_admin($user);
$content = \Group::getInstance()->loadTemplate("list_users.template.html");
$is_member = $group->is_member($user);
//echo "is_member? " . $is_member;
$privacy_deny_participants = $group->get_attribute("GROUP_PRIVACY");
//echo "attribute: ''" . $privacy_deny_participants . "''";
if ($privacy_deny_participants == PERMISSION_GROUP_PRIVACY_DENY_PARTICIPANTS && !$is_member) {
//echo "*** deny ***";
//TODO
$content->setVariable("LABEL_PRIVACY_DENY_PARTICIPANTS", gettext("Participants are hidden."));
} else {
//echo "*** permit ***";
$no_members = count($members);
if ($no_members > 0) {
switch (get_class($group)) {
case "koala_group_course":
$groupname = $group->get_course_id();
break;
default:
$groupname = $group->get_name();
break;
}
if (!USER_LIST_NO_PAGEING) {
$paginator = \lms_portal::get_paginator(10, $no_members, "(" . str_replace("%NAME", h($groupname), gettext("%TOTAL members in %NAME")) . ")");
$start = $paginator["startIndex"];
//.........这里部分代码省略.........
示例15: execute
public function execute(\FrameResponseObject $frameResponseObject)
{
//$portal = \lms_portal::get_instance();
//$portal->initialize( GUEST_NOT_ALLOWED );
//$portal->set_guest_allowed( GUEST_NOT_ALLOWED );
$user = \lms_steam::get_current_user();
//$portal_user = $portal->get_user();
//$path = $request->getPath();
$scg = \steam_factory::get_object($GLOBALS["STEAM"]->get_id(), STEAM_COURSES_GROUP, CLASS_GROUP);
$current_semester = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), $scg->get_groupname() . "." . STEAM_CURRENT_SEMESTER);
//$current_semester = $path[3];
//Vorher
$group_course = \steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), "Courses." . $this->params[0] . "." . $this->params[1]);
$course = new \koala_group_course($group_course);
$html_handler_course = new \koala_html_course($course);
$html_handler_course->set_context("start");
$content = \Course::getInstance()->loadTemplate("courses_start.template.html");
//$content = new HTML_TEMPLATE_IT();
//$content->loadTemplateFile( PATH_TEMPLATES . "courses_start.template.html" );
$content->setVariable("LABEL_DESCRIPTION", gettext("Description"));
// Pre-load Course Attributes
$course->get_steam_object()->get_attributes(array("COURSE_SHORT_DSC", OBJ_DESC, "COURSE_LONG_DSC"));
$desc = $course->get_attribute("COURSE_SHORT_DSC");
if (empty($desc)) {
$content->setVariable("OBJ_DESC", gettext("No description available."));
} else {
$content->setVariable("OBJ_DESC", get_formatted_output($desc));
}
$about = $course->get_attribute("COURSE_LONG_DSC");
if (!empty($about)) {
$content->setCurrentBlock("BLOCK_ABOUT");
$content->setVariable("LABEL_ABOUT", gettext("About"));
$content->setVariable("VALUE_ABOUT", get_formatted_output($about));
$content->parse("BLOCK_ABOUT");
}
if (COURSE_SHOW_MAXSIZE) {
if ($course->get_maxsize() > 0) {
$content->setCurrentBlock("BLOCK_GROUPSIZE");
$content->setVariable("LABEL_MAXSIZE_HEADER", gettext("The number of participants of this course is limited."));
$content->setVariable("LABEL_MAXSIZE_DESCRIPTION", str_replace("%MAX", $course->get_maxsize(), str_replace("%ACTUAL", $course->count_members(), gettext("The actual participant count is %ACTUAL of %MAX."))));
$content->parse("BLOCK_GROUPSIZE");
}
}
$admins = $course->get_staff();
$hidden_members = $course->get_steam_group()->get_attribute("COURSE_HIDDEN_STAFF");
if (!is_array($hidden_members)) {
$hidden_members = array();
}
$visible_staff = 0;
foreach ($admins as $admin) {
if (!in_array($admin->get_id(), $hidden_members)) {
$content->setCurrentBlock("BLOCK_ADMIN");
if (COURSE_START_ADMIN_PROFILE_ANKER) {
$content->setCurrentBlock("PROFILE_ANKER");
} else {
$content->setCurrentBlock("PROFILE_NO_ANKER");
}
$admin_attributes = $admin->get_attributes(array("USER_FIRSTNAME", "USER_FULLNAME", "OBJ_ICON", "OBJ_DESC", "OBJ_NAME"));
if ($admin instanceof \steam_user) {
$content->setVariable("ADMIN_NAME", $admin_attributes["USER_FIRSTNAME"] . " " . $admin_attributes["USER_FULLNAME"]);
!COURSE_START_ADMIN_PROFILE_ANKER or $content->setVariable("ADMIN_LINK", PATH_URL . "user/" . $admin->get_name() . "/");
} else {
$content->setVariable("ADMIN_NAME", $admin_attributes["OBJ_NAME"]);
!COURSE_START_ADMIN_PROFILE_ANKER or $content->setVariable("ADMIN_LINK", PATH_URL . "groups/" . $admin->get_id() . "/");
}
$icon_link = is_object($admin_attributes["OBJ_ICON"]) ? PATH_URL . "download/image/" . $admin_attributes["OBJ_ICON"]->get_id() . "/40/47" : PATH_STYLE . "images/anonymous.jpg";
$content->setVariable("ADMIN_ICON", $icon_link);
$adminDescription = h($admin_attributes["OBJ_DESC"]);
switch ($adminDescription) {
case "student":
$adminDescription = gettext("student");
break;
case "staff member":
$adminDescription = gettext("staff member");
break;
case "alumni":
$adminDescription = gettext("alumni");
break;
case "guest":
$adminDescription = gettext("guest");
break;
case "":
$adminDescription = gettext("student");
break;
default:
break;
}
if (COURSE_START_SEND_MESSAGE && (!COURSE_SHOW_ONLY_EXTERN_MAIL || COURSE_SHOW_ONLY_EXTERN_MAIL && is_string(steam_factory::get_user($GLOBALS['STEAM']->get_id(), $admin_attributes["OBJ_NAME"])->get_attribute("USER_EMAIL")) && steam_factory::get_user($GLOBALS['STEAM']->get_id(), $admin_attributes["OBJ_NAME"])->get_attribute("USER_EMAIL") != "" && steam_factory::get_user($GLOBALS['STEAM']->get_id(), $admin_attributes["OBJ_NAME"])->get_attribute("USER_FORWARD_MSG") === 1)) {
$adminDescription = $adminDescription . " - <a href=\"/messages_write.php?to=" . $admin->get_name() . "\">" . gettext("Nachricht senden") . "</a>";
}
$content->setVariable("ADMIN_DESC", $adminDescription);
if (COURSE_START_ADMIN_PROFILE_ANKER) {
$content->parse("PROFILE_ANKER");
} else {
$content->parse("PROFILE_NO_ANKER");
}
$content->parse("BLOCK_ADMIN");
$visible_staff++;
}
}
//.........这里部分代码省略.........