From 7e67dafe4689ec0fb233763f32d0e2b5589b3e5f Mon Sep 17 00:00:00 2001 From: Jakub Onderka Date: Sat, 31 Oct 2020 21:31:11 +0100 Subject: [PATCH] chg: [UI] Simplified user edit forms and interface --- app/View/Users/admin_add.ctp | 19 ++++++------------- app/View/Users/admin_edit.ctp | 28 +++++++++++----------------- app/View/Users/change_pw.ctp | 12 +----------- app/View/Users/edit.ctp | 22 +++++++--------------- app/webroot/js/misp.js | 8 ++++++++ 5 files changed, 33 insertions(+), 56 deletions(-) diff --git a/app/View/Users/admin_add.ctp b/app/View/Users/admin_add.ctp index c2e8cc326..135745275 100644 --- a/app/View/Users/admin_add.ctp +++ b/app/View/Users/admin_add.ctp @@ -37,7 +37,7 @@ $passwordPopover = '' . __('Minimal length') . ': ' . h($length) . '
'; $passwordPopover .= '' . __('Complexity') . ': ' . h($complexity); echo $this->Form->input('password', array( - 'label' => __('Password') . ' ' + 'label' => __('Password') . ' ' )); echo $this->Form->input('confirm_password', array('type' => 'password', 'div' => array('class' => 'input password required'))); ?> @@ -59,9 +59,9 @@ } echo $this->Form->input('role_id', $roleOptions); echo $this->Form->input('authkey', array('value' => $authkey, 'readonly' => 'readonly', 'div' => 'input clear')); - echo $this->Form->input('nids_sid'); + echo $this->Form->input('nids_sid', ['label' => __('NIDS SID')]); ?> - - element('/genericElements/SideMenu/side_menu', array('menuList' => 'globalActions', 'menuItem' => 'change_pw')); ?> diff --git a/app/View/Users/edit.ctp b/app/View/Users/edit.ctp index 931acbbd9..77d25f1c1 100755 --- a/app/View/Users/edit.ctp +++ b/app/View/Users/edit.ctp @@ -11,7 +11,7 @@ $passwordPopover = '' . __('Minimal length') . ': ' . h($length) . '
'; $passwordPopover .= '' . __('Complexity') . ': ' . h($complexity); echo $this->Form->input('password', array( - 'label' => __('Password') . ' ' + 'label' => __('Password') . ' ' )); echo $this->Form->input('confirm_password', array('type' => 'password', 'div' => array('class' => 'input password required'))); } @@ -26,9 +26,13 @@ ?>
Form->input('certif_public', array('label' => __('S/MIME Public certificate (PEM format)'), 'div' => 'clear', 'class' => 'input-xxlarge')); + if (Configure::read('SMIME.enabled')) { + echo $this->Form->input('certif_public', array('label' => __('S/MIME Public certificate (PEM format)'), 'div' => 'clear', 'class' => 'input-xxlarge')); + } + echo '
'; echo $this->Form->input('autoalert', array('label' => __('Receive alerts when events are published'), 'type' => 'checkbox')); echo $this->Form->input('contactalert', array('label' => __('Receive alerts from "contact reporter" requests'), 'type' => 'checkbox')); + echo '
'; ?>
 
@@ -40,7 +44,7 @@ ?> Form->button(__('Submit'), array('class' => 'btn btn-primary')); + echo $this->Form->button(__('Edit'), array('class' => 'btn btn-primary')); echo $this->Form->end(); ?> @@ -48,16 +52,4 @@ $user['User']['id'] = $id; echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'globalActions', 'menuItem' => 'edit', 'user' => $user)); ?> - - - Js->writeBuffer(); diff --git a/app/webroot/js/misp.js b/app/webroot/js/misp.js index f35f91dca..25d96e419 100644 --- a/app/webroot/js/misp.js +++ b/app/webroot/js/misp.js @@ -4684,6 +4684,14 @@ $(document).ready(function() { return $(this).data('disabled-reason'); } }); + $('#PasswordPopover').popover("destroy").popover({ + placement: 'right', + html: 'true', + trigger: 'hover', + content: function () { + return $(this).data('content'); + } + }); $(".queryPopover").click(function() { url = $(this).data('url'); id = $(this).data('id');