Closes #3462, Auth component cause post validation of security component fails.

Fixes #3500,  Auth and Security at the same time. input a error username or a error password. the failure redirector will mistake. 

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5990 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-11-12 18:14:18 +00:00
parent dbe9beb6cb
commit a681c99c0f

View file

@ -62,7 +62,14 @@ class Component extends Object {
$this->controller =& $controller;
if ($this->controller->components !== false) {
$loaded = array();
$this->controller->components = array_merge(array('Session'), $this->controller->components);
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 {
$this->controller->components = array_merge(array('Session'), $this->controller->components);
}
$loaded = $this->_loadComponents($loaded, $this->controller->components);
foreach (array_keys($loaded) as $component) {