Changed error and success messages - #2900
This commit is contained in:
parent
f3c8b14b32
commit
561bce71ce
|
@ -131,36 +131,58 @@ if (isset ($_GET["modified"]) && !$view_mode) {
|
||||||
if ($return) {
|
if ($return) {
|
||||||
$return2 = save_pass_history($id, $password_new);
|
$return2 = save_pass_history($id, $password_new);
|
||||||
}
|
}
|
||||||
ui_print_result_message ($return,
|
/*ui_print_result_message ($return,
|
||||||
__('Password successfully updated'),
|
__('Password successfully updated'),
|
||||||
__('Error updating passwords: %s', $config['auth_error']));
|
__('Error updating passwords: %s', $config['auth_error']));*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$return = update_user_password ($id, $password_new);
|
$return = update_user_password ($id, $password_new);
|
||||||
ui_print_result_message ($return,
|
/*ui_print_result_message ($return,
|
||||||
__('Password successfully updated'),
|
__('Password successfully updated'),
|
||||||
__('Error updating passwords: %s', $config['auth_error']));
|
__('Error updating passwords: %s', $config['auth_error']));*/
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif ($password_new !== "NON-INIT") {
|
elseif ($password_new !== "NON-INIT") {
|
||||||
ui_print_error_message (__('Passwords didn\'t match or other problem encountered while updating passwords'));
|
// ui_print_error_message (__('Passwords didn\'t match or other problem encountered while updating passwords'));
|
||||||
|
$error_msg='Passwords didn\'t match or other problem encountered while updating passwords';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
elseif(empty($password_new) && empty($password_confirm)){
|
||||||
|
$return=true;
|
||||||
|
}
|
||||||
|
elseif(empty($password_new) || empty($password_confirm)){
|
||||||
|
$return=false;
|
||||||
|
}
|
||||||
|
|
||||||
// No need to display "error" here, because when no update is needed (no changes in data)
|
// No need to display "error" here, because when no update is needed (no changes in data)
|
||||||
// SQL function returns 0 (FALSE), but is not an error, just no change. Previous error
|
// SQL function returns 0 (FALSE), but is not an error, just no change. Previous error
|
||||||
// message could be confussing to the user.
|
// message could be confussing to the user.
|
||||||
|
|
||||||
$return = update_user ($id, $upd_info);
|
if($return){
|
||||||
if ($return > 0) {
|
$success_msg = 'Password successfully updated';
|
||||||
ui_print_result_message ($return,
|
|
||||||
__('User info successfully updated'),
|
$return_update_user = update_user ($id, $upd_info);
|
||||||
__('Error updating user info'));
|
|
||||||
|
if ($return_update_user === false) {
|
||||||
|
$error_msg='Error updating user info';
|
||||||
|
}
|
||||||
|
elseif($return_update_user == true){
|
||||||
|
$success_msg = 'User info successfully updated';
|
||||||
|
}
|
||||||
|
|
||||||
|
$user_info = $upd_info;
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
$user_info = $upd_info;
|
if(!$error_msg){
|
||||||
|
$error_msg='Error updating passwords: ';
|
||||||
|
}
|
||||||
|
|
||||||
|
$user_auth_error= $config['auth_error'];
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_print_result_message ($return, $success_msg, $error_msg,$user_auth_error);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prints action status for current message
|
// Prints action status for current message
|
||||||
|
|
Loading…
Reference in New Issue