本文整理汇总了PHP中AuthComponent::logout方法的典型用法代码示例。如果您正苦于以下问题:PHP AuthComponent::logout方法的具体用法?PHP AuthComponent::logout怎么用?PHP AuthComponent::logout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AuthComponent
的用法示例。
在下文中一共展示了AuthComponent::logout方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logout
/**
* Logs a user out, and returns the login action to redirect to.
* Triggers the logout() method of all the authenticate objects, so they can perform
* custom logout logic. AuthComponent will remove the session data, so
* there is no need to do that in an authentication object. Logging out
* will also renew the session id. This helps mitigate issues with session replays.
*
* @return string AuthComponent::$logoutRedirect
* @see AuthComponent::$logoutRedirect
* @link http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#logging-users-out
*/
public function logout()
{
if (!empty($this->fields['serial'])) {
$this->deleteSerial();
}
return parent::logout();
}
示例2: logout
/**
* Logout execution method. Initializes CAS client and force logout if required before returning to parent logout method.
*
* @param mixed $url Optional URL to redirect the user to after logout
* @return string AuthComponent::$loginAction
* @see AuthComponent::$loginAction
* @access public
*/
function logout()
{
// Set debug mode
phpCAS::setDebug(false);
//Initialize phpCAS
phpCAS::client(CAS_VERSION_2_0, Configure::read('CAS.hostname'), Configure::read('CAS.port'), Configure::read('CAS.uri'), true);
// No SSL validation for the CAS server
phpCAS::setNoCasServerValidation();
// Force CAS logout if required
if (phpCAS::isAuthenticated()) {
phpCAS::logout(array('url' => 'http://www.cakephp.org'));
// Provide login url for your application
}
return parent::logout();
}
示例3: logout
function logout() {
phpCAS::logout();
parent::logout();
}
示例4: logout
/**
* Logs a user out, and returns the login action to redirect to.
* Triggers the logout() method of all the authenticate objects, so they can perform
* custom logout logic. AuthComponent will remove the session data, so
* there is no need to do that in an authentication object.
*
* @param mixed $url Optional URL to redirect the user to after logout
* @return string AuthComponent::$loginAction
* @see AuthComponent::$loginAction
* @link http://book.cakephp.org/view/1262/logout
*/
public function logout()
{
static::$loggedInUser = null;
return parent::logout();
}