chg: [appcontroller] include user org in loaded user object during authentication

- also log username as username rather than name
pull/79/head
iglocska 2021-11-24 01:28:52 +01:00
parent 6d7a555368
commit dad310f434
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 2 additions and 2 deletions

View File

@ -102,7 +102,7 @@ class AppController extends Controller
$this->ACL->setPublicInterfaces();
if (!empty($this->request->getAttribute('identity'))) {
$user = $this->Users->get($this->request->getAttribute('identity')->getIdentifier(), [
'contain' => ['Roles', 'Individuals' => 'Organisations', 'UserSettings']
'contain' => ['Roles', 'Individuals' => 'Organisations', 'UserSettings', 'Organisations']
]);
if (!empty($user['disabled'])) {
$this->Authentication->logout();
@ -158,7 +158,7 @@ class AppController extends Controller
'action' => 'login',
'model' => 'Users',
'model_id' => $user['id'],
'model_title' => $user['name'],
'model_title' => $user['username'],
'change' => []
]);
if (!empty($user)) {