mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +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,10 +922,13 @@ class AuthComponent extends Object {
|
|||
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;
|
||||
|
|
Loading…
Add table
Reference in a new issue