mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Auth enhancement, less calls to user()
This commit is contained in:
parent
87c659d653
commit
c902d4c060
1 changed files with 3 additions and 2 deletions
|
@ -382,7 +382,8 @@ class AuthComponent extends Object {
|
|||
$controller->data[$model->alias][$this->fields['password']] = null;
|
||||
return false;
|
||||
} else {
|
||||
if (!$this->user()) {
|
||||
$user = $this->user();
|
||||
if (!$user) {
|
||||
if (!$this->RequestHandler->isAjax()) {
|
||||
$this->Session->setFlash($this->authError, $this->flashElement, array(), 'auth');
|
||||
if (!empty($controller->params['url']) && count($controller->params['url']) >= 2) {
|
||||
|
@ -442,7 +443,7 @@ class AuthComponent extends Object {
|
|||
break;
|
||||
}
|
||||
|
||||
if ($this->isAuthorized($type)) {
|
||||
if ($this->isAuthorized($type, null, $user)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue