/** * Get singleton instance of this class * * @access public * */ public static function _getInstance() { if (is_object(self::$instance)) { return self::$instance; } return self::$instance = new ilLDAPRoleGroupMapping(); }
/** * Deassigns a user from a role. Update of table rbac_ua * @access public * @param integer object id of role * @param integer object id of user * @return boolean true on success */ public function deassignUser($a_rol_id, $a_usr_id) { global $ilDB, $rbacreview; if (!isset($a_rol_id) or !isset($a_usr_id)) { $message = get_class($this) . "::deassignUser(): Missing parameter! role_id: " . $a_rol_id . " usr_id: " . $a_usr_id; $this->ilErr->raiseError($message, $this->ilErr->WARNING); } $query = "DELETE FROM rbac_ua " . "WHERE usr_id = " . $ilDB->quote($a_usr_id, 'integer') . " " . "AND rol_id = " . $ilDB->quote($a_rol_id, 'integer') . " "; $res = $ilDB->manipulate($query); $rbacreview->setAssignedCacheEntry($a_rol_id, $a_usr_id, false); include_once 'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php'; $mapping = ilLDAPRoleGroupMapping::_getInstance(); $mapping->deassign($a_rol_id, $a_usr_id); return true; }
/** * show LDAP role group mapping info * * @access public * @param string section name. Leave empty to place this info string inside a section * */ public function showLDAPRoleGroupMappingInfo($a_section = '') { if (strlen($a_section)) { $this->addSection($a_section); } include_once 'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php'; $ldap_mapping = ilLDAPRoleGroupMapping::_getInstance(); if ($infos = $ldap_mapping->getInfoStrings($this->gui_object->object->getId())) { $info_combined = '<div style="color:green;">'; $counter = 0; foreach ($infos as $info_string) { if ($counter++) { $info_combined .= '<br />'; } $info_combined .= $info_string; } $info_combined .= '</div>'; $this->addProperty($this->lng->txt('applications'), $info_combined); } return true; }
/** * deletes a user * @access public * @param integer user_id */ function delete() { global $rbacadmin, $ilDB; // deassign from ldap groups include_once 'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php'; $mapping = ilLDAPRoleGroupMapping::_getInstance(); $mapping->deleteUser($this->getId()); // remove mailbox / update sent mails include_once "Services/Mail/classes/class.ilMailbox.php"; $mailbox = new ilMailbox($this->getId()); $mailbox->delete(); $mailbox->updateMailsOfDeletedUser($this->getLogin()); // delete feed blocks on personal desktop include_once "./Services/Block/classes/class.ilCustomBlock.php"; $costum_block = new ilCustomBlock(); $costum_block->setContextObjId($this->getId()); $costum_block->setContextObjType("user"); $c_blocks = $costum_block->queryBlocksForContext(); include_once "./Services/Feeds/classes/class.ilPDExternalFeedBlock.php"; foreach ($c_blocks as $c_block) { if ($c_block["type"] == "pdfeed") { $fb = new ilPDExternalFeedBlock($c_block["id"]); $fb->delete(); } } // delete block settings include_once "./Services/Block/classes/class.ilBlockSetting.php"; ilBlockSetting::_deleteSettingsOfUser($this->getId()); // delete user_account $ilDB->manipulateF("DELETE FROM usr_data WHERE usr_id = %s", array("integer"), array($this->getId())); // delete user_prefs ilObjUser::_deleteAllPref($this->getId()); // delete user_session include_once "./Services/Authentication/classes/class.ilSession.php"; ilSession::_destroyByUserId($this->getId()); // remove user from rbac $rbacadmin->removeUser($this->getId()); // remove bookmarks // TODO: move this to class.ilBookmarkFolder $q = "DELETE FROM bookmark_tree WHERE tree = " . $ilDB->quote($this->getId(), "integer"); $ilDB->manipulate($q); $q = "DELETE FROM bookmark_data WHERE user_id = " . $ilDB->quote($this->getId(), "integer"); $ilDB->manipulate($q); // DELETE FORUM ENTRIES (not complete in the moment) include_once './Modules/Forum/classes/class.ilObjForum.php'; ilObjForum::_deleteUser($this->getId()); // Delete link check notify entries include_once './Services/LinkChecker/classes/class.ilLinkCheckNotify.php'; ilLinkCheckNotify::_deleteUser($this->getId()); // Delete crs entries include_once './Modules/Course/classes/class.ilObjCourse.php'; ilObjCourse::_deleteUser($this->getId()); // Delete user tracking include_once './Services/Tracking/classes/class.ilObjUserTracking.php'; ilObjUserTracking::_deleteUser($this->getId()); include_once 'Modules/Session/classes/class.ilEventParticipants.php'; ilEventParticipants::_deleteByUser($this->getId()); // Delete Tracking data SCORM 2004 RTE include_once 'Modules/Scorm2004/classes/ilSCORM13Package.php'; ilSCORM13Package::_removeTrackingDataForUser($this->getId()); // Delete Tracking data SCORM 1.2 RTE include_once 'Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php'; ilObjSCORMLearningModule::_removeTrackingDataForUser($this->getId()); // remove all notifications include_once "./Services/Notification/classes/class.ilNotification.php"; ilNotification::removeForUser($this->getId()); // remove portfolios include_once "./Modules/Portfolio/classes/class.ilObjPortfolio.php"; ilObjPortfolio::deleteUserPortfolios($this->getId()); // remove workspace include_once "./Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php"; $tree = new ilWorkspaceTree($this->getId()); $tree->cascadingDelete(); // remove disk quota entries include_once "./Services/DiskQuota/classes/class.ilDiskQuotaHandler.php"; ilDiskQuotaHandler::deleteByOwner($this->getId()); // Delete user defined field entries $this->deleteUserDefinedFieldEntries(); // Delete clipboard entries $this->clipboardDeleteAll(); // Reset owner $this->resetOwner(); // Trigger deleteUser Event global $ilAppEventHandler; $ilAppEventHandler->raise('Services/User', 'deleteUser', array('usr_id' => $this->getId())); // delete object data parent::delete(); return true; }
/** * constructor * */ function ilObjectListGUI() { global $rbacsystem, $ilCtrl, $lng, $ilias; $this->rbacsystem = $rbacsystem; $this->ilias = $ilias; $this->ctrl = $ilCtrl; $this->lng = $lng; $this->mode = IL_LIST_FULL; $this->path_enabled = false; $this->enableComments(false); $this->enableNotes(false); $this->enableTags(false); // unique js-ids $this->setParentRefId($_REQUEST["ref_id"]); //echo "list"; $this->init(); include_once 'Services/LDAP/classes/class.ilLDAPRoleGroupMapping.php'; $this->ldap_mapping = ilLDAPRoleGroupMapping::_getInstance(); $lng->loadLanguageModule("obj"); }