From 18411f652acb97a4e6ed45972e4d261c7c7a0aca Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 15 Jun 2015 23:40:11 -0400 Subject: [PATCH] #196 Can now save/update templates --- admin/manage_users.php | 14 ++++++++------ inc/profile_functions.inc.php | 7 ++++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/admin/manage_users.php b/admin/manage_users.php index 7ec815ea..910511cf 100644 --- a/admin/manage_users.php +++ b/admin/manage_users.php @@ -550,7 +550,8 @@ function new_user() `notify_pm`, `notify_note`, `notify_note_unassigned`, - `autorefresh`) VALUES ( + `autorefresh`, + `permission_template`) VALUES ( '".hesk_dbEscape($myuser['user'])."', '".hesk_dbEscape($myuser['pass'])."', '".intval($myuser['isadmin'])."', @@ -575,7 +576,8 @@ function new_user() '".($myuser['notify_pm'])."', '".($myuser['notify_note'])."', '".($myuser['notify_note_unassigned'])."', - ".intval($myuser['autorefresh']).")" ); + ".intval($myuser['autorefresh']).", + ".intval($myuser['template']).")" ); $_SESSION['seluser'] = hesk_dbInsertID(); @@ -691,7 +693,6 @@ function update_user() `active`='".intval($myuser['active'])."', `autoassign`='".intval($myuser['autoassign'])."', `heskprivileges`='".hesk_dbEscape($myuser['features'])."', - `can_manage_settings`='".hesk_dbEscape($myuser['can_manage_settings'])."', `can_change_notification_settings`='".hesk_dbEscape($myuser['can_change_notification_settings'])."', `afterreply`='".($myuser['afterreply'])."' , `autostart`='".($myuser['autostart'])."' , @@ -706,7 +707,8 @@ function update_user() `notify_pm`='".($myuser['notify_pm'])."', `notify_note`='".($myuser['notify_note'])."', `notify_note_unassigned`='".($myuser['notify_note_unassigned'])."', - `autorefresh`=".intval($myuser['autorefresh'])." + `autorefresh`=".intval($myuser['autorefresh']).", + `permission_template`=".intval($myuser['template'])." WHERE `id`='".intval($myuser['id'])."' LIMIT 1"); // If they are now inactive, remove any manager rights @@ -732,8 +734,8 @@ function hesk_validateUserInfo($pass_required = 1, $redirect_to = './manage_user $myuser['name'] = hesk_input( hesk_POST('name') ) or $hesk_error_buffer .= '
  • ' . $hesklang['enter_real_name'] . '
  • '; $myuser['email'] = hesk_validateEmail( hesk_POST('email'), 'ERR', 0) or $hesk_error_buffer .= '
  • ' . $hesklang['enter_valid_email'] . '
  • '; $myuser['user'] = hesk_input( hesk_POST('user') ) or $hesk_error_buffer .= '
  • ' . $hesklang['enter_username'] . '
  • '; - $myuser['isadmin'] = empty($_POST['isadmin']) ? 0 : 1; - $myuser['can_manage_settings'] = isset($_POST['manage_settings']) ? 1 : 0; + $myuser['isadmin'] = hesk_POST('template') == '1' ? 1 : 0; + $myuser['template'] = hesk_POST('template') != 'N' ? hesk_POST('template') : -1; $myuser['signature'] = hesk_input( hesk_POST('signature') ); $myuser['autoassign'] = hesk_POST('autoassign') == 'Y' ? 1 : 0; $myuser['active'] = empty($_POST['active']) ? 0 : 1; diff --git a/inc/profile_functions.inc.php b/inc/profile_functions.inc.php index 4b8eb835..49ac4926 100644 --- a/inc/profile_functions.inc.php +++ b/inc/profile_functions.inc.php @@ -147,7 +147,8 @@ function hesk_profile_tab($session_array='new',$is_profile_page=true,$action='pr echo ''; @@ -157,7 +158,7 @@ function hesk_profile_tab($session_array='new',$is_profile_page=true,$action='pr
    - +
    $catname) @@ -174,7 +175,7 @@ function hesk_profile_tab($session_array='new',$is_profile_page=true,$action='pr
    - +