chg: [appcontroller] include user org in loaded user object during authentication
- also log username as username rather than namepull/79/head
parent
6d7a555368
commit
dad310f434
|
@ -102,7 +102,7 @@ class AppController extends Controller
|
||||||
$this->ACL->setPublicInterfaces();
|
$this->ACL->setPublicInterfaces();
|
||||||
if (!empty($this->request->getAttribute('identity'))) {
|
if (!empty($this->request->getAttribute('identity'))) {
|
||||||
$user = $this->Users->get($this->request->getAttribute('identity')->getIdentifier(), [
|
$user = $this->Users->get($this->request->getAttribute('identity')->getIdentifier(), [
|
||||||
'contain' => ['Roles', 'Individuals' => 'Organisations', 'UserSettings']
|
'contain' => ['Roles', 'Individuals' => 'Organisations', 'UserSettings', 'Organisations']
|
||||||
]);
|
]);
|
||||||
if (!empty($user['disabled'])) {
|
if (!empty($user['disabled'])) {
|
||||||
$this->Authentication->logout();
|
$this->Authentication->logout();
|
||||||
|
@ -158,7 +158,7 @@ class AppController extends Controller
|
||||||
'action' => 'login',
|
'action' => 'login',
|
||||||
'model' => 'Users',
|
'model' => 'Users',
|
||||||
'model_id' => $user['id'],
|
'model_id' => $user['id'],
|
||||||
'model_title' => $user['name'],
|
'model_title' => $user['username'],
|
||||||
'change' => []
|
'change' => []
|
||||||
]);
|
]);
|
||||||
if (!empty($user)) {
|
if (!empty($user)) {
|
||||||
|
|
Loading…
Reference in New Issue