本文整理匯總了PHP中IEM::sessionReset方法的典型用法代碼示例。如果您正苦於以下問題:PHP IEM::sessionReset方法的具體用法?PHP IEM::sessionReset怎麽用?PHP IEM::sessionReset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IEM
的用法示例。
在下文中一共展示了IEM::sessionReset方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: userLogin
/**
* Login to the system
* Login to the system with specified user ID
*
* NOTE: This will reset session variables and possibly session ID too
*
* @param integer $userid Login with this user ID
* @param boolean $recordLastLogin Whether or not to record last login
* @param boolean $clearStack Whether or not to clear login stack
*
* @return boolean Returns TRUE if successful, FALSE othwerwise
*/
public static final function userLogin($userid, $recordLastLogin = true, $clearStack = false)
{
$userid = intval($userid);
if (empty($userid)) {
return false;
}
$user = GetUser($userid);
if (!$user) {
return false;
}
// Do we want to record this?
if ($recordLastLogin) {
$rand_check = uniqid(true);
$user->settings['LoginCheck'] = $rand_check;
$user->SaveSettings();
$user->UpdateLoginTime();
}
if ($clearStack) {
self::$_userStack = array();
}
self::$_userStack[] = $user->userid;
self::$_userCacheObject = $user;
// ----- Save user information into session
IEM::sessionReset();
IEM::sessionSet('__IEM_SYSTEM_CurrentUser_Stack', self::$_userStack);
// -----
return true;
}