Implementing AuthComponent::$autoRedirect()

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4483 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2007-02-08 22:25:45 +00:00
parent 8a025938b5
commit a1afe34106

View file

@ -191,7 +191,6 @@ class AuthComponent extends Object {
if ($this->allowedActions == array('*') || in_array($controller->action, $this->allowedActions)) {
return false;
}
if (!isset($controller->params['url']['url'])) {
$url = '';
} else {
@ -207,7 +206,7 @@ class AuthComponent extends Object {
$this->userModel . '.' . $this->fields['username'] => '= ' . $controller->data[$this->userModel][$this->fields['username']],
$this->userModel . '.' . $this->fields['password'] => '= ' . $controller->data[$this->userModel][$this->fields['password']]
);
if ($this->login($data)) {
if ($this->login($data) && $this->autoRedirect) {
$controller->redirect($this->redirect(), null, true);
} else {
$this->Session->setFlash($this->loginError, 'default', array(), 'Auth.login');