From cdfc12008cc6acd6e3a2658d0382c49a7ae40ebf Mon Sep 17 00:00:00 2001 From: iglocska Date: Thu, 2 May 2024 13:47:40 +0200 Subject: [PATCH] fix: [external auth] fixed auth logging generating notices, fixes #9445 --- app/Controller/AppController.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/Controller/AppController.php b/app/Controller/AppController.php index 07930b66c..187ef30b6 100755 --- a/app/Controller/AppController.php +++ b/app/Controller/AppController.php @@ -1204,12 +1204,11 @@ class AppController extends Controller null); $this->__preAuthException($authName . ' authentication failed. Contact your MISP support for additional information at: ' . Configure::read('MISP.contact')); } - $temp = $this->_checkExternalAuthUser($server[$headerNamespace . $header]); - $user['User'] = $temp; - if ($user['User']) { - $this->User->updateLoginTimes($user['User']); + $user = $this->_checkExternalAuthUser($server[$headerNamespace . $header]); + if ($user) { + $this->User->updateLoginTimes($user); //$this->Session->renew(); - $this->Session->write(AuthComponent::$sessionKey, $user['User']); + $this->Session->write(AuthComponent::$sessionKey, $user); if (Configure::read('MISP.log_auth')) { $this->Log = ClassRegistry::init('Log'); $change = $this->User->UserLoginProfile->_getUserProfile(); @@ -1219,7 +1218,7 @@ class AppController extends Controller $user, 'auth', 'User', - $user['User']['id'], + $user['id'], 'Successful authentication using ' . $authName . ' key', json_encode($change)); }