From 9e116d117268a2f6bd32538bc3d603a7b435eb13 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 23 Feb 2015 22:19:50 -0500 Subject: [PATCH] Closes #138 Fix notification settings when saving --- admin/manage_users.php | 20 +++++++++++++++++--- inc/profile_functions.inc.php | 5 ++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/admin/manage_users.php b/admin/manage_users.php index 85a13316..77a26217 100644 --- a/admin/manage_users.php +++ b/admin/manage_users.php @@ -835,11 +835,25 @@ function hesk_validateUserInfo($pass_required = 1, $redirect_to = './manage_user /* Any errors */ if (strlen($hesk_error_buffer)) { - $hesk_error_buffer = $hesklang['rfm'].'

'; - hesk_process_messages($hesk_error_buffer,$redirect_to); + if ($myuser['isadmin']) + { + // Preserve default staff data for the form + global $default_userdata; + $_SESSION['userdata']['features'] = $default_userdata['features']; + $_SESSION['userdata']['categories'] = $default_userdata['categories']; + } + + $hesk_error_buffer = $hesklang['rfm'].'

'; + hesk_process_messages($hesk_error_buffer,$redirect_to); + } + + // "can_unban_emails" feature also enables "can_ban_emails" + if ( in_array('can_unban_emails', $myuser['features']) && ! in_array('can_ban_emails', $myuser['features']) ) + { + $myuser['features'][] = 'can_ban_emails'; } - return $myuser; + return $myuser; } // End hesk_validateUserInfo() diff --git a/inc/profile_functions.inc.php b/inc/profile_functions.inc.php index 72112266..25f9089b 100644 --- a/inc/profile_functions.inc.php +++ b/inc/profile_functions.inc.php @@ -349,7 +349,9 @@ function hesk_profile_tab($session_array='new',$is_profile_page=true,$action='pr - + + + @@ -363,6 +365,7 @@ function hesk_profile_tab($session_array='new',$is_profile_page=true,$action='pr +