From c3d8aa39bd6e15acd514345dd9d1087ca90465cb Mon Sep 17 00:00:00 2001 From: miguel angel rasteu Date: Thu, 11 May 2023 14:48:06 +0200 Subject: [PATCH] #11161 Fix conditional to evaluate user_admin. Fix style CSS. Fix process_user_log --- .../godmode/users/configure_user.php | 3 +- .../godmode/users/user_management.php | 54 +++++++++++++------ pandora_console/include/styles/pandora.css | 4 +- 3 files changed, 41 insertions(+), 20 deletions(-) diff --git a/pandora_console/godmode/users/configure_user.php b/pandora_console/godmode/users/configure_user.php index 2f01df4a55..22e573dec5 100644 --- a/pandora_console/godmode/users/configure_user.php +++ b/pandora_console/godmode/users/configure_user.php @@ -715,11 +715,12 @@ if ($update_user) { $password_new = (string) get_parameter('password_new', ''); $password_confirm = (string) get_parameter('password_confirm', ''); $own_password_confirm = (string) get_parameter('own_password_confirm', ''); + $id_user = (string) get_parameter('id_user', ''); if ($password_new != '') { $correct_password = false; - $user_credentials_check = process_user_login($config['id_user'], $own_password_confirm, true); + $user_credentials_check = process_user_login($id_user, $own_password_confirm, true); if ($user_credentials_check !== false) { $correct_password = true; diff --git a/pandora_console/godmode/users/user_management.php b/pandora_console/godmode/users/user_management.php index 45c54306ce..0add5b02d5 100644 --- a/pandora_console/godmode/users/user_management.php +++ b/pandora_console/godmode/users/user_management.php @@ -302,25 +302,45 @@ $passwordManageTable->data['fields_repeatpassword'][0] = html_print_input_text_e true ); -if ($new_user === false) { +if ($new_user === false && users_is_admin() === false) { $passwordManageTable->data['captions_currentpassword'][0] = __('Current password'); $passwordManageTable->rowclass['fields_currentpassword'] = 'w540px'; - $passwordManageTable->data['fields_currentpassword'][0] = html_print_input_text_extended( - 'own_password_confirm', - '', - 'own_password_confirm', - '', - '20', - '45', - $view_mode, - '', - [ - 'class' => 'input w100p', - 'placeholder' => __('Own password confirmation'), - ], - true, - true - ); + + if ($user_info['id_user'] === $config['id_user']) { + $passwordManageTable->data['fields_currentpassword'][0] = html_print_input_text_extended( + 'own_password_confirm', + '', + 'own_password_confirm', + '', + '20', + '45', + $view_mode, + '', + [ + 'class' => 'input w100p', + 'placeholder' => __('Own password confirmation'), + ], + true, + true + ); + } else { + $passwordManageTable->data['fields_currentpassword'][0] = html_print_input_text_extended( + 'own_password_confirm', + '', + 'own_password_confirm', + '', + '20', + '45', + $view_mode, + '', + [ + 'class' => 'input w100p', + 'placeholder' => __('Third user password confirmation'), + ], + true, + true + ); + } } $userManagementTable->data['passwordManage_table'] = html_print_table($passwordManageTable, true); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index adf1325b07..c3fda4108d 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -11597,8 +11597,8 @@ p.trademark-copyright { } .show-hide-pass { - position: absolute; - right: 12px; + position: relative; + right: 40px; top: 4px; border: 0; outline: none;