Added allow_web_debug system setting and more variable filtering
git-svn-id: svn://192.168.202.10@3574 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<?php
|
||||
# process_report.php
|
||||
#
|
||||
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 180114-1051 - First build
|
||||
# 220227-1958 - Added allow_web_debug system setting
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -29,11 +30,15 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
|
||||
$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,enable_languages,language_method FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,enable_languages,language_method,allow_web_debug FROM system_settings;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
#if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysqli_num_rows($rslt);
|
||||
if ($qm_conf_ct > 0)
|
||||
{
|
||||
@@ -44,19 +49,26 @@ if ($qm_conf_ct > 0)
|
||||
$user_territories_active = $row[3];
|
||||
$SSenable_languages = $row[4];
|
||||
$SSlanguage_method = $row[5];
|
||||
$SSallow_web_debug = $row[6];
|
||||
}
|
||||
if ($SSallow_web_debug < 1) {$DB=0;}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$submit = preg_replace('/[^-_0-9a-zA-Z]/',"",$submit);
|
||||
$SUBMIT = preg_replace('/[^-_0-9a-zA-Z]/',"",$SUBMIT);
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_PW);
|
||||
$group = preg_replace('/[^-_0-9a-zA-Z]/', '', $group);
|
||||
}
|
||||
else
|
||||
{
|
||||
$PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
|
||||
$PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_PW);
|
||||
$group = preg_replace('/[^-_0-9\p{L}]/u', '', $group);
|
||||
}
|
||||
|
||||
$stmt="SELECT selected_language from vicidial_users where user='$PHP_AUTH_USER';";
|
||||
@@ -195,13 +207,6 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||
}
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$STARTtime = date("U");
|
||||
if (!isset($group)) {$group = array();}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($server_ip)) {$server_ip = '10.10.10.15';}
|
||||
|
||||
$stmt="select distinct(serial_id) from vicidial_process_log order by run_time desc limit 10000;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
|
||||
Reference in New Issue
Block a user