mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Implementing AuthComponent::$logoutAction
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4640 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
3cb77b98c9
commit
6e77abb3ca
1 changed files with 16 additions and 2 deletions
|
@ -117,10 +117,21 @@ class AuthComponent extends Object {
|
|||
* redirected back after a successful login. If this session value is not
|
||||
* set, the user will be redirected to the page specified in $loginRedirect.
|
||||
*
|
||||
* @var string
|
||||
* @var mixed
|
||||
* @access public
|
||||
*/
|
||||
var $loginRedirect = null;
|
||||
/**
|
||||
* The the default action to redirect to after the user is logged out. While AuthComponent does
|
||||
* not handle post-logout redirection, a redirect URL will be returned from AuthComponent::logout().
|
||||
* Defaults to AuthComponent::$loginAction.
|
||||
*
|
||||
* @var mixed
|
||||
* @access public
|
||||
* @see AuthComponent::$loginAction
|
||||
* @see AuthComponent::logout()
|
||||
*/
|
||||
var $logoutRedirect = null;
|
||||
/**
|
||||
* The type of automatic ACL validation to perform, where 'actions' validates
|
||||
* the controller action of the current request, 'objects' validates against
|
||||
|
@ -304,6 +315,9 @@ class AuthComponent extends Object {
|
|||
if (empty($this->sessionKey)) {
|
||||
$this->sessionKey = 'Auth.' . $this->userModel;
|
||||
}
|
||||
if (empty($this->logoutAction)) {
|
||||
$this->logoutRedirect = $this->loginAction;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
|
@ -481,7 +495,7 @@ class AuthComponent extends Object {
|
|||
$this->Session->del($this->sessionKey);
|
||||
$this->Session->del('Auth.redirect');
|
||||
$this->_loggedIn = false;
|
||||
return $this->_normalizeURL($this->loginAction);
|
||||
return $this->_normalizeURL($this->logoutRedirect);
|
||||
}
|
||||
/**
|
||||
* Get the current user from the session.
|
||||
|
|
Loading…
Reference in a new issue