mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-03-18 15:39:53 +00:00
Don't get User model if not needed. Fixes #563
Signed-off-by: Mark Story <mark@mark-story.com>
This commit is contained in:
parent
ceb2a1d4ed
commit
1c5898d94b
1 changed files with 7 additions and 4 deletions
|
@ -922,12 +922,15 @@ class AuthComponent extends Object {
|
||||||
return $this->authenticate->hashPasswords($data);
|
return $this->authenticate->hashPasswords($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_array($data)) {
|
||||||
$model =& $this->getModel();
|
$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']])) {
|
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']]);
|
$data[$model->alias][$this->fields['password']] = $this->password($data[$model->alias][$this->fields['password']]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue