mirror of https://github.com/MISP/MISP
fix: [user] Include user settings in /users/view
parent
907daf8723
commit
6d8b76ae4f
|
@ -609,7 +609,19 @@ class User extends AppModel
|
|||
throw new NotFoundException('Invalid user ID.');
|
||||
}
|
||||
$conditions = array('User.id' => $id);
|
||||
$user = $this->find('first', array('conditions' => $conditions, 'recursive' => -1,'contain' => array('Organisation', 'Role', 'Server')));
|
||||
$user = $this->find(
|
||||
'first',
|
||||
array(
|
||||
'conditions' => $conditions,
|
||||
'recursive' => -1,
|
||||
'contain' => array(
|
||||
'Organisation',
|
||||
'Role',
|
||||
'Server',
|
||||
'UserSetting'
|
||||
)
|
||||
)
|
||||
);
|
||||
if (empty($user)) {
|
||||
return $user;
|
||||
}
|
||||
|
@ -617,6 +629,7 @@ class User extends AppModel
|
|||
$user['User']['Role'] = $user['Role'];
|
||||
$user['User']['Organisation'] = $user['Organisation'];
|
||||
$user['User']['Server'] = $user['Server'];
|
||||
$user['User']['UserSetting'] = $user['UserSetting'];
|
||||
unset($user['Organisation'], $user['Role'], $user['Server']);
|
||||
return $user['User'];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue