From 915c9406812328cf4f151c3abbaab077cbc7534c Mon Sep 17 00:00:00 2001 From: mattf Date: Tue, 25 Jan 2022 03:52:44 +0000 Subject: [PATCH] Changed to allow user_level 7 users with the proper permissions to use the reset_agent_pass.php page git-svn-id: svn://192.168.202.10@3557 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/www/vicidial/reset_agent_pass.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/agc_2-X/trunk/www/vicidial/reset_agent_pass.php b/agc_2-X/trunk/www/vicidial/reset_agent_pass.php index 934c8580..9ecb6f0d 100644 --- a/agc_2-X/trunk/www/vicidial/reset_agent_pass.php +++ b/agc_2-X/trunk/www/vicidial/reset_agent_pass.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2022 Matt Florell LICENSE: AGPLv2 # # NOTE: It is required that you add a Settings Container with the ID of 'AGENT_RESET_OPTIONS' for this utility to work # @@ -11,6 +11,7 @@ # # CHANGES # 201020-2305 - First build +# 220124-2250 - Changed to allow user_level 7 users with the proper permissions to use this page # $startMS = microtime(); @@ -90,19 +91,19 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} if ($auth > 0) { - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 7 and view_reports='1';"; + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level >= 7 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $admin_auth=$row[0]; - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 7 and modify_users='1';"; + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level >= 7 and modify_users='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); @@ -158,6 +159,13 @@ if ($LOGmodify_users < 1) exit; } +$stmt="SELECT reports_header_override,admin_home_url from vicidial_user_groups where user_group='$LOGuser_group';"; +$rslt=mysql_to_mysqli($stmt, $link); +$row=mysqli_fetch_row($rslt); +$LOGreports_header_override = $row[0]; +$LOGadmin_home_url = $row[1]; +if (strlen($LOGadmin_home_url) > 5) {$SSadmin_home_url = $LOGadmin_home_url;} + ##### BEGIN log visit to the vicidial_report_log table ##### $LOGip = getenv("REMOTE_ADDR");