mirror of https://github.com/MISP/MISP
chg: [user:registration] Added audit log
parent
46a940acb8
commit
6bff239740
|
@ -2395,6 +2395,17 @@ class UsersController extends AppController
|
|||
if ($this->_isRest()) {
|
||||
return $this->RestResponse->saveSuccessResponse('User', 'discardRegistrations', false, $this->response->type(), $message);
|
||||
} else {
|
||||
$this->Log = ClassRegistry::init('Log');
|
||||
$this->Log->create();
|
||||
$this->Log->save(array(
|
||||
'org' => $this->Auth->user('Organisation')['name'],
|
||||
'model' => 'User',
|
||||
'model_id' => $id,
|
||||
'email' => $this->Auth->user('email'),
|
||||
'action' => 'discardRegistrations',
|
||||
'title' => $message,
|
||||
'change' => ''
|
||||
));
|
||||
$this->Flash->success($message);
|
||||
$this->redirect(array('controller' => 'users', 'action' => 'registrations'));
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ class Log extends AppModel
|
|||
'reset_auth_key',
|
||||
'security',
|
||||
'serverSettingsEdit',
|
||||
'succeeded_registration',
|
||||
'tag',
|
||||
'undelete',
|
||||
'update',
|
||||
|
|
|
@ -1550,6 +1550,15 @@ class User extends AppModel
|
|||
'recursive' => -1,
|
||||
'conditions' => array('id' => $this->id)
|
||||
));
|
||||
$this->Log->save(array(
|
||||
'org' => 'SYSTEM',
|
||||
'model' => 'User',
|
||||
'model_id' => $added_by['id'],
|
||||
'email' => $added_by['email'],
|
||||
'action' => 'succeeded_registration',
|
||||
'title' => sprintf('User registration success for %s (id=%s)', $user['User']['email'], $user['User']['id']),
|
||||
'change' => null,
|
||||
));
|
||||
$this->initiatePasswordReset($user, true, true, false);
|
||||
$this->Inbox = ClassRegistry::init('Inbox');
|
||||
$this->Inbox->delete($registration['id']);
|
||||
|
|
Loading…
Reference in New Issue