本文整理匯總了PHP中eZUser::userHasLoggedOut方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZUser::userHasLoggedOut方法的具體用法?PHP eZUser::userHasLoggedOut怎麽用?PHP eZUser::userHasLoggedOut使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZUser
的用法示例。
在下文中一共展示了eZUser::userHasLoggedOut方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: logoutCurrent
static function logoutCurrent()
{
$http = eZHTTPTool::instance();
$id = false;
$GLOBALS["eZUserGlobalInstance_{$id}"] = false;
$contentObjectID = $http->sessionVariable('eZUserLoggedInID');
// reset session data
$newUserID = self::anonymousId();
eZSession::setUserID($newUserID);
$http->setSessionVariable('eZUserLoggedInID', $newUserID);
// Clear current basket if necessary
$db = eZDB::instance();
$db->begin();
eZBasket::cleanupCurrentBasket();
$db->commit();
if ($contentObjectID) {
//set last visit to minus
self::updateLastVisitByLogout($contentObjectID);
//clean up sessions
self::cleanup();
}
// give user new session id
eZSession::regenerate();
// set the property used to prevent SSO from running again
self::$userHasLoggedOut = true;
}
示例2: logoutCurrent
static function logoutCurrent()
{
$http = eZHTTPTool::instance();
$id = false;
$GLOBALS["eZUserGlobalInstance_$id"] = false;
$contentObjectID = $http->sessionVariable( 'eZUserLoggedInID' );
// reset session data
$newUserID = self::anonymousId();
eZSession::setUserID( $newUserID );
$http->setSessionVariable( 'eZUserLoggedInID', $newUserID );
// Clear current basket if necessary
$db = eZDB::instance();
$db->begin();
if ( eZINI::instance( 'site.ini' )->variable( 'Session', 'UseBasket' ) != 'false' )
{
eZBasket::cleanupCurrentBasket();
}
$db->commit();
if ( $contentObjectID )
self::cleanup();
// give user new session id
eZSession::regenerate();
// set the property used to prevent SSO from running again
self::$userHasLoggedOut = true;
}