LICENSE: AGPLv2 # # this screen will control the campaign settings needed for alternate number # dialing using multiple leads with the same account number and different phone # numbers. the leads will use different owner values and this script will alter # the ranks for those leads as well as alter the special campaign filter and # change some campaign settings. # # changes: # 110317-1219 - First Build # 110406-1818 - Updated logging # 120223-2335 - Removed logging of good login passwords if webroot writable is enabled # 130610-1116 - Finalized changing of all ereg instances to preg # 130621-2009 - Added filtering of input to prevent SQL injection attacks and new user auth # 130902-0755 - Changed to mysqli PHP functions # 141001-2200 - Finalized adding QXZ translation to all admin files # 141230-0024 - Added code for on-the-fly language translations display # 150728-1046 - Added option for secondary sorting by vendor_lead_code, Issue #833 # 170409-1535 - Added IP List validation code # 180329-1344 - Added screen colors # $admin_version = '2.14-11'; $build = '180329-1344'; require("dbconnect_mysqli.php"); require("functions.php"); $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; $PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF); if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["action"])) {$action=$_GET["action"];} elseif (isset($_POST["action"])) {$action=$_POST["action"];} if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} if (isset($_GET["lead_order_randomize"])) {$lead_order_randomize=$_GET["lead_order_randomize"];} elseif (isset($_POST["lead_order_randomize"])) {$lead_order_randomize=$_POST["lead_order_randomize"];} if (isset($_GET["lead_order_secondary"])) {$lead_order_secondary=$_GET["lead_order_secondary"];} elseif (isset($_POST["lead_order_secondary"])) {$lead_order_secondary=$_POST["lead_order_secondary"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} if (strlen($action) < 2) {$action = 'BLANK';} if (strlen($DB) < 1) {$DB=0;} $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,webroot_writable,enable_languages,language_method FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $ss_conf_ct = mysqli_num_rows($rslt); if ($ss_conf_ct > 0) { $row=mysqli_fetch_row($rslt); $non_latin = $row[0]; $webroot_writable = $row[1]; $SSenable_languages = $row[2]; $SSlanguage_method = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### 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); $campaign_id = preg_replace('/[^-_0-9a-zA-Z]/','',$campaign_id); $lead_order_randomize = preg_replace('/[^-_0-9a-zA-Z]/','',$lead_order_randomize); $lead_order_secondary = preg_replace('/[^-_0-9a-zA-Z]/','',$lead_order_secondary); } # end of non_latin else { $PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER); $PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW); } $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); $user = $PHP_AUTH_USER; $stmt="SELECT selected_language from vicidial_users where user='$PHP_AUTH_USER';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $sl_ct = mysqli_num_rows($rslt); if ($sl_ct > 0) { $row=mysqli_fetch_row($rslt); $VUselected_language = $row[0]; } $auth=0; $auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ( ($auth_message == 'GOOD') or ($auth_message == '2FA') ) { $auth=1; if ($auth_message == '2FA') { header ("Content-type: text/html; charset=utf-8"); echo _QXZ("Your session is expired").". "._QXZ("Click here to log in").".\n"; exit; } } if ($auth < 1) { $VDdisplayMESSAGE = _QXZ("Login incorrect, please try again"); if ($auth_message == 'LOCK') { $VDdisplayMESSAGE = _QXZ("Too many login attempts, try again in 15 minutes"); Header ("Content-type: text/html; charset=utf-8"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; exit; } if ($auth_message == 'IPBLOCK') { $VDdisplayMESSAGE = _QXZ("Your IP Address is not allowed") . ": $ip"; Header ("Content-type: text/html; charset=utf-8"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; exit; } Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\""); Header("HTTP/1.0 401 Unauthorized"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$PHP_AUTH_PW|$auth_message|\n"; exit; } $stmt="SELECT full_name,modify_campaigns,user_level from vicidial_users where user='$PHP_AUTH_USER';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $LOGfullname = $row[0]; $LOGmodify_campaigns = $row[1]; $LOGuser_level = $row[2]; if ($LOGmodify_campaigns < 1) { Header ("Content-type: text/html; charset=utf-8"); echo _QXZ("You do not have permissions to modify campaigns")."\n"; exit; } $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$campaign_id' and auto_alt_dial='MULTI_LEAD';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $camp_multi=$row[0]; ?>
| \n";
echo "";
echo " "._QXZ("Multi-Lead Auto Alt Dialing Settings Form")." |