mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
"Removing checks in Component::init(); to check for Security component.
Changed AuthComponent::startup() so that the password key $this->data is set to null when login fails instead of being unset." git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6589 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
ecfd70052d
commit
f6652d1b73
2 changed files with 4 additions and 9 deletions
|
@ -54,12 +54,7 @@ class Component extends Object {
|
|||
$this->controller =& $controller;
|
||||
if ($this->controller->components !== false) {
|
||||
$loaded = array();
|
||||
|
||||
if(in_array('Security', $this->controller->components)) {
|
||||
$remove = array_flip($this->controller->components);
|
||||
unset($remove['Security']);
|
||||
$this->controller->components = array_merge(array('Session', 'Security'), array_flip($remove));
|
||||
} else {
|
||||
if (!in_array('Session', $this->controller->components)) {
|
||||
$this->controller->components = array_merge(array('Session'), $this->controller->components);
|
||||
}
|
||||
$loaded = $this->_loadComponents($loaded, $this->controller->components);
|
||||
|
|
|
@ -279,11 +279,11 @@ class AuthComponent extends Object {
|
|||
}
|
||||
|
||||
$this->loginAction = Router::normalize($this->loginAction);
|
||||
|
||||
|
||||
if ($this->loginAction != Router::normalize($url) && ($this->allowedActions == array('*') || in_array($controller->action, $this->allowedActions))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ($this->loginAction == Router::normalize($url)) {
|
||||
if (empty($controller->data) || !isset($controller->data[$this->userModel])) {
|
||||
if (!$this->Session->check('Auth.redirect') && env('HTTP_REFERER')) {
|
||||
|
@ -304,7 +304,7 @@ class AuthComponent extends Object {
|
|||
return true;
|
||||
} else {
|
||||
$this->Session->setFlash($this->loginError, 'default', array(), 'auth');
|
||||
unset($controller->data[$this->userModel][$this->fields['password']]);
|
||||
$controller->data[$this->userModel][$this->fields['password']] = null;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue