Don't get User model if not needed. Fixes #563

Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
Matt Curry 2010-04-09 13:53:16 -04:00 committed by Mark Story
parent ceb2a1d4ed
commit 1c5898d94b

View file

@ -922,12 +922,15 @@ class AuthComponent extends Object {
return $this->authenticate->hashPasswords($data);
}
if (is_array($data)) {
$model =& $this->getModel();
if (is_array($data) && isset($data[$model->alias])) {
if(isset($data[$model->alias])) {
if (isset($data[$model->alias][$this->fields['username']]) && isset($data[$model->alias][$this->fields['password']])) {
$data[$model->alias][$this->fields['password']] = $this->password($data[$model->alias][$this->fields['password']]);
}
}
}
return $data;
}