Permalink
Browse files

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

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
1 parent ceb2a1d commit 1c5898d94b177368633278f59ec47a2a95570116 Matt Curry committed with markstory Apr 9, 2010
Showing with 7 additions and 4 deletions.
  1. +7 −4 cake/libs/controller/components/auth.php
@@ -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;

0 comments on commit 1c5898d

Please sign in to comment.