Added User Group setting for allowable reports to restrict report viewing
Enabled User Group setting for allowable campaigns to restrict report viewing and admin.php activity Changed level 7 users to only view reports links page Changed "Admin" link to go to an admin links page instead of Phones listing Added manual_dial_filter CAMPLISTS_ALL options git-svn-id: svn://192.168.202.10@1491 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -66,7 +67,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||
}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -80,6 +81,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
exit;
|
||||
}
|
||||
|
||||
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGuser_group = $row[0];
|
||||
|
||||
$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGallowed_campaigns = $row[0];
|
||||
$LOGallowed_reports = $row[1];
|
||||
|
||||
if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
# path from root to where ploticus files will be stored
|
||||
$PLOTroot = "vicidial/ploticus";
|
||||
$DOCroot = "$WeBServeRRooT/$PLOTroot/";
|
||||
|
||||
Reference in New Issue
Block a user