本文整理汇总了PHP中ilSession::setClosingContext方法的典型用法代码示例。如果您正苦于以下问题:PHP ilSession::setClosingContext方法的具体用法?PHP ilSession::setClosingContext怎么用?PHP ilSession::setClosingContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilSession
的用法示例。
在下文中一共展示了ilSession::setClosingContext方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: goToLogin
/**
* go to login
*
* @param int $a_auth_stat
*/
protected static function goToLogin($a_auth_stat = "")
{
global $ilAuth;
// close current session
if ($a_auth_stat == AUTH_EXPIRED || $a_auth_stat == AUTH_IDLED) {
ilSession::setClosingContext(ilSession::SESSION_CLOSE_EXPIRE);
} else {
ilSession::setClosingContext(ilSession::SESSION_CLOSE_LOGIN);
}
$ilAuth->logout();
session_unset();
session_destroy();
$add = "";
if ($_GET["soap_pw"] != "") {
$add = "&soap_pw=" . $_GET["soap_pw"] . "&ext_uid=" . $_GET["ext_uid"];
}
$script = "login.php?target=" . $_GET["target"] . "&client_id=" . $_COOKIE["ilClientId"] . "&auth_stat=" . $a_auth_stat . $add;
self::redirect($script, "init_error_authentication_fail", array("en" => "Authentication failed.", "de" => "Authentifizierung fehlgeschlagen."));
}
示例2: deleteOwnAccountLogout
protected function deleteOwnAccountLogout()
{
global $ilAuth, $ilUser;
// we are setting the flag and ending the session in the same step
$ilUser->activateDeletionFlag();
// see ilStartupGUI::showLogout()
ilSession::setClosingContext(ilSession::SESSION_CLOSE_USER);
$ilAuth->logout();
session_destroy();
ilUtil::redirect("login.php?target=usr_" . md5("usrdelown"));
}
示例3: showLogout
/**
* show logout screen
*/
function showLogout()
{
global $tpl, $ilSetting, $ilAuth, $lng, $ilIliasIniFile;
ilSession::setClosingContext(ilSession::SESSION_CLOSE_USER);
$ilAuth->logout();
session_destroy();
// reset cookie
$client_id = $_COOKIE["ilClientId"];
ilUtil::setCookie("ilClientId", "");
//instantiate logout template
self::initStartUpTemplate("tpl.logout.html");
if ($ilSetting->get("pub_section")) {
$tpl->setCurrentBlock("homelink");
$tpl->setVariable("CLIENT_ID", "?client_id=" . $client_id . "&lang=" . $lng->getLangKey());
$tpl->setVariable("TXT_HOME", $lng->txt("home"));
$tpl->parseCurrentBlock();
}
if ($ilIliasIniFile->readVariable("clients", "list")) {
$tpl->setCurrentBlock("client_list");
$tpl->setVariable("TXT_CLIENT_LIST", $lng->txt("to_client_list"));
$this->ctrl->setParameter($this, "client_id", $client_id);
$tpl->setVariable("CMD_CLIENT_LIST", $this->ctrl->getLinkTarget($this, "showClientList"));
$tpl->parseCurrentBlock();
$this->ctrl->setParameter($this, "client_id", "");
}
$tpl->setVariable("TXT_PAGEHEADLINE", $lng->txt("logout"));
$tpl->setVariable("TXT_LOGOUT_TEXT", $lng->txt("logout_text"));
$tpl->setVariable("TXT_LOGIN", $lng->txt("login_to_ilias"));
$tpl->setVariable("CLIENT_ID", "?client_id=" . $client_id . "&lang=" . $lng->getLangKey());
$tpl->show();
}
示例4: checkCurrentSessionIsAllowed
/**
* checks wether the current session exhaust the limit of sessions
* when limit is reached it deletes "firstRequestAbidencer" and checks again
* when limit is still reached it deletes "oneMinIdleSession" and checks again
* when limit is still reached the current session will be logged out
*
* @global ilSetting $ilSetting
* @global ilAppEventHandler $ilAppEventHandler
* @param Auth $a_auth
*/
private static function checkCurrentSessionIsAllowed(Auth $a_auth, $a_user_id)
{
global $ilSetting;
$max_sessions = (int) $ilSetting->get('session_max_count', DEFAULT_MAX_COUNT);
if ($max_sessions > 0) {
// get total number of sessions
$num_sessions = self::getExistingSessionCount(self::$session_types_controlled);
self::debug(__METHOD__ . "--> total existing sessions (" . $num_sessions . ")");
if ($num_sessions + 1 > $max_sessions) {
self::debug(__METHOD__ . ' --> limit for session pool reached, but try kicking some first request abidencer');
self::kickFirstRequestAbidencer(self::$session_types_controlled);
// get total number of sessions again
$num_sessions = self::getExistingSessionCount(self::$session_types_controlled);
if ($num_sessions + 1 > $max_sessions) {
self::debug(__METHOD__ . ' --> limit for session pool still reached so try kick one min idle session');
self::kickOneMinIdleSession(self::$session_types_controlled);
// get total number of sessions again
$num_sessions = self::getExistingSessionCount(self::$session_types_controlled);
if ($num_sessions + 1 > $max_sessions) {
self::debug(__METHOD__ . ' --> limit for session pool still reached so logout session (' . session_id() . ') and trigger event');
ilSession::setClosingContext(ilSession::SESSION_CLOSE_LIMIT);
// as the session is opened and closed in one request, there
// is no proper session yet and we have to do this ourselves
ilSessionStatistics::createRawEntry(session_id(), $_SESSION['SessionType'], time(), $a_user_id);
$a_auth->logout();
// Trigger reachedSessionPoolLimit Event
global $ilAppEventHandler;
$ilAppEventHandler->raise('Services/Authentication', 'reachedSessionPoolLimit', array());
// auth won't do this, we need to close session properly
session_destroy();
ilUtil::redirect('login.php?reached_session_limit=true');
} else {
self::debug(__METHOD__ . ' --> limit of session pool not reached anymore after kicking one min idle session');
}
} else {
self::debug(__METHOD__ . ' --> limit of session pool not reached anymore after kicking some first request abidencer');
}
} else {
self::debug(__METHOD__ . ' --> limit for session pool not reached yet');
}
} else {
self::debug(__METHOD__ . ' --> limit for session pool not set so check is bypassed');
}
}