本文整理汇总了PHP中ilSession::_destroyByUserId方法的典型用法代码示例。如果您正苦于以下问题:PHP ilSession::_destroyByUserId方法的具体用法?PHP ilSession::_destroyByUserId怎么用?PHP ilSession::_destroyByUserId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilSession
的用法示例。
在下文中一共展示了ilSession::_destroyByUserId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testBasicSessionBehaviour
/**
* @group IL_Init
*/
public function testBasicSessionBehaviour()
{
global $ilUser;
include_once "./Services/Authentication/classes/class.ilSession.php";
$result = "";
ilSession::_writeData("123456", "Testdata");
if (ilSession::_exists("123456")) {
$result .= "exists-";
}
if (ilSession::_getData("123456") == "Testdata") {
$result .= "write-get-";
}
$duplicate = ilSession::_duplicate("123456");
if (ilSession::_getData($duplicate) == "Testdata") {
$result .= "duplicate-";
}
ilSession::_destroy("123456");
if (!ilSession::_exists("123456")) {
$result .= "destroy-";
}
ilSession::_destroyExpiredSessions();
if (ilSession::_exists($duplicate)) {
$result .= "destroyExp-";
}
ilSession::_destroyByUserId($ilUser->getId());
if (!ilSession::_exists($duplicate)) {
$result .= "destroyByUser-";
}
$this->assertEquals("exists-write-get-duplicate-destroy-destroyExp-destroyByUser-", $result);
}
示例2: delete
/**
* 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;
}