mirror of https://github.com/MISP/MISP
Bug fixes in the admin view
- password changing for other users - corrected admin_viewpull/61/head
parent
6c5a5aa427
commit
0374c1c9b6
|
@ -180,14 +180,24 @@ class UsersController extends AppController {
|
|||
throw new NotFoundException(__('Invalid user'));
|
||||
}
|
||||
if ($this->request->is('post') || $this->request->is('put')) {
|
||||
if ($this->User->save($this->request->data)) {
|
||||
$fields = array();
|
||||
foreach (array_keys($this->request->data['User']) as $field) {
|
||||
if($field != 'password') array_push($fields, $field);
|
||||
}
|
||||
if ("" != $this->request->data['User']['password'])
|
||||
$fields[] = 'password';
|
||||
if ($this->User->save($this->request->data, true, $fields)) {
|
||||
$this->Session->setFlash(__('The user has been saved'));
|
||||
$this->redirect(array('action' => 'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The user could not be saved. Please, try again.'));
|
||||
}
|
||||
} else {
|
||||
$this->request->data = $this->User->read(null, $id);
|
||||
$this->User->recursive=0;
|
||||
$this->User->read(null, $id);
|
||||
$this->User->set('password', '');
|
||||
$this->request->data = $this->User->data;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,10 +40,12 @@
|
|||
|
||||
</dd>
|
||||
<dt><?php echo __('Gpgkey'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($user['User']['gpgkey']); ?>
|
||||
|
||||
<dd style="font-size: 10px; line-height:100%;">
|
||||
<code><?php echo nl2br(h($user['User']['gpgkey'])); ?></code>
|
||||
|
||||
</dd>
|
||||
|
||||
<dt><?php echo __('Nids Sid'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($user['User']['nids_sid']); ?>
|
||||
|
@ -109,11 +111,4 @@
|
|||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('User.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('User.id'))); ?></li>
|
||||
<li> </li>
|
||||
<?php echo $this->element('actions_menu'); ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue