Skip to content

Commit

Permalink
Don't get User model if not needed. Fixes #563
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information
Matt Curry authored and markstory committed Apr 10, 2010
1 parent ceb2a1d commit 1c5898d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cake/libs/controller/components/auth.php
Expand Up @@ -922,10 +922,13 @@ function hashPasswords($data) {
return $this->authenticate->hashPasswords($data);
}

$model =& $this->getModel();
if (is_array($data) && 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']]);
if (is_array($data)) {
$model =& $this->getModel();

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;
Expand Down

0 comments on commit 1c5898d

Please sign in to comment.