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:
@@ -233,6 +233,14 @@ OTHER CHANGES:
|
||||
allow you to hangup or transfer the call at a set number of seconds
|
||||
from start time or triggered from an outside process.
|
||||
|
||||
51. Added Allowable Reports option in User Groups for user_level 7 and higher
|
||||
users to restrict viewable reports. Also enforced the Allowed
|
||||
Campaigns option in User Group across admin.php and reports
|
||||
|
||||
52. Changed the "Admin" link in admin.php to go to a links page instead of a
|
||||
listing of Phones, also forced level 7 users to the reports links page
|
||||
if they try going anywhere in admin.php
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -597,7 +597,8 @@ agent_xfer_vm_transfer ENUM('Y','N') default 'Y',
|
||||
agent_xfer_blind_transfer ENUM('Y','N') default 'Y',
|
||||
agent_xfer_dial_with_customer ENUM('Y','N') default 'Y',
|
||||
agent_xfer_park_customer_dial ENUM('Y','N') default 'Y',
|
||||
agent_fullscreen ENUM('Y','N') default 'N'
|
||||
agent_fullscreen ENUM('Y','N') default 'N',
|
||||
allowed_reports VARCHAR(2000) default 'ALL REPORTS'
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_campaigns (
|
||||
@@ -2295,7 +2296,7 @@ ALTER TABLE vicidial_agent_log_archive MODIFY agent_log_id INT(9) UNSIGNED NOT N
|
||||
|
||||
CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1237',db_schema_update_date=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1238',db_schema_update_date=NOW();
|
||||
|
||||
GRANT RELOAD ON *.* TO cron@'%';
|
||||
GRANT RELOAD ON *.* TO cron@localhost;
|
||||
|
||||
@@ -447,3 +447,7 @@ ALTER TABLE vicidial_inbound_groups ADD timer_action_destination VARCHAR(30) def
|
||||
ALTER TABLE vicidial_live_agents ADD external_timer_action_destination VARCHAR(100) default '';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1237',db_schema_update_date=NOW();
|
||||
|
||||
ALTER TABLE vicidial_user_groups ADD allowed_reports VARCHAR(2000) default 'ALL REPORTS';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1238',db_schema_update_date=NOW();
|
||||
|
||||
@@ -292,6 +292,10 @@ Timer Action Destination||
|
||||
This field is where you specify the Call Menu, Extension or In-Group that you want the cacll sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty||
|
||||
You must enter field options when adding a||
|
||||
You must enter field options when updating a||
|
||||
Allowed Reports||
|
||||
If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports||
|
||||
You are not allowed to view this report||
|
||||
CAMPLISTS_ALL - will include inactive lists in the search for the number||
|
||||
|
||||
|
||||
AST_VICIDIAL_ingrouplist.php
|
||||
|
||||
@@ -250,10 +250,11 @@
|
||||
# 100624-1401 - Fix for dispo call url bug related to dialed number and label
|
||||
# 100625-0915 - Fix for auto-dial bug for presets and timer actions
|
||||
# 100712-1447 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any
|
||||
# 100803-0822 - Added CAMPLISTS_ALL for manual_dial_filter(issue #369
|
||||
#
|
||||
|
||||
$version = '2.4-157';
|
||||
$build = '100712-1447';
|
||||
$version = '2.4-158';
|
||||
$build = '100803-0822';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=333;
|
||||
$one_mysql_log=0;
|
||||
@@ -1163,7 +1164,16 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";}
|
||||
if (ereg("N", $rowx[1])) {$inactive_lists++;}
|
||||
if (ereg("ALL",$manual_dial_filter))
|
||||
{
|
||||
if (ereg("N", $rowx[1]))
|
||||
{$inactive_lists++; $camp_lists .= "'$rowx[0]',";}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ereg("N", $rowx[1]))
|
||||
{$inactive_lists++;}
|
||||
}
|
||||
$o++;
|
||||
}
|
||||
$camp_lists = eregi_replace(".$","",$camp_lists);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -69,14 +70,13 @@ 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 >= 7 and view_reports='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
@@ -85,6 +85,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;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100709-1809 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -99,14 +100,13 @@ if ($gmt_conf_ct > 0)
|
||||
$epoch_offset = (($local_gmt + $dst) * 3600);
|
||||
}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
@@ -115,6 +115,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;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -94,7 +95,7 @@ if ($gmt_conf_ct > 0)
|
||||
$epoch_offset = (($local_gmt + $dst) * 3600);
|
||||
}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -109,6 +110,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;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -67,7 +68,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 >= 7 and view_reports='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -83,6 +84,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;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100301-1401 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -70,7 +71,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 >= 7 and view_reports='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -86,6 +87,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;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
# 90627-2055 - First build
|
||||
# 90907-0636 - Added list id to results
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -61,15 +62,14 @@ 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 >= 7 and view_reports='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
@@ -77,6 +77,27 @@ $auth=$row[0];
|
||||
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;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -117,28 +118,31 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ($user_level < 9)
|
||||
$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$user_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$records_to_print = mysql_num_rows($rslt);
|
||||
if ($records_to_print > 0)
|
||||
{
|
||||
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$user_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$records_to_print = mysql_num_rows($rslt);
|
||||
if ($records_to_print > 0)
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGallowed_reports = $row[1];
|
||||
if ( (!eregi("ALL-CAMPAIGNS",$row[0])) )
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ( (!eregi("ALL-CAMPAIGNS",$row[0])) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]);
|
||||
$rawLOGallowed_campaignsSQL = eregi_replace(' ',"','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
$rawLOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]);
|
||||
$rawLOGallowed_campaignsSQL = eregi_replace(' ',"','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
else
|
||||
if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{
|
||||
echo "Campaigns Permissions Error: |$PHP_AUTH_USER|$user_group|\n";
|
||||
echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Campaigns Permissions Error: |$PHP_AUTH_USER|$user_group|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
@@ -179,10 +183,6 @@ $group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
|
||||
$stmt="select campaign_name from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaign_names_to_print = mysql_num_rows($rslt);
|
||||
@@ -190,6 +190,9 @@ while($i < $group_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$group_cname[$i] = $row[0];
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
}
|
||||
|
||||
if (eregi("YES",$include_rollover))
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -114,7 +115,7 @@ if ($srv_conf_ct > 0)
|
||||
$carrier_logging_active = $row[0];
|
||||
}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -129,6 +130,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;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
@@ -145,7 +167,18 @@ while($i < $group_ct)
|
||||
$i++;
|
||||
}
|
||||
|
||||
$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;";
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
||||
|
||||
$stmt="select campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
@@ -155,7 +188,7 @@ while ($i < $campaigns_to_print)
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] = $row[0];
|
||||
$group_names[$i] = $row[1];
|
||||
if (ereg("--ALL",$group_string) )
|
||||
if (ereg("-ALL",$group_string) )
|
||||
{$group[$i] = $groups[$i];}
|
||||
$i++;
|
||||
}
|
||||
@@ -166,13 +199,16 @@ $group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
}
|
||||
|
||||
if (eregi("YES",$include_rollover))
|
||||
{
|
||||
$stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';";
|
||||
$stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$in_groups_to_print = mysql_num_rows($rslt);
|
||||
@@ -189,9 +225,9 @@ while($i < $group_ct)
|
||||
}
|
||||
if (strlen($group_drop_SQL) < 2)
|
||||
{$group_drop_SQL = "''";}
|
||||
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
|
||||
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) or (strlen($group_string) < 2) )
|
||||
{
|
||||
$group_SQL = "";
|
||||
$group_SQL = "$LOGallowed_campaignsSQL";
|
||||
$group_drop_SQL = "";
|
||||
}
|
||||
else
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
|
||||
#
|
||||
|
||||
|
||||
@@ -75,7 +76,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='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";}
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -90,6 +91,38 @@ 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;
|
||||
}
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
||||
|
||||
$MT[0]='';
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
@@ -98,7 +131,16 @@ if (!isset($group)) {$group = '';}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns;";
|
||||
$i=0;
|
||||
$group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$i++;
|
||||
}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
@@ -107,6 +149,8 @@ while ($i < $campaigns_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
if (ereg("-ALL",$group_string) )
|
||||
{$group[$i] = $groups[$i];}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -115,9 +159,12 @@ $group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -88,7 +89,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='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";}
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -103,6 +104,38 @@ 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;
|
||||
}
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
||||
|
||||
$MT[0]='';
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
@@ -111,7 +144,17 @@ if (!isset($group)) {$group = '';}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns order by campaign_id;";
|
||||
|
||||
$i=0;
|
||||
$group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$i++;
|
||||
}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
@@ -120,6 +163,8 @@ while ($i < $campaigns_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
if (ereg("-ALL",$group_string) )
|
||||
{$group[$i] = $groups[$i];}
|
||||
$i++;
|
||||
}
|
||||
$stmt="select user_group from vicidial_user_groups order by user_group;";
|
||||
@@ -139,9 +184,12 @@ $group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
|
||||
#
|
||||
|
||||
|
||||
@@ -76,7 +77,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='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";}
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -91,6 +92,39 @@ 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;
|
||||
}
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
||||
|
||||
|
||||
$MT[0]='';
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
@@ -99,7 +133,17 @@ if (!isset($group)) {$group = '';}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns order by campaign_id;";
|
||||
|
||||
$i=0;
|
||||
$group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$i++;
|
||||
}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
@@ -108,6 +152,8 @@ while ($i < $campaigns_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
if (ereg("-ALL",$group_string) )
|
||||
{$group[$i] = $groups[$i];}
|
||||
$i++;
|
||||
}
|
||||
$stmt="select user_group from vicidial_user_groups order by user_group;";
|
||||
@@ -127,9 +173,12 @@ $group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -77,7 +78,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='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";}
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -92,6 +93,38 @@ 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;
|
||||
}
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
||||
|
||||
$MT[0]='';
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
@@ -100,7 +133,18 @@ if (!isset($group)) {$group = '';}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns order by campaign_id;";
|
||||
|
||||
|
||||
$i=0;
|
||||
$group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$i++;
|
||||
}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
@@ -109,8 +153,32 @@ while ($i < $campaigns_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$groups[$i] =$row[0];
|
||||
if (ereg("-ALL",$group_string) )
|
||||
{$group[$i] = $groups[$i];}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$i=0;
|
||||
$group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
|
||||
{$group_SQL = "";}
|
||||
else
|
||||
{
|
||||
$group_SQL = eregi_replace(",$",'',$group_SQL);
|
||||
$group_SQL = "and campaign_id IN($group_SQL)";
|
||||
}
|
||||
|
||||
$stmt="select user_group from vicidial_user_groups order by user_group;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -123,24 +191,6 @@ while ($i < $user_groups_to_print)
|
||||
$i++;
|
||||
}
|
||||
|
||||
$i=0;
|
||||
$group_string='|';
|
||||
$group_ct = count($group);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$group[$i]|";
|
||||
$group_SQL .= "'$group[$i]',";
|
||||
$groupQS .= "&group[]=$group[$i]";
|
||||
$i++;
|
||||
}
|
||||
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
|
||||
{$group_SQL = "";}
|
||||
else
|
||||
{
|
||||
$group_SQL = eregi_replace(",$",'',$group_SQL);
|
||||
$group_SQL = "and campaign_id IN($group_SQL)";
|
||||
}
|
||||
|
||||
$i=0;
|
||||
$user_group_string='|';
|
||||
$user_group_ct = count($user_group);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -66,7 +67,7 @@ $user=$agent;
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='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";}
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -81,6 +82,27 @@ $auth=$row[0];
|
||||
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;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
# 90602-2244 - First build
|
||||
# 100301-1401 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option and added user stats link dates
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
|
||||
@@ -74,7 +75,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='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";}
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -89,6 +90,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;
|
||||
}
|
||||
|
||||
$MT[0]='';
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
|
||||
@@ -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/";
|
||||
|
||||
@@ -63,10 +63,11 @@
|
||||
# 100303-0930 - Added carrier stats display option
|
||||
# 100424-0943 - Added realtime_block_user_info option
|
||||
# 100709-1054 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
|
||||
#
|
||||
|
||||
$version = '2.4-54';
|
||||
$build = '100709-1054';
|
||||
$version = '2.4-55';
|
||||
$build = '100802-2347';
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
@@ -160,7 +161,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if (!isset($RR)) {$RR=40;}
|
||||
if (!isset($group)) {$group='';}
|
||||
if (!isset($group)) {$group='ALL-ACTIVE';}
|
||||
if (!isset($usergroup)) {$usergroup='';}
|
||||
if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes
|
||||
if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name
|
||||
@@ -258,7 +259,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
@@ -275,14 +276,40 @@ if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) )
|
||||
$monitor_phone = $row[0];
|
||||
}
|
||||
|
||||
$stmt="SELECT realtime_block_user_info from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
|
||||
$stmt="SELECT realtime_block_user_info,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";}
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$realtime_block_user_info=$row[0];
|
||||
$realtime_block_user_info = $row[0];
|
||||
$LOGuser_group = $row[1];
|
||||
|
||||
$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;";
|
||||
$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;
|
||||
}
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!preg_match("/-ALL/",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
||||
|
||||
$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$groups_to_print = mysql_num_rows($rslt);
|
||||
@@ -303,18 +330,22 @@ $group_string='|';
|
||||
$group_ct = count($groups);
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$group_string .= "$groups[$i]|";
|
||||
$group_SQL .= "'$groups[$i]',";
|
||||
$groupQS .= "&groups[]=$groups[$i]";
|
||||
if ( (preg_match("/ $groups[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$group_string .= "$groups[$i]|";
|
||||
$group_SQL .= "'$groups[$i]',";
|
||||
$groupQS .= "&groups[]=$groups[$i]";
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
$group_SQL = eregi_replace(",$",'',$group_SQL);
|
||||
|
||||
### if no campaigns selected, display all
|
||||
if ($group_ct < 1)
|
||||
if ( ($group_ct < 1) or (strlen($group_string) < 2) )
|
||||
{
|
||||
$groups[0] = 'ALL-ACTIVE';
|
||||
$group_string = 'ALL-ACTIVE';
|
||||
$group_string = '|ALL-ACTIVE|';
|
||||
$group = 'ALL-ACTIVE';
|
||||
$groupQS .= "&groups[]=ALL-ACTIVE";
|
||||
}
|
||||
@@ -329,9 +360,9 @@ if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) )
|
||||
elseif ( eregi('ALL-ACTIVE',$group_string) )
|
||||
{
|
||||
$all_active = 1;
|
||||
$group_SQL = "''";
|
||||
$group_SQLand = "";
|
||||
$group_SQLwhere = "";
|
||||
$group_SQL = "'$rawLOGallowed_campaignsSQL'";
|
||||
$group_SQLand = "$LOGallowed_campaignsSQL";
|
||||
$group_SQLwhere = "$whereLOGallowed_campaignsSQL";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -853,10 +884,9 @@ if ( ( ereg('Y',$with_inbound) or ereg('O',$with_inbound) ) and ($campaign_allow
|
||||
}
|
||||
$closer_campaignsSQL = preg_replace("/,$/","",$closer_campaignsSQL);
|
||||
}
|
||||
else
|
||||
{
|
||||
$closer_campaignsSQL = "''";
|
||||
}
|
||||
if (strlen($closer_campaignsSQL)<2)
|
||||
{$closer_campaignsSQL="''";}
|
||||
|
||||
if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
|
||||
|
||||
|
||||
@@ -1188,7 +1218,7 @@ if (ereg('O',$with_inbound))
|
||||
|
||||
if (eregi('ALL-ACTIVE',$group_string))
|
||||
{
|
||||
$inboundSQL = "where campaign_id IN ($ALLcloser_campaignsSQL)";
|
||||
$inboundSQL = "where campaign_id IN ($closer_campaignsSQL)";
|
||||
$stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $inboundSQL;";
|
||||
}
|
||||
|
||||
@@ -1312,11 +1342,13 @@ else
|
||||
{
|
||||
$non_inboundSQL='';
|
||||
if (ereg('N',$with_inbound))
|
||||
{$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";}
|
||||
{$non_inboundSQL = "and campaign_id NOT IN($ALLcloser_campaignsSQL)";}
|
||||
else
|
||||
{$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";}
|
||||
$multi_drop++;
|
||||
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y';";
|
||||
$stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y' $group_SQLand;";
|
||||
|
||||
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats $non_inboundSQL;";
|
||||
$stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where calls_today > -1 $non_inboundSQL;";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1419,7 +1451,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $groupSQLand limit 1;";
|
||||
$stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $group_SQLand limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$Lmix_to_print = mysql_num_rows($rslt);
|
||||
if ($Lmix_to_print > 0)
|
||||
@@ -1605,7 +1637,7 @@ if ($campaign_allow_inbound > 0)
|
||||
{
|
||||
if (eregi('ALL-ACTIVE',$group_string))
|
||||
{
|
||||
$stmt="select closer_campaigns from vicidial_campaigns $group_SQLwhere";
|
||||
$stmt="select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$closer_campaigns="";
|
||||
while ($row=mysql_fetch_row($rslt))
|
||||
@@ -1932,7 +1964,7 @@ else
|
||||
if ($orderby=='userdown') {$orderSQL='vicidial_live_agents.user desc';}
|
||||
}
|
||||
|
||||
if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';}
|
||||
if ( (eregi('ALL-ACTIVE',$group_string)) and (strlen($group_SQL) < 3) ) {$UgroupSQL = '';}
|
||||
else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";}
|
||||
if (strlen($usergroup)<1) {$usergroupSQL = '';}
|
||||
else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";}
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
# 90310-2119 - Added admin header
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 100709-1806 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
|
||||
#
|
||||
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -73,13 +73,13 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
$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);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
@@ -87,10 +87,41 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
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;
|
||||
}
|
||||
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns where active='Y';";
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -477,10 +508,12 @@ echo "</TD>";
|
||||
echo "</TR>";
|
||||
echo "</TABLE>";
|
||||
|
||||
echo "</FORM>\n\n<BR>$db_source";
|
||||
echo "</FORM>\n\n<BR>";
|
||||
$k++;
|
||||
}
|
||||
|
||||
|
||||
echo "$db_source\n";
|
||||
?>
|
||||
</PRE>
|
||||
</TD></TR></TABLE>
|
||||
|
||||
+302
-211
@@ -94,6 +94,10 @@ $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
|
||||
$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Export Calls Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Single Agent Daily , User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Perforrmance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List';
|
||||
|
||||
$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Export Calls Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Single Agent Daily , User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Perforrmance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Custom Reports Links';
|
||||
|
||||
######################################################################################################
|
||||
######################################################################################################
|
||||
####### Form variable declaration
|
||||
@@ -1367,6 +1371,8 @@ if (isset($_GET["wait_time_option_prompt_seconds"])) {$wait_time_option_prompt
|
||||
elseif (isset($_POST["wait_time_option_prompt_seconds"])) {$wait_time_option_prompt_seconds=$_POST["wait_time_option_prompt_seconds"];}
|
||||
if (isset($_GET["timer_action_destination"])) {$timer_action_destination=$_GET["timer_action_destination"];}
|
||||
elseif (isset($_POST["timer_action_destination"])) {$timer_action_destination=$_POST["timer_action_destination"];}
|
||||
if (isset($_GET["allowed_reports"])) {$allowed_reports=$_GET["allowed_reports"];}
|
||||
elseif (isset($_POST["allowed_reports"])) {$allowed_reports=$_POST["allowed_reports"];}
|
||||
|
||||
|
||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||
@@ -2385,11 +2391,13 @@ else
|
||||
# 100723-1519 - Added LOCKED options for Quick Transfer Button in campaigns
|
||||
# 100726-1017 - Added HANGUP, CALLMENU, EXTENSION and IN_GROUP timer actions to campaigns and in-groups
|
||||
# 100802-2130 - Changed Admin links to point to links page instead of Phones listings, changed Remote Agents to allow 9-digit IDs
|
||||
# 100803-1412 - Added allowed_reports option to User Groups, added CAMPLISTS_ALL for manual_dial_filter(issue #369)
|
||||
# - Added allowed_campaigns enforcement for Campaign listings
|
||||
#
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
|
||||
|
||||
$admin_version = '2.4-267';
|
||||
$build = '100802-2130';
|
||||
$admin_version = '2.4-268';
|
||||
$build = '100803-1412';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -2459,6 +2467,19 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and active='Y' and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$reports_auth=$row[0];
|
||||
|
||||
$reports_only_user=0;
|
||||
if ( ($reports_auth > 0) and ($auth < 1) )
|
||||
{
|
||||
$ADD=999999;
|
||||
$reports_only_user=1;
|
||||
}
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
|
||||
@@ -2466,78 +2487,89 @@ $date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1))
|
||||
if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ( ($auth < 1 ) and ($reports_auth < 1) ) )
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ($auth > 0) or ($reports_auth > 0) )
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfull_name =$row[3];
|
||||
$LOGuser_level =$row[4];
|
||||
$LOGuser_group =$row[5];
|
||||
$LOGdelete_users =$row[8];
|
||||
$LOGdelete_user_groups =$row[9];
|
||||
$LOGdelete_lists =$row[10];
|
||||
$LOGdelete_campaigns =$row[11];
|
||||
$LOGdelete_ingroups =$row[12];
|
||||
$LOGdelete_remote_agents =$row[13];
|
||||
$LOGload_leads =$row[14];
|
||||
$LOGcampaign_detail =$row[15];
|
||||
$LOGast_admin_access =$row[16];
|
||||
$LOGast_delete_phones =$row[17];
|
||||
$LOGdelete_scripts =$row[18];
|
||||
$LOGdelete_filters =$row[29];
|
||||
$LOGalter_agent_interface =$row[30];
|
||||
$LOGdelete_call_times =$row[32];
|
||||
$LOGmodify_call_times =$row[33];
|
||||
$LOGmodify_users =$row[34];
|
||||
$LOGmodify_campaigns =$row[35];
|
||||
$LOGmodify_lists =$row[36];
|
||||
$LOGmodify_scripts =$row[37];
|
||||
$LOGmodify_filters =$row[38];
|
||||
$LOGmodify_ingroups =$row[39];
|
||||
$LOGmodify_usergroups =$row[40];
|
||||
$LOGmodify_remoteagents =$row[41];
|
||||
$LOGmodify_servers =$row[42];
|
||||
$LOGview_reports =$row[43];
|
||||
$LOGmodify_dids =$row[56];
|
||||
$LOGdelete_dids =$row[57];
|
||||
$LOGmanager_shift_enforcement_override=$row[61];
|
||||
$LOGexport_reports =$row[64];
|
||||
$LOGdelete_from_dnc =$row[65];
|
||||
$LOGcallcard_admin =$row[66];
|
||||
|
||||
$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGallowed_campaigns = $row[0];
|
||||
$LOGallowed_reports = $row[1];
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($auth>0)
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfull_name =$row[3];
|
||||
$LOGuser_level =$row[4];
|
||||
$LOGuser_group =$row[5];
|
||||
$LOGdelete_users =$row[8];
|
||||
$LOGdelete_user_groups =$row[9];
|
||||
$LOGdelete_lists =$row[10];
|
||||
$LOGdelete_campaigns =$row[11];
|
||||
$LOGdelete_ingroups =$row[12];
|
||||
$LOGdelete_remote_agents =$row[13];
|
||||
$LOGload_leads =$row[14];
|
||||
$LOGcampaign_detail =$row[15];
|
||||
$LOGast_admin_access =$row[16];
|
||||
$LOGast_delete_phones =$row[17];
|
||||
$LOGdelete_scripts =$row[18];
|
||||
$LOGdelete_filters =$row[29];
|
||||
$LOGalter_agent_interface =$row[30];
|
||||
$LOGdelete_call_times =$row[32];
|
||||
$LOGmodify_call_times =$row[33];
|
||||
$LOGmodify_users =$row[34];
|
||||
$LOGmodify_campaigns =$row[35];
|
||||
$LOGmodify_lists =$row[36];
|
||||
$LOGmodify_scripts =$row[37];
|
||||
$LOGmodify_filters =$row[38];
|
||||
$LOGmodify_ingroups =$row[39];
|
||||
$LOGmodify_usergroups =$row[40];
|
||||
$LOGmodify_remoteagents =$row[41];
|
||||
$LOGmodify_servers =$row[42];
|
||||
$LOGview_reports =$row[43];
|
||||
$LOGmodify_dids =$row[56];
|
||||
$LOGdelete_dids =$row[57];
|
||||
$LOGmanager_shift_enforcement_override=$row[61];
|
||||
$LOGexport_reports =$row[64];
|
||||
$LOGdelete_from_dnc =$row[65];
|
||||
$LOGcallcard_admin =$row[66];
|
||||
|
||||
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGallowed_campaigns = $row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
######################################################################################################
|
||||
######################################################################################################
|
||||
####### Header settings
|
||||
@@ -2831,6 +2863,7 @@ if ($ADD==99999) {$hh='users'; echo "HELP";}
|
||||
if ($ADD==999999) {$hh='reports'; echo "REPORTS";}
|
||||
if ($ADD==999998) {$hh='admin'; echo "ADMIN";}
|
||||
|
||||
|
||||
if ( ($ADD>9) && ($ADD < 99998) )
|
||||
{
|
||||
##### get scripts listing for dynamic pulldown
|
||||
@@ -2884,7 +2917,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD
|
||||
|
||||
##### BEGIN get campaigns listing for rankings #####
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
$campaigns_list='';
|
||||
@@ -3235,7 +3268,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A
|
||||
$qc_campaigns_list.="> ALL-CAMPAIGNS - USERS CAN QC ANY CAMPAIGN</B><BR>\n";
|
||||
$qc_groups_list.="> ALL-GROUPS - USERS CAN QC ANY INBOUND GROUP</B><BR>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -4296,7 +4329,7 @@ if ($ADD==99999)
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-manual_dial_filter">
|
||||
<BR>
|
||||
<B>Manual Dial Filter -</B> This allows you to filter the calls that agents make in manual dial mode for this campaign by any combination of the following: DNC - to kick out, CAMPAIGNLISTS - the number must be within the lists for the campaign, NONE - no filter on manual dial or fast dial lists.
|
||||
<B>Manual Dial Filter -</B> This allows you to filter the calls that agents make in manual dial mode for this campaign by any combination of the following: DNC - to kick out, CAMPAIGNLISTS - the number must be within the lists for the campaign, NONE - no filter on manual dial or fast dial lists. CAMPLISTS_ALL - will include inactive lists in the search for the number.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_campaigns-agent_clipboard_copy">
|
||||
@@ -5401,6 +5434,11 @@ if ($ADD==99999)
|
||||
<BR>
|
||||
<B>Agent Fullscreen -</B> This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agents View, Calls in Queue View or Calls in Session view. Default is N for no or disabled.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_user_groups-allowed_reports">
|
||||
<BR>
|
||||
<B>Allowed Reports -</B> If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports.
|
||||
|
||||
<?php
|
||||
if ($SSqc_features_active > 0)
|
||||
{
|
||||
@@ -7407,7 +7445,7 @@ if ($ADD==12)
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Source Campaign: </td><td align=left><select size=1 name=source_campaign_id>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
$campaigns_list='';
|
||||
@@ -7471,7 +7509,7 @@ if ($ADD==111)
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>List Description: </td><td align=left><input type=text name=list_description size=30 maxlength=255>$NWB#vicidial_lists-list_description$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Campaign: </td><td align=left><select size=1 name=campaign_id>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
$campaigns_list='';
|
||||
@@ -7509,7 +7547,7 @@ if ($ADD==121)
|
||||
|
||||
$campaigns_list = "<option SELECTED value=\"SYSTEM_INTERNAL\">SYSTEM_INTERNAL - INTERNAL VICIDIAL DNC LIST</option>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where use_campaign_dnc IN('Y','AREACODE') order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where use_campaign_dnc IN('Y','AREACODE') $LOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -13402,8 +13440,17 @@ if ($ADD==411111)
|
||||
$VGROUP_vgroups .= "$agent_status_viewable_groups[$p] ";
|
||||
$p++;
|
||||
}
|
||||
|
||||
$stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen' where user_group='$OLDuser_group';";
|
||||
$k=0;
|
||||
$multi_count = count($allowed_reports);
|
||||
$multi_array = $allowed_reports;
|
||||
while ($k < $multi_count)
|
||||
{
|
||||
$new_field_value .= "$multi_array[$k],";
|
||||
$k++;
|
||||
}
|
||||
$allowed_reports = preg_replace("/,$/","",$new_field_value);
|
||||
|
||||
$stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports' where user_group='$OLDuser_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>USER GROUP MODIFIED</B>\n";
|
||||
@@ -17706,7 +17753,7 @@ if ($ADD==31)
|
||||
while ($DRgroups_to_print > $o)
|
||||
{
|
||||
$DRcampaigns='';
|
||||
$stmt="SELECT campaign_id from vicidial_campaigns where drop_rate_group='$DRgroups[$o]';";
|
||||
$stmt="SELECT campaign_id from vicidial_campaigns where drop_rate_group='$DRgroups[$o]' $LOGallowed_campaignsSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$DRcampaigns_to_print = mysql_num_rows($rslt);
|
||||
$p=0;
|
||||
@@ -17904,7 +17951,7 @@ if ($ADD==31)
|
||||
|
||||
echo "<tr bgcolor=#8EBCFD><td align=right>Manual Dial List ID: </td><td align=left><input type=text name=manual_dial_list_id size=15 maxlength=12 value=\"$manual_dial_list_id\">$NWB#vicidial_campaigns-manual_dial_list_id$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#8EBCFD><td align=right>Manual Dial Filter: </td><td align=left><select size=1 name=manual_dial_filter><option>NONE</option><option>DNC_ONLY</option><option>CAMPLISTS_ONLY</option><option>DNC_AND_CAMPLISTS</option><option SELECTED>$manual_dial_filter</option></select>$NWB#vicidial_campaigns-manual_dial_filter$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#8EBCFD><td align=right>Manual Dial Filter: </td><td align=left><select size=1 name=manual_dial_filter><option>NONE</option><option>DNC_ONLY</option><option>CAMPLISTS_ONLY</option><option>CAMPLISTS_ALL</option><option>DNC_AND_CAMPLISTS</option><option>DNC_AND_CAMPLISTS_ALL</option><option SELECTED>$manual_dial_filter</option></select>$NWB#vicidial_campaigns-manual_dial_filter$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Screen Clipboard Copy: </td><td align=left><select size=1 name=agent_clipboard_copy><option>NONE</option><option>lead_id</option><option>list_id</option><option>title</option><option>first_name</option><option>middle_initial</option><option>last_name</option><option>phone_code</option><option>phone_number</option><option>address1</option><option>address2</option><option>address3</option><option>city</option><option>state</option><option>province</option><option>postal_code</option><option>country_code</option><option>alt_phone</option><option>comments</option><option>date_of_birth</option><option>email</option><option>gender</option><option>gmt_offset_now</option><option>security_phrase</option><option>vendor_lead_code</option><option SELECTED>$agent_clipboard_copy</option></select>$NWB#vicidial_campaigns-agent_clipboard_copy$NWE</td></tr>\n";
|
||||
|
||||
@@ -19457,7 +19504,7 @@ echo "<td><B>STATUSES</B></td>\n";
|
||||
echo "<td><B>MODIFY</B></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -19519,7 +19566,7 @@ echo "<td><B>HOTKEYS</B></td>\n";
|
||||
echo "<td><B>MODIFY</B></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -19581,7 +19628,7 @@ echo "<td><B>LEAD RECYCLES</B></td>\n";
|
||||
echo "<td><B>MODIFY</B></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -19643,7 +19690,7 @@ echo "<td><B>AUTO-ALT DIAL</B></td>\n";
|
||||
echo "<td><B>MODIFY</B></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -19705,7 +19752,7 @@ echo "<td><B>PAUSE CODES</B></td>\n";
|
||||
echo "<td><B>MODIFY</B></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -19767,7 +19814,7 @@ echo "<td><B>LIST MIX</B></td>\n";
|
||||
echo "<td><B>MODIFY</B></td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -19921,7 +19968,7 @@ if ($ADD==311)
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>List Description: </td><td align=left><input type=text name=list_description size=30 maxlength=255 value=\"$list_description\">$NWB#vicidial_lists-list_description$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id\">Campaign</a>: </td><td align=left><select size=1 name=campaign_id>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
$campaigns_list='';
|
||||
@@ -21091,7 +21138,7 @@ if ($ADD==3111)
|
||||
echo "<B>CAMPAIGNS ALLOWING THIS IN-GROUP:</B><BR>\n";
|
||||
echo "<TABLE>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\";";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\" $LOGallowed_campaignsSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campin_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
@@ -21164,7 +21211,7 @@ if ($ADD==3311)
|
||||
$record_call = $row[20];
|
||||
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
$campaigns_list='';
|
||||
@@ -21778,7 +21825,7 @@ if ($ADD==311111)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT user_group,group_name,allowed_campaigns,qc_allowed_campaigns,qc_allowed_inbound_groups,group_shifts,forced_timeclock_login,shift_enforcement,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial,agent_fullscreen from vicidial_user_groups where user_group='$user_group';";
|
||||
$stmt="SELECT user_group,group_name,allowed_campaigns,qc_allowed_campaigns,qc_allowed_inbound_groups,group_shifts,forced_timeclock_login,shift_enforcement,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial,agent_fullscreen,allowed_reports from vicidial_user_groups where user_group='$user_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$user_group = $row[0];
|
||||
@@ -21796,6 +21843,7 @@ if ($ADD==311111)
|
||||
$agent_xfer_dial_with_customer = $row[15];
|
||||
$agent_xfer_park_customer_dial = $row[16];
|
||||
$agent_fullscreen = $row[17];
|
||||
$allowed_reports = $row[18];
|
||||
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
@@ -21897,6 +21945,21 @@ if ($ADD==311111)
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Fullscreen: </td><td align=left><select size=1 name=agent_fullscreen><option SELECTED>Y</option><option>N</option><option SELECTED>$agent_fullscreen</option></select>$NWB#vicidial_user_groups-agent_fullscreen$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Allowed Reports: </td><td align=left><select MULTIPLE size=8 name=allowed_reports[]>\n";
|
||||
$Vreports_ARY = explode(',',$UGreports);
|
||||
$Vreports_ct = count($Vreports_ARY);
|
||||
$b=0;
|
||||
while ($b < $Vreports_ct)
|
||||
{
|
||||
$field_selected='';
|
||||
trim($Vreports_ARY[$b]);
|
||||
if (preg_match("/$Vreports_ARY[$b]/",$allowed_reports))
|
||||
{$field_selected = 'SELECTED';}
|
||||
echo "<option value=\"$Vreports_ARY[$b]\" $field_selected>$Vreports_ARY[$b]</option>\n";
|
||||
$b++;
|
||||
}
|
||||
echo "</select>$NWB#vicidial_user_groups-allowed_reports$NWE</td></tr>\n";
|
||||
|
||||
if ($SSqc_features_active > 0)
|
||||
{
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>QC Allowed Campaigns: <BR>$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE</td><td align=left>\n";
|
||||
@@ -22069,7 +22132,7 @@ if ($ADD==3111111)
|
||||
echo "<B> CAMPAIGNS USING THIS SCRIPT:</B><BR>\n";
|
||||
echo "<TABLE>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id';";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id' $LOGallowed_campaignsSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$camps_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
@@ -22099,7 +22162,7 @@ if ($ADD==3111111)
|
||||
echo "<B> LIST OVERRIDES USING THIS SCRIPT:</B><BR>\n";
|
||||
echo "<TABLE>\n";
|
||||
|
||||
$stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id';";
|
||||
$stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id' $LOGallowed_campaignsSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$camps_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
@@ -22161,7 +22224,7 @@ if ($ADD==31111111)
|
||||
echo "</TABLE></center></form>\n";
|
||||
|
||||
##### get campaigns listing for dynamic pulldown
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
$campaigns_list='';
|
||||
@@ -22363,7 +22426,7 @@ if ($ADD==311111111)
|
||||
echo "<B>CAMPAIGNS USING THIS CALL TIME:</B><BR>\n";
|
||||
echo "<TABLE>\n";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';";
|
||||
$stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id' $LOGallowed_campaignsSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$camps_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
@@ -23889,7 +23952,6 @@ if ($ADD==311111111111111)
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Reports to use Slave DB: </td><td align=left><select MULTIPLE size=4 name=reports_use_slave_db[]>\n";
|
||||
|
||||
$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Export Calls Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Single Agent Daily , User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Perforrmance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List';
|
||||
$Vreports_ARY = explode(',',$Vreports);
|
||||
$Vreports_ct = count($Vreports_ARY);
|
||||
$b=0;
|
||||
@@ -24666,7 +24728,7 @@ if ($ADD==10)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns order by campaign_id";
|
||||
$stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -24735,7 +24797,7 @@ if ($ADD==100)
|
||||
if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';}
|
||||
if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';}
|
||||
if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';}
|
||||
$stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id group by list_id $SQLorder";
|
||||
$stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id $LOGallowed_campaignsSQL group by list_id $SQLorder";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$lists_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -24775,7 +24837,7 @@ if ($ADD==100)
|
||||
$o++;
|
||||
}
|
||||
|
||||
$stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'');";
|
||||
$stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'') $LOGallowed_campaignsSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$lists_to_print = mysql_num_rows($rslt);
|
||||
$o=0;
|
||||
@@ -24962,7 +25024,7 @@ if ($ADD==10000)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,extension_group,status,campaign_id from vicidial_remote_agents order by server_ip,campaign_id,user_start";
|
||||
$stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,extension_group,status,campaign_id from vicidial_remote_agents $whereLOGallowed_campaignsSQL order by server_ip,campaign_id,user_start";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$remoteagents_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -26145,54 +26207,75 @@ if ($ADD==999999)
|
||||
<TABLE BORDER=0 CELLPADDING=5 CELLSPACING=0><TR><TD VALIGN=TOP>
|
||||
|
||||
</TD><TD VALIGN=TOP>
|
||||
<B>Real-Time Reports</B><BR>
|
||||
<UL>
|
||||
<LI><a href="AST_timeonVDADall.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Real-Time Main Report</a></FONT>
|
||||
<!-- <BR> Real-Time SIP: <a href="AST_timeonVDADall.php?SIPmonitorLINK=1"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Listen</a></FONT> - <a href="AST_timeonVDADall.php?SIPmonitorLINK=2"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Barge</a></FONT>
|
||||
<BR> Real-Time IAX: <a href="AST_timeonVDADall.php?IAXmonitorLINK=1"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Listen</a></FONT> - <a href="AST_timeonVDADall.php?IAXmonitorLINK=2"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Barge</a></FONT><BR><BR> -->
|
||||
<LI><a href="AST_timeonVDADallSUMMARY.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Real-Time Campaign Summary</a></FONT>
|
||||
</UL><BR>
|
||||
<B>Inbound and Outbound Calling Reports</B><BR>
|
||||
<UL>
|
||||
<LI><a href="AST_CLOSERstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Inbound Report</a></FONT>
|
||||
<LI><a href="AST_CLOSER_service_level.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Inbound Service Level Report</a></FONT>
|
||||
<LI><a href="AST_CLOSERsummary_hourly.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Inbound Summary Hourly Report</a></FONT>
|
||||
<LI><a href="AST_DIDstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Inbound DID Report</a></FONT>
|
||||
<LI><a href="AST_IVRstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Inbound IVR Report</a></FONT>
|
||||
<LI><a href="AST_VDADstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Outbound Calling Report</a></FONT>
|
||||
<LI><a href="AST_OUTBOUNDsummary_interval.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Outbound Summary Interval Report</a></FONT>
|
||||
|
||||
<LI><a href="fcstats.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Fronter - Closer Report</a></FONT>
|
||||
<!-- <LI><a href="vicidial_sales_viewer.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>AGENT SPREADSHEET PERFORMANCE</a></FONT> -->
|
||||
<?php
|
||||
<?php
|
||||
|
||||
echo "<B>Real-Time Reports</B><BR>\n";
|
||||
echo "<UL>\n";
|
||||
if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_timeonVDADall.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Real-Time Main Report</a></FONT>\n";}
|
||||
# echo "<BR> Real-Time SIP: <a href=\"AST_timeonVDADall.php?SIPmonitorLINK=1\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Listen</a></FONT> - <a href=\"AST_timeonVDADall.php?SIPmonitorLINK=2\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Barge</a></FONT>\n";
|
||||
# echo "<BR> Real-Time IAX: <a href=\"AST_timeonVDADall.php?IAXmonitorLINK=1\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Listen</a></FONT> - <a href=\"AST_timeonVDADall.php?IAXmonitorLINK=2\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Barge</a></FONT><BR><BR>\n";
|
||||
if ( (preg_match("/Real-Time Campaign Summary/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_timeonVDADallSUMMARY.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Real-Time Campaign Summary</a></FONT>\n";}
|
||||
echo "</UL><BR>\n";
|
||||
echo "<B>Inbound and Outbound Calling Reports</B><BR>\n";
|
||||
echo "<UL>\n";
|
||||
if ( (preg_match("/Inbound Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_CLOSERstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound Report</a></FONT>\n";}
|
||||
if ( (preg_match("/Inbound Service Level Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_CLOSER_service_level.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound Service Level Report</a></FONT>\n";}
|
||||
if ( (preg_match("/Inbound Summary Hourly Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_CLOSERsummary_hourly.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound Summary Hourly Report</a></FONT>\n";}
|
||||
if ( (preg_match("/Inbound DID Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_DIDstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound DID Report</a></FONT>\n";}
|
||||
if ( (preg_match("/Inbound IVR Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_IVRstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Inbound IVR Report</a></FONT>\n";}
|
||||
if ( (preg_match("/Outbound Calling Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_VDADstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Outbound Calling Report</a></FONT>\n";}
|
||||
if ( (preg_match("/Outbound Summary Interval Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_OUTBOUNDsummary_interval.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Outbound Summary Interval Report</a></FONT>\n";}
|
||||
if ( (preg_match("/Fronter - Closer Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"fcstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Fronter - Closer Report</a></FONT>\n";}
|
||||
# echo "<LI><a href=\"vicidial_sales_viewer.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>AGENT SPREADSHEET PERFORMANCE</a></FONT>\n";
|
||||
if ($LOGexport_reports >= 1)
|
||||
{
|
||||
echo "<LI><a href=\"call_report_export.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Export Calls Report</a></FONT>\n";
|
||||
}
|
||||
?>
|
||||
</UL>
|
||||
echo "</UL>\n";
|
||||
echo "</TD><TD VALIGN=TOP>\n";
|
||||
echo " \n";
|
||||
echo "</TD><TD VALIGN=TOP>\n";
|
||||
echo "<B>Agent Reports</B><BR>\n";
|
||||
echo "<UL>\n";
|
||||
if ( (preg_match("/Agent Time Detail/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_agent_time_detail.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Agent Time Detail</a></FONT>\n";}
|
||||
if ( (preg_match("/Agent Status Detail/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_agent_status_detail.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Agent Status Detail</a></FONT>\n";}
|
||||
if ( (preg_match("/Agent Performance Detail/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_agent_performance_detail.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Agent Performance Detail</a></FONT>\n";}
|
||||
if ( (preg_match("/Single Agent Daily/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_agent_days_detail.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Single Agent Daily</a></FONT>\n";}
|
||||
if ( (preg_match("/User Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"user_stats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>User Stats</a></FONT>\n";}
|
||||
if ( (preg_match("/User Time Sheet/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_agent_time_sheet.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>User Time Sheet</a></FONT>\n";}
|
||||
echo "</UL><BR>\n";
|
||||
echo "<B>Time Clock Reports</B><BR>\n";
|
||||
echo "<UL>\n";
|
||||
if ( (preg_match("/User Timeclock Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"timeclock_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>User Timeclock Report</a></FONT>\n";}
|
||||
if ( (preg_match("/User Group Timeclock Status Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"timeclock_status.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>User Group Timeclock Status Report</a></FONT>\n";}
|
||||
if ( (preg_match("/User Timeclock Detail Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_agent_timeclock_detail.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>User Timeclock Detail Report</a></FONT>\n";}
|
||||
echo "</UL><BR>\n";
|
||||
echo "<B>Other Reports and Links</B><BR>\n";
|
||||
echo "<UL>\n";
|
||||
if ( (preg_match("/Server Perforrmance Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{echo "<LI><a href=\"AST_server_performance.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Server Perforrmance Report</a></FONT>\n";}
|
||||
|
||||
</TD><TD VALIGN=TOP>
|
||||
|
||||
</TD><TD VALIGN=TOP>
|
||||
<B>Agent Reports</B><BR>
|
||||
<UL>
|
||||
<LI><a href="AST_agent_time_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Agent Time Detail</a></FONT>
|
||||
<LI><a href="AST_agent_status_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Agent Status Detail</a></FONT>
|
||||
<LI><a href="AST_agent_performance_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Agent Performance Detail</a></FONT>
|
||||
<LI><a href="AST_agent_days_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Single Agent Daily</a></FONT>
|
||||
</UL><BR>
|
||||
<B>Time Clock Reports</B><BR>
|
||||
<UL>
|
||||
<LI><a href="timeclock_report.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>User Timeclock Report</a></FONT>
|
||||
<LI><a href="timeclock_status.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>User Group Timeclock Status Report</a></FONT>
|
||||
<LI><a href="AST_agent_timeclock_detail.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>User Timeclock Detail Report</a></FONT>
|
||||
</UL><BR>
|
||||
<B>Other Reports and Links</B><BR>
|
||||
<UL>
|
||||
<LI><a href="AST_server_performance.php"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=2>Server Perforrmance Report</a></FONT>
|
||||
<?php
|
||||
if ($LOGuser_level >= 9)
|
||||
if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) )
|
||||
{
|
||||
echo "<LI><a href=\"$PHP_SELF?ADD=700000000000000\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Administration Change Log</a></FONT>\n";
|
||||
}
|
||||
@@ -26204,98 +26287,106 @@ if ($ADD==999999)
|
||||
{
|
||||
echo "<LI><a href=\"$vtiger_url_LU\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>VtigerCRM Home</a></FONT>\n";
|
||||
}
|
||||
if ($list_update_count > 0)
|
||||
if ( ($list_update_count > 0) and ( (preg_match("/List Update Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) )
|
||||
{
|
||||
echo "<LI><a href=\"./AST_LIST_UPDATEstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>List Update Stats</a></FONT>\n";
|
||||
}
|
||||
?>
|
||||
</UL>
|
||||
</TD></TR></TABLE>
|
||||
echo "</UL>\n";
|
||||
echo "</TD></TR></TABLE>\n";
|
||||
|
||||
<?
|
||||
if (file_exists('custom_report_links.html'))
|
||||
{
|
||||
readfile('custom_report_links.html');
|
||||
}
|
||||
?>
|
||||
<PRE><TABLE BORDER=1 CELLPADDING=2 cellspacing=0>
|
||||
<?php
|
||||
|
||||
if ($stage == 'TIME')
|
||||
if ( (file_exists('custom_report_links.html')) and ( (preg_match("/Custom Reports Links/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) )
|
||||
{
|
||||
echo "<TR><TD>SERVER <a href=\"$PHP_SELF?ADD=999999\">-</a></TD>";
|
||||
echo "<TD>DESCRIPTION</TD><TD>IP</TD><TD>ACT</TD><TD>LOAD</TD><TD>CHAN</TD><TD>DISK</TD><TD>TIME</TD></TR>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<TR><TD>SERVER <a href=\"$PHP_SELF?ADD=999999&stage=TIME\">+</a></TD>";
|
||||
echo "<TD>DESCRIPTION</TD><TD>IP</TD><TD>ACT</TD><TD>LOAD</TD><TD>CHAN</TD><TD>DISK</TD><TD>OUTBOUND</TD><TD>INBOUND</TD></TR>\n";
|
||||
readfile('custom_report_links.html');
|
||||
}
|
||||
|
||||
$o=0;
|
||||
while ($servers_to_print > $o)
|
||||
|
||||
if ($reports_only_user < 1)
|
||||
{
|
||||
$cpu = (100 - $cpu_idle_percent[$o]);
|
||||
$disk = '';
|
||||
$disk_ary = explode('|',$disk_usage[$o]);
|
||||
$disk_ary_ct = count($disk_ary);
|
||||
$k=0;
|
||||
while ($k < $disk_ary_ct)
|
||||
{
|
||||
$disk_ary[$k] = preg_replace("/^\d* /","",$disk_ary[$k]);
|
||||
if ($k<1) {$disk = "$disk_ary[$k]";}
|
||||
else
|
||||
{
|
||||
if ($disk_ary[$k] > $disk) {$disk = "$disk_ary[$k]";}
|
||||
}
|
||||
$k++;
|
||||
}
|
||||
$disk = "$disk%";
|
||||
echo "<TR>\n";
|
||||
echo "<TD><a href=\"$PHP_SELF?ADD=311111111111&server_id=$server_id[$o]\">$server_id[$o]</a></TD>\n";
|
||||
echo "<TD>$server_description[$o]</TD>\n";
|
||||
echo "<TD>$server_ip[$o]</TD>\n";
|
||||
echo "<TD>$active[$o]</TD>\n";
|
||||
echo "<TD>$sysload[$o] - $cpu%</TD>\n";
|
||||
echo "<TD>$channels_total[$o]</TD>\n";
|
||||
echo "<TD ALIGN=RIGHT>$disk</TD>\n";
|
||||
echo "<PRE><TABLE BORDER=1 CELLPADDING=2 cellspacing=0>\n";
|
||||
|
||||
if ($stage == 'TIME')
|
||||
{
|
||||
$stmt="select last_update from server_updater where server_ip='$server_ip[$o]';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$servertime_to_print = mysql_num_rows($rslt);
|
||||
if ($servertime_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "<TD NOWRAP>$row[0]</TD>";
|
||||
}
|
||||
echo "<TR><TD>SERVER <a href=\"$PHP_SELF?ADD=999999\">-</a></TD>";
|
||||
echo "<TD>DESCRIPTION</TD><TD>IP</TD><TD>ACT</TD><TD>LOAD</TD><TD>CHAN</TD><TD>DISK</TD><TD>TIME</TD></TR>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<TD><a href=\"AST_timeonVDAD.php?server_ip=$server_ip[$o]\">LINK</a></TD>\n";
|
||||
echo "<TD><a href=\"AST_timeonVDAD.php?server_ip=$server_ip[$o]&closer_display=1\">LINK</a></TD>\n";
|
||||
echo "<TR><TD>SERVER <a href=\"$PHP_SELF?ADD=999999&stage=TIME\">+</a></TD>";
|
||||
echo "<TD>DESCRIPTION</TD><TD>IP</TD><TD>ACT</TD><TD>LOAD</TD><TD>CHAN</TD><TD>DISK</TD><TD>OUTBOUND</TD><TD>INBOUND</TD></TR>\n";
|
||||
}
|
||||
echo "</TR>\n";
|
||||
$o++;
|
||||
}
|
||||
|
||||
if ($stage == 'TIME')
|
||||
{
|
||||
echo "<TR><TD COLSPAN=2> </TD><TD>PHP Time</TD><TD COLSPAN=4> </TD><TD NOWRAP>" . date("Y-m-d H:i:s") . "</TD></TR>";
|
||||
|
||||
$stmt="select NOW();";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$dbtime_to_print = mysql_num_rows($rslt);
|
||||
if ($dbtime_to_print)
|
||||
$o=0;
|
||||
while ($servers_to_print > $o)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "<TR><TD COLSPAN=2> </TD><TD>DB Time</TD><TD COLSPAN=4> </TD><TD NOWRAP>$row[0]</TD></TR>";
|
||||
$cpu = (100 - $cpu_idle_percent[$o]);
|
||||
$disk = '';
|
||||
$disk_ary = explode('|',$disk_usage[$o]);
|
||||
$disk_ary_ct = count($disk_ary);
|
||||
$k=0;
|
||||
while ($k < $disk_ary_ct)
|
||||
{
|
||||
$disk_ary[$k] = preg_replace("/^\d* /","",$disk_ary[$k]);
|
||||
if ($k<1) {$disk = "$disk_ary[$k]";}
|
||||
else
|
||||
{
|
||||
if ($disk_ary[$k] > $disk) {$disk = "$disk_ary[$k]";}
|
||||
}
|
||||
$k++;
|
||||
}
|
||||
$disk = "$disk%";
|
||||
echo "<TR>\n";
|
||||
echo "<TD><a href=\"$PHP_SELF?ADD=311111111111&server_id=$server_id[$o]\">$server_id[$o]</a></TD>\n";
|
||||
echo "<TD>$server_description[$o]</TD>\n";
|
||||
echo "<TD>$server_ip[$o]</TD>\n";
|
||||
echo "<TD>$active[$o]</TD>\n";
|
||||
echo "<TD>$sysload[$o] - $cpu%</TD>\n";
|
||||
echo "<TD>$channels_total[$o]</TD>\n";
|
||||
echo "<TD ALIGN=RIGHT>$disk</TD>\n";
|
||||
if ($stage == 'TIME')
|
||||
{
|
||||
$stmt="select last_update from server_updater where server_ip='$server_ip[$o]';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$servertime_to_print = mysql_num_rows($rslt);
|
||||
if ($servertime_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "<TD NOWRAP>$row[0]</TD>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{
|
||||
echo "<TD><a href=\"AST_timeonVDAD.php?server_ip=$server_ip[$o]\">LINK</a></TD>\n";
|
||||
echo "<TD><a href=\"AST_timeonVDAD.php?server_ip=$server_ip[$o]&closer_display=1\">LINK</a></TD>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<TD> </TD>\n";
|
||||
echo "<TD> </TD>\n";
|
||||
}
|
||||
}
|
||||
echo "</TR>\n";
|
||||
$o++;
|
||||
}
|
||||
}
|
||||
|
||||
echo "</TABLE>\n";
|
||||
if ($stage == 'TIME')
|
||||
{
|
||||
echo "<TR><TD COLSPAN=2> </TD><TD>PHP Time</TD><TD COLSPAN=4> </TD><TD NOWRAP>" . date("Y-m-d H:i:s") . "</TD></TR>";
|
||||
|
||||
$stmt="select NOW();";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$dbtime_to_print = mysql_num_rows($rslt);
|
||||
if ($dbtime_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
echo "<TR><TD COLSPAN=2> </TD><TD>DB Time</TD><TD COLSPAN=4> </TD><TD NOWRAP>$row[0]</TD></TR>";
|
||||
}
|
||||
}
|
||||
echo "</TABLE>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100713-0101 - Added recordings fields option (for filename, recording ID and URL)
|
||||
# 100713-1050 - Fixed minor custom fields issue
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -93,7 +94,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and export_reports='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and export_reports='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -108,6 +109,38 @@ 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 > 7 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;
|
||||
}
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
||||
|
||||
|
||||
##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE #####
|
||||
if ($run_export > 0)
|
||||
@@ -137,8 +170,11 @@ if ($run_export > 0)
|
||||
$i=0;
|
||||
while($i < $campaign_ct)
|
||||
{
|
||||
$campaign_string .= "$campaign[$i]|";
|
||||
$campaign_SQL .= "'$campaign[$i]',";
|
||||
if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$campaign_string .= "$campaign[$i]|";
|
||||
$campaign_SQL .= "'$campaign[$i]',";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) )
|
||||
@@ -490,7 +526,7 @@ else
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
|
||||
$stmt="select campaign_id from vicidial_campaigns order by campaign_id;";
|
||||
$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
@@ -535,7 +571,7 @@ else
|
||||
$i++;
|
||||
}
|
||||
|
||||
$stmt="select list_id from vicidial_lists order by list_id;";
|
||||
$stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$lists_to_print = mysql_num_rows($rslt);
|
||||
@@ -565,7 +601,7 @@ else
|
||||
$i++;
|
||||
}
|
||||
|
||||
$stmt="select distinct status from vicidial_campaign_statuses order by status;";
|
||||
$stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$Cstatuses_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -70,7 +71,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';";
|
||||
$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);
|
||||
@@ -84,6 +85,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;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
# 100508-1439 - Added header row to output
|
||||
# 100702-1335 - Added custom fields
|
||||
# 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_
|
||||
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1';";
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1' and active='Y';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -81,6 +82,52 @@ 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;
|
||||
}
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
|
||||
$stmt="select count(*) from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$count_to_print = mysql_num_rows($rslt);
|
||||
if ($count_to_print > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$lists_allowed =$row[0];
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($lists_allowed < 1)
|
||||
{
|
||||
echo "You are not allowed to download this list: $list_id\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$stmt="select count(*) from vicidial_list where list_id='$list_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# 100214-1421 - Sort menu alphabetically
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -76,7 +77,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='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";}
|
||||
if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -91,6 +92,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;
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
@@ -11,6 +11,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
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -83,7 +84,7 @@ else
|
||||
|
||||
$EoDdate = date("Y-m-d H:i:s", $EoD);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='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 ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -101,32 +102,28 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
$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)) )
|
||||
{
|
||||
if($auth>0)
|
||||
{
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
$stmt="select user_group from vicidial_user_groups order by user_group;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
|
||||
+38
-34
@@ -25,6 +25,7 @@
|
||||
# 100216-0042 - Added popup date selector
|
||||
# 100425-0115 - Added more login data
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -94,7 +95,7 @@ $TODAY = date("Y-m-d");
|
||||
if (!isset($begin_date)) {$begin_date = $TODAY;}
|
||||
if (!isset($end_date)) {$end_date = $TODAY;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='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 ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -112,41 +113,44 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$stmt="SELECT full_name,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname = $row[0];
|
||||
$LOGuser_group = $row[1];
|
||||
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
if ($did > 0)
|
||||
{
|
||||
$stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$full_name = $row[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($did > 0)
|
||||
{
|
||||
$stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$full_name = $row[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT full_name from vicidial_users where user='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$full_name = $row[0];
|
||||
}
|
||||
$stmt="SELECT full_name from vicidial_users where user='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$full_name = $row[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user