mirror of https://github.com/MISP/MISP
new: [user] Allow to disable user login change
parent
8e76af6370
commit
c8fcfaf5e2
|
@ -182,7 +182,10 @@ class UsersController extends AppController
|
|||
}
|
||||
if (!$abortPost) {
|
||||
// What fields should be saved (allowed to be saved)
|
||||
$fieldList = array('email', 'autoalert', 'gpgkey', 'certif_public', 'nids_sid', 'contactalert', 'disabled');
|
||||
$fieldList = array('autoalert', 'gpgkey', 'certif_public', 'nids_sid', 'contactalert', 'disabled');
|
||||
if ($this->__canChangeLogin()) {
|
||||
$fieldList[] = 'email';
|
||||
}
|
||||
if ($this->__canChangePassword() && !empty($this->request->data['User']['password'])) {
|
||||
$fieldList[] = 'password';
|
||||
$fieldList[] = 'confirm_password';
|
||||
|
@ -243,6 +246,7 @@ class UsersController extends AppController
|
|||
$this->set('roles', $roles);
|
||||
$this->set('id', $id);
|
||||
$this->set('canChangePassword', $this->__canChangePassword());
|
||||
$this->set('canChangeLogin', $this->__canChangeLogin());
|
||||
}
|
||||
|
||||
public function change_pw()
|
||||
|
@ -2735,4 +2739,9 @@ class UsersController extends AppController
|
|||
{
|
||||
return $this->ACL->canUserAccess($this->Auth->user(), 'users', 'change_pw');
|
||||
}
|
||||
|
||||
private function __canChangeLogin()
|
||||
{
|
||||
return !Configure::read('MISP.disable_user_login_change');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<fieldset>
|
||||
<legend><?php echo __('Edit My Profile'); ?></legend>
|
||||
<?php
|
||||
echo $this->Form->input('email');
|
||||
echo $this->Form->input('email', ['disabled' => $canChangeLogin ? false : 'disabled']);
|
||||
?>
|
||||
<div class="input clear"></div>
|
||||
<?php
|
||||
|
@ -18,7 +18,7 @@
|
|||
?>
|
||||
<div class="input clear"></div>
|
||||
<?php
|
||||
echo $this->Form->input('nids_sid');
|
||||
echo $this->Form->input('nids_sid', ['label' => __('NIDS SID')]);
|
||||
?>
|
||||
<div class="input clear"></div>
|
||||
<?php
|
||||
|
|
Loading…
Reference in New Issue