本文整理匯總了PHP中steam_factory::get_group方法的典型用法代碼示例。如果您正苦於以下問題:PHP steam_factory::get_group方法的具體用法?PHP steam_factory::get_group怎麽用?PHP steam_factory::get_group使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類steam_factory
的用法示例。
在下文中一共展示了steam_factory::get_group方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
public function execute(Request $request, Response $response)
{
$view = new TemplateView('lookUp');
$sessionRegistry = SessionRegistry::getInstance();
$registry = Registry::getInstance();
$view->assign('accessLevel', $sessionRegistry->get('accessLevel'));
$view->assign('groupList', $registry->get('ldapAccess')->getGroupsDN());
// Benutzeraktion:
if ($request->issetParameter('lookUp')) {
$groupname = $request->getParameter('directSelect');
$groupDN = $registry->get('ldapAccess')->getGroupDN_2($groupname);
$user = $sessionRegistry->get('uid');
$userPW = $sessionRegistry->get('userPW');
// sTeam
$steamConnector = new steam_connector('localhost', 1900, 'root', 'h6518_W#');
if (!$steamConnector->get_login_status()) {
$view->assign('status', 'warning');
$view->assign('statusMsg', 'Verbindung zum sTeam-Server konnte nicht erstellt werden!');
} else {
$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);
$steamGroup->get_members(0);
// Rückmeldung
$view->assign('status', 'ok');
$view->assign('statusMsg', 'LookUp wurde durchgeführt!');
}
}
// Ausgabe erzeugen.
$view->render($request, $response);
}
示例2: check_steam_group
function check_steam_group($group_name, $parent_group_name = NULL, $description = NULL, $fix = FALSE)
{
$parent_group = NULL;
if (is_string($parent_group_name)) {
$parent_group = steam_factory::get_group($GLOBALS["STEAM"]->get_id(), $parent_group_name);
if (!is_object($parent_group)) {
echo "Error: could not find parent group '" . $parent_group_name . "' for group '" . $group_name . "'.\n";
return FALSE;
}
}
$group_fullname = (is_string($parent_group_name) ? $parent_group_name . "." : "") . $group_name;
$group = steam_factory::get_group($GLOBALS["STEAM"]->get_id(), $group_fullname);
if (is_object($group)) {
return $group;
}
if (!$fix) {
echo "Error";
return FALSE;
}
$group = steam_factory::create_group($GLOBALS["STEAM"]->get_id(), $group_name, $parent_group, NULL, $description);
if (is_object($group)) {
echo "Created group '" . $group_fullname . "'.\n";
} else {
echo "Error: could not create group '" . $group_fullname . "'.\n";
}
return $group;
}
示例3: make_role
static function make_role($user_id, $context)
{
if (self::is_role($user_id, $context)) {
return;
}
$admin_group = steam_factory::get_group($GLOBALS["STEAM"]->get_id(), "Admin");
$user = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $user_id);
$admin_group->add_member($user);
}
示例4: remove_role
function remove_role()
{
$course_group_id = $this->get_context()->get_context_object();
$course_group = steam_factory::get_object($GLOBALS["STEAM"]->get_id(), $course_group_id);
$course_group_staff = steam_factory::get_group($GLOBALS["STEAM"]->get_id(), $course_group->get_groupname() . ".staff");
$GLOBALS["USERMANAGEMENT_DATA_ACCESS"]->removeUserFromGroup($this->get_userID(), $course_group_staff->get_id());
$cache = get_cache_function($course_group_staff->get_id());
$cache->drop("lms_steam::group_get_members", $course_group_staff->get_id());
}
示例5: execute
public function execute(Request $request, Response $response)
{
$sessionRegistry = SessionRegistry::getInstance();
$registry = Registry::getInstance();
$view = new TemplateView('ultimateMembershipOrganisation');
$maxParameterIndex = $sessionRegistry->get('maxParameterIndex');
// Benutzeraktion: neue Gruppe gewählt
if ($request->issetParameter('chooseGroup') and $request->issetParameter('groupSelect')) {
$sessionRegistry->set('activeGroup', $request->getParameter('groupSelect'));
}
// Benutzeraktion: Benutzer hinzufügen.
if ($request->issetParameter('addUser')) {
// eingegebenen Daten auf Korrektheit überprüfen.
$datacorrectness = true;
if (!$registry->get('ldapAccess')->ultimate_userExists($request->getParameter('username'))) {
$datacorrectness = false;
}
if ($datacorrectness) {
$done = $registry->get('ldapAccess')->ultimate_addUser($request->getParameter('username'), $registry->get('ldapAccess')->getGroupDN_2($sessionRegistry->get('activeGroup')));
if ($done === true) {
$view->assign('status', 'ok_2');
$view->assign('statusMsg', 'Der Benutzer wurde hinzugefügt!');
// LookUp durchführen
$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);
$user = steam_factory::get_user($steamConnector, $request->getParameter('username'));
$steamGroup->add_member($user, 0);
$steamConnector->disconnect();
} else {
$view->assign('status', 'warning_2');
$view->assign('statusMsg', 'Systemfehler: LDAP-Kommando fehlgeschlagen!');
}
} else {
$view->assign('status', 'warning_2');
$view->assign('statusMsg', 'Dieser Benutzer existiert nicht!');
}
}
// Benutzeraktion: Benutzer aus Gruppe entfernen.
if ($request->getParameter('remove') == 'true') {
$unremovedUser = array();
for ($i = 1; $i <= $maxParameterIndex; $i++) {
if ($request->issetParameter('name' . $i)) {
$done = $registry->get('ldapAccess')->ultimate_removeUser($request->getParameter('name' . $i), $registry->get('ldapAccess')->getGroupDN_2($sessionRegistry->get('activeGroup')));
if ($done == false) {
$unremovedUser[] = $request->getParameter('name' . $i);
} else {
// LookUp durchführen
$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);
$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!');
} else {
$statusMsg = 'Folgende Benutzer konnten nicht aus der Gruppe entfernt werden:<ul>';
foreach ($unremovedUser as $uid) {
$statusMsg .= '<li>' . $uid;
}
$statusMsg .= '</ul>Die übrigen der markierten Benutzer wurden aus dieser Gruppe entfernt!';
$view->assign('status', 'warning');
$view->assign('statusMsg', $statusMsg);
}
}
// Template-Variablen Werte zuweisen.
$view->assign('accessLevel', $sessionRegistry->get('accessLevel'));
$view->assign('groupList', $registry->get('ldapAccess')->getGroupsDN());
if ($request->issetParameter('groupSelect')) {
$view->assign('groupSelect', $request->getParameter('groupSelect'));
}
if ($sessionRegistry->get('activeGroup') != null and $sessionRegistry->get('activeGroup') != '') {
$memberlist = array();
$memberlist = $registry->get('ldapAccess')->ultimate_getGroupMembers($sessionRegistry->get('activeGroup'));
$sessionRegistry->set('maxParameterIndex', count($memberlist) + 1);
$view->assign('memberlist', $memberlist);
if (!$request->issetParameter('chooseGroup')) {
$view->assign('groupSelect', $sessionRegistry->get('activeGroup'));
}
}
// Ausgabe erzeugen
$view->render($request, $response);
}
示例6: execute
public function execute(Request $request, Response $response)
{
$sessionRegistry = SessionRegistry::getInstance();
$registry = Registry::getInstance();
$view = new TemplateView('createGroup');
// Benutzeraktion: neue Gruppe erstellen.
if ($request->issetParameter('createGroup')) {
$datacorrectness = true;
if (!$request->issetParameter('name') or !$request->issetParameter('owner')) {
$datacorrectness = false;
} elseif ($request->getParameter('name') == '') {
$datacorrectness = false;
$view->assign('status', 'warning');
$view->assign('statusMsg', 'Bitte geben Sie einen Gruppennamen an!');
} elseif ($this->checkGroupname($request->getParameter('name')) == false) {
$datacorrectness = false;
$view->assign('status', 'warning');
$view->assign('statusMsg', 'Dieser Gruppenname kann nicht verwendet werden. Bitte verwenden Sie keine der genannten Sonderzeichen!');
} elseif ($request->getParameter('owner') == '') {
$datacorrectness = false;
$view->assign('status', 'warning');
$view->assign('statusMsg', 'Sie haben keinen Besitzer angegeben!');
} elseif ($request->getParameter('owner') != '' and $registry->get('ldapAccess')->ultimate_userExists($request->getParameter('owner')) == false) {
$datacorrectness = false;
$view->assign('status', 'warning');
$view->assign('statusMsg', 'Der angegebene Benutzer existiert nicht!');
} elseif ($request->getParameter('name') != '' and $registry->get('ldapAccess')->groupExists($request->getParameter('name'), $sessionRegistry->get('school'), $sessionRegistry->get('district')) == true) {
$datacorrectness = false;
$view->assign('status', 'warning');
$view->assign('statusMsg', 'Dieser Gruppenname existiert bereits. Bitte wählen Sie einen anderen Namen!');
}
if ($datacorrectness) {
$done = false;
// Fall: Zu erstellende Gruppe ist eine Hauptgruppe
if ($request->getParameter('groupType') == 'maingroup') {
$done = $registry->get('ldapAccess')->createGroup($request->getParameter('name'), $request->getParameter('owner'), $request->getParameter('description'));
if ($done != false) {
$view->assign('status', 'ok');
$view->assign('statusMsg', 'Die Gruppe wurde erfolgreich angelegt!');
} else {
$view->assign('status', 'warning');
$view->assign('statusMsg', 'Systemfehler: LDAP-Kommando fehlgeschlagen!');
}
} elseif ($request->getParameter('groupType') == 'subgroup') {
$done = $registry->get('ldapAccess')->createGroup($request->getParameter('name'), $request->getParameter('owner'), $request->getParameter('description'), $request->getParameter('parent'));
if ($done !== false) {
$view->assign('status', 'ok');
$view->assign('statusMsg', 'Die Gruppe wurde erfolgreich angelegt!');
} else {
$view->assign('status', 'warning');
$view->assign('statusMsg', 'Systemfehler: LDAP-Kommando fehlgeschlagen!');
}
}
// falls gruppe erfolgreich angelegt wurde, lookUp durchführen
if ($done) {
$groupDN = $registry->get('ldapAccess')->getGroupDN_2($request->getParameter('name'));
// sTeam
$steamConnector = new steam_connector('localhost', 1900, 'root', 'h6518_W#');
if (!$steamConnector->get_login_status()) {
$view->assign('status', 'warning');
$view->assign('statusMsg', 'Verbindung zum sTeam-Server konnte nicht erstellt werden.<br>Die Gruppe wurde zwar angelegt, der LookUp jedoch nicht durchgeführt!');
} else {
$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);
$steamGroup->get_members(0);
}
}
}
}
// Werte den Template-Variablen zuweisen.
$view->assign('accessLevel', $sessionRegistry->get('accessLevel'));
$view->assign('standardOwner', $sessionRegistry->get('uid'));
$view->assign('groupList', $registry->get('ldapAccess')->getGroupsDN());
// Ausgabe erzeugen.
$view->render($request, $response);
}
示例7: 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;
}
}
}
}
}
}
}
}
示例8: createCourse
public function createCourse($id, $courseID, $customerID)
{
$user = lms_steam::get_current_user();
$all_users = steam_factory::groupname_to_object($GLOBALS["STEAM"]->get_id(), STEAM_ALL_USER);
$current_semester = steam_factory::get_group($GLOBALS["STEAM"]->get_id(), "Courses." . $this->getObjectName($customerID));
$elearning_course = elearning_mediathek::get_instance()->get_elearning_course_by_id($courseID);
$name = $elearning_course->get_name();
$new_course = steam_factory::create_group($GLOBALS["STEAM"]->get_id(), $id, $current_semester, FALSE, $name);
$icon_id = steam_factory::get_object_by_name($GLOBALS["STEAM"]->get_id(), "/packages/elearning_stahl_verkauf/icon_verkauf.jpg")->get_id();
$new_course->set_attributes(array("OBJ_TYPE" => "course", "COURSE_PARTICIPANT_MNGMNT" => 0, "COURSE_SEMESTER" => $this->getObjectName($customerID), "COURSE_TUTORS" => "", "COURSE_SHORT_DSC" => $elearning_course->get_description(), "COURSE_LONG_DSC" => "[img]" . PATH_SERVER . "/cached/get_document.php?id={$icon_id}&height=100[/img]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIn dieser Schulung möchten wir Ihnen die notwendigen Kenntnisse vermitteln, wie Sie ein Verkaufsgespräch gut führen – beginnend mit dem Blickkontakt, wenn eine Kundin oder ein Kunde Ihr Geschäft betritt, bis hin zur Verabschiedung, mit der Sie den Kunden hoffentlich mit dem Gefühl verabschieden, dass er bald wiederkommen wird.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOberhalb dieses Textes befindet sich eine Registerkarte »Lektionen«, über die Sie sich zunächst die Schulungsinhalte aneignen können. Auf diese Inhalte haben Sie jederzeit Zugriff; Sie können die Inhalte so oft durcharbeiten, wie Sie wünschen. Und Sie können dies von jedem an das Internet angeschlossenen Computer aus, also beispielsweise auch von zu Hause.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUm zu zeigen, dass Sie die Inhalte beherrschen, müssen Sie an einem Test teilnehmen. Dieser Test wird zu einem bestimmten Termin für Sie freigeschaltet. Sie erhalten dann zu gegebener Zeit eine Mitteilung, dass Sie zu dem Test zugelassen sind. Neben der Registerkarte, mit der Sie zu den Schulungsinhalten gelangen, finden Sie dann eine zusätzliche Registerkarte, mit der Sie den Test ablegen können.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSollten Sie auf Probleme stoßen – seien es technische, inhaltliche oder Fragen zur Benutzung dieses Systems – finden Sie Hilfe am oberen Rand dieser Seite. Außerdem können Sie jederzeit Kontakt zu Ihrem Ansprechpartner aufnehmen, der Ihnen gerne weiterhelfen wird.", "COURSE_HISLSF_ID" => "", "ACTIVATED_FOR_CUSTOMER" => $customerID));
$learners = steam_factory::create_group($GLOBALS["STEAM"]->get_id(), "learners", $new_course, FALSE, "Participants of course '" . $name . "'");
$learners->set_attribute("OBJ_TYPE", "course_learners");
$staff = steam_factory::create_group($GLOBALS["STEAM"]->get_id(), "staff", $new_course, FALSE, "Tutors of course '" . $name . "'");
$staff->set_attribute("OBJ_TYPE", "course_staff");
$admins = steam_factory::create_group($GLOBALS["STEAM"]->get_id(), "admins", $new_course, FALSE, "Admins of course '" . $name . "'");
$admins->set_attribute("OBJ_TYPE", "course_admins");
//$staff->add_member( $user );
// RIGHTS MANAGEMENT =======================================
$course_calendar = $new_course->get_calendar();
$learners_workroom = $learners->get_workroom();
$course_workroom = $new_course->get_workroom();
$staff->set_sanction_all($staff);
$staff->sanction_meta(SANCTION_ALL, $staff);
$learners->set_sanction_all($staff);
$learners->sanction_meta(SANCTION_ALL, $staff);
$new_course->set_sanction_all($staff);
$new_course->sanction_meta(SANCTION_ALL, $staff);
$admins->set_sanction_all($admins);
$admins->sanction_meta(SANCTION_ALL, $admins);
$staff->set_sanction_all($admins);
$staff->sanction_meta(SANCTION_ALL, $admins);
$learners->set_sanction_all($admins);
$learners->sanction_meta(SANCTION_ALL, $admins);
$new_course->set_sanction_all($admins);
$new_course->sanction_meta(SANCTION_ALL, $admins);
$course_calendar->set_acquire(FALSE);
$course_calendar->set_sanction_all($staff);
$course_calendar->sanction_meta(SANCTION_ALL, $staff);
$course_calendar->set_sanction_all($admins);
$course_calendar->sanction_meta(SANCTION_ALL, $admins);
$course_calendar->set_read_access($learners, TRUE);
$course_calendar->set_write_access($new_course, FALSE);
$course_calendar->set_insert_access($new_course, FALSE);
$course_calendar->set_insert_access($all_users, FALSE);
// Course workroom
$course_workroom->set_sanction($new_course, SANCTION_READ | SANCTION_EXECUTE | SANCTION_ANNOTATE);
$course_workroom->set_sanction_all($staff);
$course_workroom->set_sanction_all($admins);
$course_workroom->sanction_meta(SANCTION_ALL, $staff);
$course_workroom->sanction_meta(SANCTION_ALL, $admins);
// Learners workroom
$learners_workroom->set_read_access($all_users, TRUE);
$learners_workroom->set_sanction($learners, SANCTION_READ | SANCTION_EXECUTE | SANCTION_ANNOTATE);
$learners_workroom->set_sanction_all($staff);
$learners_workroom->set_sanction_all($admins);
$learners_workroom->sanction_meta(SANCTION_ALL, $staff);
$learners_workroom->sanction_meta(SANCTION_ALL, $admins);
$koala_course = new koala_group_course($new_course);
$koala_course->set_access(1, $learners, $staff, $admins, KOALA_GROUP_ACCESS);
$new_course->set_attributes(array("COURSE_UNITS_ENABLED" => "TRUE", "UNITS_DOCPOOL_ENABLED" => "TRUE", "UNITS_ELEARNING_ENABLED" => "TRUE", "UNITS_MEDIATHING_ENABLED" => "FALSE", "UNITS_ORGANIZATION_ENABLED" => "FALSE", "UNITS_VIDEOSTREAMING_ENABLED" => "FALSE"));
// create unit elearning
$env = $koala_course->get_workroom();
$new_unit_elearning_course = steam_factory::create_container($GLOBALS["STEAM"]->get_id(), $elearning_course->get_name(), $env, $elearning_course->get_description());
$new_unit_elearning_course->set_attributes(array("UNIT_TYPE" => "units_elearning", "OBJ_TYPE" => "elearning_unit_koala", "UNIT_DISPLAY_TYPE" => gettext("units_elearning"), "ELEARNING_UNIT_ID" => $courseID));
return true;
}
示例9: foreach
$course_tutors = $course["COURSE_TUTORS"];
}
}
}
if ($no_user_courses > 0) {
foreach ($user_courses as $user_course) {
$debug_info = $debug_info . " # " . "User course object name: " . $user_course["OBJ_NAME"];
if ($user_course["OBJ_NAME"] == $membership["OBJ_NAME"]) {
echo "<id>" . $user_course["OBJ_NAME"] . "</id>" . "\n";
echo "<title><![CDATA[" . $user_course["COURSE_NAME"] . "]]></title>" . "\n";
echo "<tutors><![CDATA[" . $course_tutors . "]]></tutors>" . "\n";
echo "<semester><![CDATA[" . $user_course["SEMESTER_NAME"] . "]]></semester>" . "\n";
echo "<link><![CDATA[" . $user_course["COURSE_LINK"] . "]]></link>" . "\n";
$group_name = "Courses." . $user_course["SEMESTER_NAME"] . "." . $membership["OBJ_NAME"] . ".learners";
$debug_info = $debug_info . " # " . "Group name path: " . $group_name;
$courses_group = steam_factory::get_group($GLOBALS["STEAM"]->get_id(), $group_name);
$no_courses_group = count($courses_group);
$debug_info = $debug_info . " # " . "Number of found course groups: " . $no_courses_group;
$debug_info = $debug_info . " # " . "Course group object: " . is_object($courses_group);
if ($no_courses_group > 0 && is_object($courses_group)) {
$workroom = $courses_group->get_workroom();
$inventory = $workroom->get_inventory(CLASS_CONTAINER);
$no_inventory = $workroom->count_inventory();
$debug_info = $debug_info . " # " . "Number of found course group workroom inventory: " . $no_inventory;
if ($no_inventory > 0) {
echo "<extension>" . "\n";
foreach ($inventory as $category) {
echo "<lection id=\"" . $category->get_id() . "\" name=\"" . $category->get_attribute(OBJ_NAME) . "\" description=\"" . $category->get_attribute(OBJ_DESC) . "\" creation_time=\"" . $category->get_attribute(OBJ_CREATION_TIME) . "\" last_changed=\"" . $category->get_attribute(OBJ_LAST_CHANGED) . "\">" . "\n";
/*
//only for testing
echo "<LECTION_ID>" . $category->get_id() . "</LECTION_ID>";
示例10: header
<?php
include_once "../etc/koala.conf.php";
include_once PATH_LIB . "url_handling.inc.php";
include_once PATH_LIB . "format_handling.inc.php";
if (!isset($portal)) {
$portal = lms_portal::get_instance();
$portal->initialize(GUEST_NOT_ALLOWED);
} else {
$portal->set_guest_allowed(GUEST_NOT_ALLOWED);
}
$user = lms_steam::get_current_user();
$admin_group = steam_factory::get_group($GLOBALS["STEAM"]->get_id(), "admin");
if (!is_object($admin_group) || !$admin_group->is_member($user)) {
include "no_access.php";
exit;
}
$extension_manager = lms_steam::get_extensionmanager();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_POST["enable"]) && is_array($_POST["enable"])) {
$extension_manager->enable_extension(key($_POST["enable"]));
header("Location: " . PATH_URL . "extensions_index.php");
exit;
}
if (isset($_POST["disable"]) && is_array($_POST["disable"])) {
$extension_manager->disable_extension(key($_POST["disable"]));
header("Location: " . PATH_URL . "extensions_index.php");
exit;
}
} else {
if (empty($_GET["extension"])) {
示例11: user_get_profile_privacy
public function user_get_profile_privacy($login, $is_privacy_page = FALSE)
{
$steam_user = steam_factory::username_to_object($GLOBALS["STEAM"]->get_id(), $login);
$privacy_object = $steam_user->get_attribute("KOALA_PRIVACY");
$user = lms_steam::get_current_user();
$my_profile = $user->get_id() == $steam_user->get_id();
$admin_group = steam_factory::get_group($GLOBALS["STEAM"]->get_id(), "admin");
$isAdmin = is_object($admin_group) && $admin_group->is_member($user);
if ($privacy_object instanceof steam_object && ($is_privacy_page || !$my_profile && !$isAdmin)) {
$query = array("PRIVACY_STATUS", "PRIVACY_GENDER", "PRIVACY_FACULTY", "PRIVACY_MAIN_FOCUS", "PRIVACY_WANTS", "PRIVACY_HAVES", "PRIVACY_ORGANIZATIONS", "PRIVACY_HOMETOWN", "PRIVACY_OTHER_INTERESTS", "PRIVACY_LANGUAGES", "PRIVACY_CONTACTS", "PRIVACY_GROUPS", "PRIVACY_EMAIL", "PRIVACY_ADDRESS", "PRIVACY_TELEPHONE", "PRIVACY_PHONE_MOBILE", "PRIVACY_WEBSITE", "PRIVACY_ICQ_NUMBER", "PRIVACY_MSN_IDENTIFICATION", "PRIVACY_AIM_ALIAS", "PRIVACY_YAHOO_ID", "PRIVACY_SKYPE_NAME");
return $privacy_object->get_attributes($query);
} else {
return array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
}
}
示例12: get_subgroup_by_name
public function get_subgroup_by_name($subgroup_name)
{
return steam_factory::get_group($this->steam_connectorID, $this->get_groupname() . '.' . $subgroup_name);
}
示例13: steam_connector
$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);
} else {
if ($group_id !== 0) {
array_push($user_favourites, $group);
}
}
示例14: move_group_on_steam
function move_group_on_steam($groupDN, $parentDN)
{
// verbindung zu steam aufbauen
$steamConnector = new steam_connector('localhost', 1900, 'root', 'h6518_W#');
// referenz auf die steam-gruppe holen
$ldap_module = $steamConnector->get_server_module('persistence:ldap');
$steam_groupname = $steamConnector->predefined_command($ldap_module, 'dn_to_group_name', $groupDN, 0);
$steamGroup = steam_factory::get_group($steamConnector, $steam_groupname, 0);
// referenz auf die neue parent-group holen
$steam_groupname_parent_new = $steamConnector->predefined_command($ldap_module, 'dn_to_group_name', $parentDN, 0);
$steamGroup_parent_new = steam_factory::get_group($steamConnector, $steam_groupname_parent_new, 0);
// parent-group bestimmen
$steamGroup_parent = $steamGroup->get_parent_group();
// gruppe aus der alten parent-group entfernen
$steamGroup_parent->remove_member($steamGroup);
// gruppe der neuen parent-group hinzufügen
$steamGroup_parent_new->add_member($steamGroup);
}
示例15: 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!');
//.........這裏部分代碼省略.........