From 784c71bd4a6e66408021770b050b681db0332879 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 10 Apr 2017 02:30:33 +0000 Subject: [PATCH] Added IP Lists feature, allowing creating of lists of IP Addresses that can be used as whitelists on a User Group basis for Agent, Admin and API web resources. git-svn-id: svn://192.168.202.10@2726 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/UPGRADE | 4 + .../trunk/extras/MySQL_AST_CREATE_tables.sql | 29 +- agc_2-X/trunk/extras/upgrade_2.14.sql | 26 + agc_2-X/trunk/www/agc/functions.php | 81 ++- agc_2-X/trunk/www/agc/ip.php | 9 + agc_2-X/trunk/www/agc/phone_only.php | 9 +- agc_2-X/trunk/www/agc/vicidial.php | 7 +- .../trunk/www/vicidial/AST_API_log_report.php | 10 +- .../www/vicidial/AST_CLOSER_service_level.php | 10 +- .../trunk/www/vicidial/AST_CLOSERstats.php | 10 +- .../trunk/www/vicidial/AST_CLOSERstats_v2.php | 10 +- .../www/vicidial/AST_CLOSERsummary_hourly.php | 10 +- agc_2-X/trunk/www/vicidial/AST_DIDstats.php | 10 +- .../www/vicidial/AST_GROUP_ALIASstats.php | 12 +- agc_2-X/trunk/www/vicidial/AST_IVRfilter.php | 12 +- agc_2-X/trunk/www/vicidial/AST_IVRstats.php | 10 +- .../www/vicidial/AST_LAGGED_log_report.php | 12 +- .../www/vicidial/AST_LISTS_campaign_stats.php | 10 +- .../www/vicidial/AST_LISTS_pass_report.php | 10 +- .../trunk/www/vicidial/AST_LISTS_stats.php | 12 +- .../www/vicidial/AST_LIST_UPDATEstats.php | 12 +- .../vicidial/AST_OUTBOUNDsummary_interval.php | 10 +- agc_2-X/trunk/www/vicidial/AST_VDADstats.php | 10 +- .../www/vicidial/AST_VICIDIAL_hopperlist.php | 12 +- .../www/vicidial/AST_VICIDIAL_ingrouplist.php | 12 +- .../www/vicidial/AST_admin_template_maker.php | 12 +- .../trunk/www/vicidial/AST_agentDIDstats.php | 12 +- .../www/vicidial/AST_agent_days_detail.php | 12 +- .../www/vicidial/AST_agent_days_time.php | 12 +- .../vicidial/AST_agent_debug_log_report.php | 12 +- .../www/vicidial/AST_agent_disposition.php | 12 +- .../www/vicidial/AST_agent_performance.php | 12 +- .../vicidial/AST_agent_performance_detail.php | 12 +- .../AST_agent_performance_detail_SALES.php | 12 +- .../www/vicidial/AST_agent_status_detail.php | 12 +- .../www/vicidial/AST_agent_time_detail.php | 12 +- .../www/vicidial/AST_agent_time_sheet.php | 12 +- .../vicidial/AST_agent_time_sheet_archive.php | 12 +- .../vicidial/AST_agent_timeclock_detail.php | 10 +- .../AST_campaign_status_list_report.php | 10 +- .../www/vicidial/AST_carrier_log_report.php | 12 +- .../www/vicidial/AST_chat_log_report.php | 14 +- .../www/vicidial/AST_dial_log_report.php | 12 +- .../vicidial/AST_dialer_inventory_report.php | 12 +- .../www/vicidial/AST_email_log_display.php | 12 +- .../www/vicidial/AST_email_log_report.php | 16 +- .../www/vicidial/AST_hangup_cause_report.php | 12 +- .../www/vicidial/AST_inboundEXTstats.php | 12 +- .../AST_inboundEXTstats_department.php | 12 +- .../www/vicidial/AST_inbound_daily_report.php | 10 +- agc_2-X/trunk/www/vicidial/AST_parkstats.php | 12 +- .../AST_performance_comparison_report.php | 12 +- .../www/vicidial/AST_recording_log_report.php | 12 +- .../www/vicidial/AST_server_performance.php | 12 +- .../vicidial/AST_team_performance_detail.php | 12 +- agc_2-X/trunk/www/vicidial/AST_timeonVDAD.php | 12 +- .../trunk/www/vicidial/AST_timeonVDADall.php | 14 +- .../www/vicidial/AST_timeonVDADallREC.php | 12 +- .../www/vicidial/AST_timeonVDADallSUMMARY.php | 12 +- .../trunk/www/vicidial/AST_url_log_report.php | 12 +- .../vicidial/AST_user_group_hourly_detail.php | 55 +- .../vicidial/AST_usergroup_login_report.php | 12 +- .../vicidial/AST_vdad_debug_log_report.php | 12 +- .../www/vicidial/AST_webserver_url_report.php | 12 +- .../www/vicidial/NANPA_running_processes.php | 16 +- agc_2-X/trunk/www/vicidial/admin.php | 686 ++++++++++++++++-- .../www/vicidial/admin_NANPA_updater.php | 16 +- .../trunk/www/vicidial/admin_amm_multi.php | 16 +- .../trunk/www/vicidial/admin_bulk_tools.php | 17 +- .../www/vicidial/admin_campaign_multi_alt.php | 16 +- .../www/vicidial/admin_email_accounts.php | 16 +- agc_2-X/trunk/www/vicidial/admin_header.php | 19 +- .../trunk/www/vicidial/admin_languages.php | 16 +- .../www/vicidial/admin_launch_trigger.php | 16 +- .../vicidial/admin_listloader_fourth_gen.php | 14 +- .../vicidial/admin_listloader_third_gen.php | 16 +- .../trunk/www/vicidial/admin_lists_custom.php | 14 +- .../trunk/www/vicidial/admin_modify_lead.php | 10 +- .../www/vicidial/admin_phones_bulk_insert.php | 16 +- .../trunk/www/vicidial/admin_search_lead.php | 14 +- .../trunk/www/vicidial/admin_soundboard.php | 16 +- .../trunk/www/vicidial/admin_url_multi.php | 16 +- .../www/vicidial/admin_user_list_new.php | 16 +- agc_2-X/trunk/www/vicidial/asterisk_debug.php | 12 +- agc_2-X/trunk/www/vicidial/audio_store.php | 14 +- .../trunk/www/vicidial/call_report_export.php | 12 +- .../vicidial/call_report_export_carrier.php | 12 +- .../www/vicidial/callbacks_bulk_change.php | 12 +- .../www/vicidial/callbacks_bulk_move.php | 12 +- agc_2-X/trunk/www/vicidial/callcard_admin.php | 16 +- .../www/vicidial/callcard_report_export.php | 12 +- .../called_counts_multilist_report.php | 12 +- agc_2-X/trunk/www/vicidial/campaign_debug.php | 12 +- .../www/vicidial/closer-fronter_popup.php | 12 +- .../www/vicidial/closer-fronter_popup2.php | 12 +- agc_2-X/trunk/www/vicidial/closer.php | 12 +- agc_2-X/trunk/www/vicidial/closer_dispo.php | 12 +- agc_2-X/trunk/www/vicidial/closer_popup.php | 12 +- agc_2-X/trunk/www/vicidial/fcstats.php | 10 +- agc_2-X/trunk/www/vicidial/fcstats_detail.php | 18 +- agc_2-X/trunk/www/vicidial/functions.php | 86 ++- .../trunk/www/vicidial/group_hourly_stats.php | 12 +- agc_2-X/trunk/www/vicidial/help.php | 72 ++ .../www/vicidial/images/icon_iplists.png | Bin 0 -> 1018 bytes .../trunk/www/vicidial/lead_report_export.php | 12 +- agc_2-X/trunk/www/vicidial/lead_tools.php | 16 +- .../www/vicidial/lead_tools_advanced.php | 14 +- .../vicidial/leadloader_template_display.php | 14 +- agc_2-X/trunk/www/vicidial/list_download.php | 10 +- agc_2-X/trunk/www/vicidial/list_merge.php | 23 +- agc_2-X/trunk/www/vicidial/list_split.php | 16 +- .../www/vicidial/manager_chat_actions.php | 18 +- .../www/vicidial/manager_chat_interface.php | 16 +- .../vicidial/medialog_inventory_report.php | 12 +- agc_2-X/trunk/www/vicidial/nanpa_type.php | 16 +- agc_2-X/trunk/www/vicidial/non_agent_api.php | 14 +- agc_2-X/trunk/www/vicidial/phone_stats.php | 12 +- agc_2-X/trunk/www/vicidial/qc_api.php | 2 +- .../www/vicidial/qc_call_client_iframe.php | 12 +- agc_2-X/trunk/www/vicidial/qc_modify_lead.php | 14 +- .../trunk/www/vicidial/realtime_report.php | 14 +- .../trunk/www/vicidial/record_conf_1_hour.php | 12 +- .../www/vicidial/recording_log_redirect.php | 12 +- agc_2-X/trunk/www/vicidial/remote_dispo.php | 2 +- .../www/vicidial/reset_campaign_lists.php | 16 +- agc_2-X/trunk/www/vicidial/send_CID_call.php | 12 +- agc_2-X/trunk/www/vicidial/sph_report.php | 12 +- agc_2-X/trunk/www/vicidial/timeclock_edit.php | 12 +- .../trunk/www/vicidial/timeclock_report.php | 10 +- .../trunk/www/vicidial/timeclock_status.php | 12 +- .../www/vicidial/user_group_bulk_change.php | 10 +- agc_2-X/trunk/www/vicidial/user_stats.php | 10 +- agc_2-X/trunk/www/vicidial/user_status.php | 10 +- .../trunk/www/vicidial/user_territories.php | 2 +- agc_2-X/trunk/www/vicidial/vdremote.php | 2 +- .../vicidial_custom_reports_admin.php | 20 +- .../www/vicidial/vicidial_sales_viewer.php | 2 +- agc_2-X/trunk/www/vicidial/voice_lab.php | 7 +- 138 files changed, 2233 insertions(+), 387 deletions(-) create mode 100644 agc_2-X/trunk/www/agc/ip.php create mode 100644 agc_2-X/trunk/www/vicidial/images/icon_iplists.png diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 21049678..b98dc209 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -136,6 +136,10 @@ OTHER CHANGES: 26. Added USER_CUSTOM_ options to campaign custom callerID setting to allow for custom caller IDs to be used per agent in MANUAL and INBOUND_MAN modes +27. Added IP Lists feature, allowing creating of lists of IP Addresses that can + be used as whitelists on a User Group basis for Agent, Admin and API + web resources. + diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index 238e5bdf..a9b5f6e5 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -657,7 +657,9 @@ modify_colors ENUM('1','0') default '0', user_nickname VARCHAR(50) default '', user_new_lead_limit SMALLINT(5) default '-1', api_only_user ENUM('0','1') default '0', -modify_auto_reports ENUM('1','0') default '0' +modify_auto_reports ENUM('1','0') default '0', +modify_ip_lists ENUM('1','0') default '0', +ignore_ip_list ENUM('1','0') default '0' ) ENGINE=MyISAM; CREATE UNIQUE INDEX user ON vicidial_users (user); @@ -715,7 +717,10 @@ admin_viewable_groups TEXT, admin_viewable_call_times TEXT, allowed_custom_reports VARCHAR(2000) default '', agent_allowed_chat_groups TEXT, -agent_xfer_park_3way ENUM('Y','N') default 'Y' +agent_xfer_park_3way ENUM('Y','N') default 'Y', +admin_ip_list VARCHAR(30) default '', +agent_ip_list VARCHAR(30) default '', +api_ip_list VARCHAR(30) default '' ) ENGINE=MyISAM; CREATE TABLE vicidial_campaigns ( @@ -1699,7 +1704,9 @@ vdad_debug_logging ENUM('1','0') default '0', agent_chat_screen_colors VARCHAR(20) default 'default', enable_auto_reports ENUM('1','0') default '0', enable_pause_code_limits ENUM('1','0') default '0', -enable_drop_lists ENUM('0','1','2') default '0' +enable_drop_lists ENUM('0','1','2') default '0', +allow_ip_lists ENUM('0','1','2') default '0', +system_ip_blacklist VARCHAR(30) default '' ) ENGINE=MyISAM; CREATE TABLE vicidial_campaigns_list_mix ( @@ -3678,6 +3685,20 @@ index(drop_date), index(drop_processed) ) ENGINE=MyISAM; +CREATE TABLE vicidial_ip_lists ( +ip_list_id VARCHAR(30) UNIQUE NOT NULL, +ip_list_name VARCHAR(100), +active ENUM('N','Y') default 'N', +user_group VARCHAR(20) default '---ALL---' +) ENGINE=MyISAM; + +CREATE TABLE vicidial_ip_list_entries ( +ip_list_id VARCHAR(30) NOT NULL, +ip_address VARCHAR(45) NOT NULL, +index(ip_list_id), +index(ip_address) +) ENGINE=MyISAM; + ALTER TABLE vicidial_email_list MODIFY message text character set utf8; @@ -3940,4 +3961,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version'; UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1498',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1499',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/agc_2-X/trunk/extras/upgrade_2.14.sql b/agc_2-X/trunk/extras/upgrade_2.14.sql index ebca4d5c..dfd188f2 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -174,3 +174,29 @@ UPDATE system_settings SET db_schema_version='1497',db_schema_update_date=NOW() ALTER TABLE vicidial_campaigns MODIFY use_custom_cid ENUM('Y','N','AREACODE','USER_CUSTOM_1','USER_CUSTOM_2','USER_CUSTOM_3','USER_CUSTOM_4','USER_CUSTOM_5') default 'N'; UPDATE system_settings SET db_schema_version='1498',db_schema_update_date=NOW() where db_schema_version < 1498; + +ALTER TABLE system_settings ADD allow_ip_lists ENUM('0','1','2') default '0'; +ALTER TABLE system_settings ADD system_ip_blacklist VARCHAR(30) default ''; + +ALTER TABLE vicidial_users ADD modify_ip_lists ENUM('1','0') default '0'; +ALTER TABLE vicidial_users ADD ignore_ip_list ENUM('1','0') default '0'; + +ALTER TABLE vicidial_user_groups ADD admin_ip_list VARCHAR(30) default ''; +ALTER TABLE vicidial_user_groups ADD agent_ip_list VARCHAR(30) default ''; +ALTER TABLE vicidial_user_groups ADD api_ip_list VARCHAR(30) default ''; + +CREATE TABLE vicidial_ip_lists ( +ip_list_id VARCHAR(30) UNIQUE NOT NULL, +ip_list_name VARCHAR(100), +active ENUM('N','Y') default 'N', +user_group VARCHAR(20) default '---ALL---' +) ENGINE=MyISAM; + +CREATE TABLE vicidial_ip_list_entries ( +ip_list_id VARCHAR(30) NOT NULL, +ip_address VARCHAR(45) NOT NULL, +index(ip_list_id), +index(ip_address) +) ENGINE=MyISAM; + +UPDATE system_settings SET db_schema_version='1499',db_schema_update_date=NOW() where db_schema_version < 1499; diff --git a/agc_2-X/trunk/www/agc/functions.php b/agc_2-X/trunk/www/agc/functions.php index c5fb3737..5e693fb6 100644 --- a/agc_2-X/trunk/www/agc/functions.php +++ b/agc_2-X/trunk/www/agc/functions.php @@ -37,9 +37,10 @@ # 170309-0857 - Added list_name and list_description display variables # 170317-0753 - Added more missing display variables # 170330-1152 - Added did_carrier_description display option +# 170409-1004 - Added IP List features to user_authorization # -# $mysql_queries = 22 +# $mysql_queries = 26 ##### BEGIN validate user login credentials, check for failed lock out ##### function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$return_hash,$api_call) @@ -48,7 +49,7 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### - $stmt = "SELECT use_non_latin,webroot_writable,pass_hash_enabled,pass_key,pass_cost,hosted_settings FROM system_settings;"; + $stmt = "SELECT use_non_latin,webroot_writable,pass_hash_enabled,pass_key,pass_cost,hosted_settings,allow_ip_lists,system_ip_blacklist FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); @@ -61,6 +62,8 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur $SSpass_key = $row[3]; $SSpass_cost = $row[4]; $SShosted_settings = $row[5]; + $SSallow_ip_lists = $row[6]; + $SSsystem_ip_blacklist = $row[7]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -215,6 +218,80 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur $login_problem++; } + ##### BEGIN IP LIST FEATURES ##### + if ($SSallow_ip_lists > 0) + { + $ignore_ip_list=0; + $whitelist_match=1; + $blacklist_match=0; + $stmt="SELECT user_group,ignore_ip_list from vicidial_users where user='$user';"; + if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05023',$user,$server_ip,$session_name,$one_mysql_log);} + $iipl_user_ct = mysqli_num_rows($rslt); + if ($iipl_user_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $user_group = $row[0]; + $ignore_ip_list = $row[1]; + } + if ($ignore_ip_list < 1) + { + $ip_class_c = preg_replace('~\.\d+(?!.*\.\d+)~', '.x', $ip); + + if (strlen($SSsystem_ip_blacklist) > 1) + { + $blacklist_match=1; + $stmt="SELECT count(*) from vicidial_ip_list_entries where ip_list_id='$SSsystem_ip_blacklist' and ip_address IN('$ip','$ip_class_c');"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05024',$user,$server_ip,$session_name,$one_mysql_log);} + $vile_ct = mysqli_num_rows($rslt); + if ($vile_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $blacklist_match = $row[0]; + } + } + + $stmt="SELECT agent_ip_list,api_ip_list from vicidial_user_groups where user_group='$user_group';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05025',$user,$server_ip,$session_name,$one_mysql_log);} + $iipl_user_ct = mysqli_num_rows($rslt); + if ($iipl_user_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $agent_ip_list = $row[0]; + $api_ip_list = $row[1]; + + if ($api_call != '1') + {$check_ip_list = $agent_ip_list;} + else + {$check_ip_list = $api_ip_list;} + + if (strlen($check_ip_list) > 1) + { + $whitelist_match=0; + $stmt="SELECT count(*) from vicidial_ip_list_entries where ip_list_id='$check_ip_list' and ip_address IN('$ip','$ip_class_c');"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05026',$user,$server_ip,$session_name,$one_mysql_log);} + $vile_ct = mysqli_num_rows($rslt); + if ($vile_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $whitelist_match = $row[0]; + } + } + } + } + + if ( ($whitelist_match < 1) or ($blacklist_match > 0) ) + { + $auth_key='IPBLOCK'; + $login_problem++; + } + } + ##### END IP LIST FEATURES ##### + if ($login_problem < 1) { if ($user_update > 0) diff --git a/agc_2-X/trunk/www/agc/ip.php b/agc_2-X/trunk/www/agc/ip.php new file mode 100644 index 00000000..6b487eb9 --- /dev/null +++ b/agc_2-X/trunk/www/agc/ip.php @@ -0,0 +1,9 @@ +\n"; +#echo "Your IP Address class C: $ip_class_c\n"; + +?> \ No newline at end of file diff --git a/agc_2-X/trunk/www/agc/phone_only.php b/agc_2-X/trunk/www/agc/phone_only.php index fc510386..a1738c0d 100644 --- a/agc_2-X/trunk/www/agc/phone_only.php +++ b/agc_2-X/trunk/www/agc/phone_only.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGELOG # 110511-1336 - First Build @@ -15,10 +15,11 @@ # 140810-2113 - Changed to use QXZ function for echoing text # 141118-1238 - Formatting changes for QXZ output # 141216-2127 - Added language settings lookups and user/pass variable standardization +# 170409-1600 - Added IP List validation code # -$version = '2.10-11p'; -$build = '141216-2127'; +$version = '2.14-12p'; +$build = '170409-1600'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=74; $one_mysql_log=0; @@ -408,6 +409,8 @@ else $VDdisplayMESSAGE = "Login incorrect, please try again
"; if ($auth_message == 'LOCK') {$VDdisplayMESSAGE = "Too many login attempts, try again in 15 minutes
";} + if ($auth_message == 'IPBLOCK') + {$VDdisplayMESSAGE = _QXZ("Your IP Address is not allowed").": $ip
";} } } if ($VDloginDISPLAY) diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index afe98b4d..ff32c7c9 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -547,10 +547,11 @@ # 170309-1215 - Added agent_xfer_validation option # 170317-2342 - Fix for script tab ignore list script override # 170331-2255 - Assure that custom field form submitted after standard field submit +# 170409-1601 - Added IP List validation code # -$version = '2.14-517c'; -$build = '170331-2255'; +$version = '2.14-518c'; +$build = '170409-1601'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=87; $one_mysql_log=0; @@ -2435,6 +2436,8 @@ else {$VDdisplayMESSAGE = _QXZ("Too many agents logged in, please contact your administrator")."
";} if ($auth_message == 'ERRCASE') {$VDdisplayMESSAGE = _QXZ("Login incorrect, user names are case sensitive")."
";} + if ($auth_message == 'IPBLOCK') + {$VDdisplayMESSAGE = _QXZ("Your IP Address is not allowed").": $ip
";} } } if ($VDloginDISPLAY) diff --git a/agc_2-X/trunk/www/vicidial/AST_API_log_report.php b/agc_2-X/trunk/www/vicidial/AST_API_log_report.php index fb276377..a317ae0f 100644 --- a/agc_2-X/trunk/www/vicidial/AST_API_log_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_API_log_report.php @@ -10,6 +10,7 @@ # 160305-0842 - First build # 170209-1237 - Added URL and IP display # 170210-0700 - Reworked Show URLs code to be faster +# 170409-1553 - Added IP List validation code # $startMS = microtime(); @@ -140,7 +141,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -181,6 +182,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_CLOSER_service_level.php b/agc_2-X/trunk/www/vicidial/AST_CLOSER_service_level.php index b1ea0384..7d6588c6 100644 --- a/agc_2-X/trunk/www/vicidial/AST_CLOSER_service_level.php +++ b/agc_2-X/trunk/www/vicidial/AST_CLOSER_service_level.php @@ -36,6 +36,7 @@ # 160819-0054 - Fixed chart bugs caused by DST # 170227-1714 - Fix for default HTML report format, issue #997 # 170323-2247 - Added debug variable +# 170409-1559 - Added IP List validation code # $startMS = microtime(); @@ -135,7 +136,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -176,6 +177,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php b/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php index b2c5b0e7..db9819a5 100644 --- a/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php @@ -56,6 +56,7 @@ # 160819-0054 - Fixed chart bugs # 170227-1715 - Fix for default HTML report format, issue #997 # 170324-0740 - Fix for daylight savings time issue +# 170409-1559 - Added IP List validation code # $startMS = microtime(); @@ -182,7 +183,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -223,6 +224,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_CLOSERstats_v2.php b/agc_2-X/trunk/www/vicidial/AST_CLOSERstats_v2.php index 7f563088..898cfc70 100644 --- a/agc_2-X/trunk/www/vicidial/AST_CLOSERstats_v2.php +++ b/agc_2-X/trunk/www/vicidial/AST_CLOSERstats_v2.php @@ -60,6 +60,7 @@ # 161207-2037 - Fix for issue #982, formatting # 170227-1708 - Fix for default HTML report format, issue #997 # 170324-0741 - Fix for daylight savings time issue +# 170409-1559 - Added IP List validation code # $startMS = microtime(); @@ -187,7 +188,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -228,6 +229,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_CLOSERsummary_hourly.php b/agc_2-X/trunk/www/vicidial/AST_CLOSERsummary_hourly.php index 524dac24..966cae72 100644 --- a/agc_2-X/trunk/www/vicidial/AST_CLOSERsummary_hourly.php +++ b/agc_2-X/trunk/www/vicidial/AST_CLOSERsummary_hourly.php @@ -28,6 +28,7 @@ # 160227-1151 - Uniform form format # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 170227-1713 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -152,7 +153,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -193,6 +194,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_DIDstats.php b/agc_2-X/trunk/www/vicidial/AST_DIDstats.php index 37b202b3..37271a55 100644 --- a/agc_2-X/trunk/www/vicidial/AST_DIDstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_DIDstats.php @@ -32,6 +32,7 @@ # 160819-0054 - Fixed bug causing TEXT report to repeat data # 170217-2115 - Added time entry option for date ranges # 170227-1717 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -133,7 +134,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -174,6 +175,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_GROUP_ALIASstats.php b/agc_2-X/trunk/www/vicidial/AST_GROUP_ALIASstats.php index ab51c37b..436555d1 100644 --- a/agc_2-X/trunk/www/vicidial/AST_GROUP_ALIASstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_GROUP_ALIASstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # If you are going to run this report I would recommend adding the following in MySQL: # CREATE INDEX extension on call_log (extension); @@ -16,6 +16,7 @@ # 140108-0740 - Added webserver and hostname to report logging # 141114-0842 - Finalized adding QXZ translation to all admin files # 141230-1502 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # $startMS = microtime(); @@ -81,7 +82,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -122,6 +123,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_IVRfilter.php b/agc_2-X/trunk/www/vicidial/AST_IVRfilter.php index 5437a1b5..9c1c7ec6 100644 --- a/agc_2-X/trunk/www/vicidial/AST_IVRfilter.php +++ b/agc_2-X/trunk/www/vicidial/AST_IVRfilter.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -19,6 +19,7 @@ # 141114-0833 - Finalized adding QXZ translation to all admin files # 141230-1449 - Added code for on-the-fly language translations display # 160227-1931 - Uniform form format +# 170409-1538 - Added IP List validation code # $startMS = microtime(); @@ -113,7 +114,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -154,6 +155,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_IVRstats.php b/agc_2-X/trunk/www/vicidial/AST_IVRstats.php index 02e314a4..39a0b4ed 100644 --- a/agc_2-X/trunk/www/vicidial/AST_IVRstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_IVRstats.php @@ -36,6 +36,7 @@ # 160227-1130 - Uniform form format # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 170227-1712 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -147,7 +148,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -188,6 +189,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_LAGGED_log_report.php b/agc_2-X/trunk/www/vicidial/AST_LAGGED_log_report.php index c65b9b99..d7dad448 100644 --- a/agc_2-X/trunk/www/vicidial/AST_LAGGED_log_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_LAGGED_log_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # CHANGES # 130622-1026 - First build @@ -9,6 +9,7 @@ # 140108-0736 - Added webserver and hostname to report logging # 141114-0832 - Finalized adding QXZ translation to all admin files # 141230-1446 - Added code for on-the-fly language translations display +# 170409-1536 - Added IP List validation code # $startMS = microtime(); @@ -95,7 +96,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -136,6 +137,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_LISTS_campaign_stats.php b/agc_2-X/trunk/www/vicidial/AST_LISTS_campaign_stats.php index 99a115b8..222e88b1 100644 --- a/agc_2-X/trunk/www/vicidial/AST_LISTS_campaign_stats.php +++ b/agc_2-X/trunk/www/vicidial/AST_LISTS_campaign_stats.php @@ -27,6 +27,7 @@ # 160227-1043 - Uniform form format # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 170227-1719 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -125,7 +126,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -166,6 +167,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_LISTS_pass_report.php b/agc_2-X/trunk/www/vicidial/AST_LISTS_pass_report.php index 3236a282..9c19027e 100644 --- a/agc_2-X/trunk/www/vicidial/AST_LISTS_pass_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_LISTS_pass_report.php @@ -17,6 +17,7 @@ # 160227-1138 - Uniform form format # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 170227-1711 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -118,7 +119,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -159,6 +160,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_LISTS_stats.php b/agc_2-X/trunk/www/vicidial/AST_LISTS_stats.php index 58ab16dd..79fbdae7 100644 --- a/agc_2-X/trunk/www/vicidial/AST_LISTS_stats.php +++ b/agc_2-X/trunk/www/vicidial/AST_LISTS_stats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # This is a list inventory report, not a calling report. This report will show # statistics for all of the lists in the selected campaigns @@ -15,6 +15,7 @@ # 141230-1442 - Added code for on-the-fly language translations display # 150516-1304 - Fixed Javascript element problem, Issue #857 # 160227-1026 - Fixed dbconnect bug, standardized form layout +# 170409-1539 - Added IP List validation code # $startMS = microtime(); @@ -96,7 +97,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -137,6 +138,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_LIST_UPDATEstats.php b/agc_2-X/trunk/www/vicidial/AST_LIST_UPDATEstats.php index b01b085e..d787e934 100644 --- a/agc_2-X/trunk/www/vicidial/AST_LIST_UPDATEstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_LIST_UPDATEstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -17,6 +17,7 @@ # 140108-0735 - Added webserver and hostname to report logging # 141114-0830 - Finalized adding QXZ translation to all admin files # 141230-1445 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # $startMS = microtime(); @@ -86,7 +87,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -127,6 +128,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php b/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php index f9218003..034915ba 100644 --- a/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php +++ b/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php @@ -29,6 +29,7 @@ # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 170220-2040 - Fixed bug causing sale/dncs to be counted multiple times when dispos repeated between campaigns # 170227-1709 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -166,7 +167,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -207,6 +208,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_VDADstats.php b/agc_2-X/trunk/www/vicidial/AST_VDADstats.php index dacf0e8d..673c4441 100644 --- a/agc_2-X/trunk/www/vicidial/AST_VDADstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_VDADstats.php @@ -50,6 +50,7 @@ # 160515-1412 - Added UK OFCOM feature # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 170227-1716 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -203,7 +204,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -244,6 +245,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php b/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php index 1983c661..39ce9142 100644 --- a/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php +++ b/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -24,6 +24,7 @@ # 141114-0700 - Finalized adding QXZ translation to all admin files # 141230-0048 - Added code for on-the-fly language translations display # 161026-0931 - Added links to leads and lists, added phone code, age, last call columns +# 170409-1544 - Added IP List validation code # $startMS = microtime(); @@ -86,7 +87,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -127,6 +128,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_ingrouplist.php b/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_ingrouplist.php index ba6cf049..33f5b8c5 100644 --- a/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_ingrouplist.php +++ b/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_ingrouplist.php @@ -3,7 +3,7 @@ # # shows the agents logged into vicidial and set to take calls from in-group # -# Copyright (C) 2014 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # 100320-2102 - First Build @@ -14,6 +14,7 @@ # 140108-0728 - Added webserver and hostname to report logging # 141114-0658 - Finalized adding QXZ translation to all admin files # 141230-0045 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # $startMS = microtime(); @@ -76,7 +77,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -117,6 +118,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_admin_template_maker.php b/agc_2-X/trunk/www/vicidial/AST_admin_template_maker.php index f49bc0fc..1b946aef 100644 --- a/agc_2-X/trunk/www/vicidial/AST_admin_template_maker.php +++ b/agc_2-X/trunk/www/vicidial/AST_admin_template_maker.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell,Joe Johnson LICENSE: AGPLv2 # # CHANGES # 120402-2132 - First Build @@ -13,6 +13,7 @@ # 130824-2325 - Changed to mysqli PHP functions # 141114-0912 - Finalized adding QXZ translation to all admin files # 141229-2024 - Added code for on-the-fly language translations display +# 170409-1532 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -110,7 +111,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -124,6 +125,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agentDIDstats.php b/agc_2-X/trunk/www/vicidial/AST_agentDIDstats.php index 8783b4db..41493544 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agentDIDstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_agentDIDstats.php @@ -1,11 +1,12 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 161207-1952 - First build +# 170409-1550 - Added IP List validation code # $startMS = microtime(); @@ -104,7 +105,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -145,6 +146,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_days_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_days_detail.php index 4f8ae8be..07b195f6 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_days_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_days_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -30,6 +30,7 @@ # 160121-2216 - Added report title header, default report format, cleaned up formatting # 160225-1625 - Fixed download issue where report was not printing properly # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs +# 170409-1542 - Added IP List validation code # $startMS = microtime(); @@ -137,7 +138,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -178,6 +179,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_days_time.php b/agc_2-X/trunk/www/vicidial/AST_agent_days_time.php index e8d682d6..a792cb45 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_days_time.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_days_time.php @@ -1,13 +1,14 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 150114-2158 - First build based on AST_agent_days_detail.php # 151227-1718 - Added option to search archive records instead of main # 160121-2217 - Added report title header, default report format, cleaned up formatting +# 170409-1538 - Added IP List validation code # $startMS = microtime(); @@ -115,7 +116,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -156,6 +157,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_debug_log_report.php b/agc_2-X/trunk/www/vicidial/AST_agent_debug_log_report.php index 55972d8d..48937a54 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_debug_log_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_debug_log_report.php @@ -1,11 +1,12 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # CHANGES # 150724-0740 - First build # 150727-2111 - Added different colors for higher run times, added user variable, code cleanup +# 170409-1547 - Added IP List validation code # $startMS = microtime(); @@ -86,7 +87,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -127,6 +128,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_disposition.php b/agc_2-X/trunk/www/vicidial/AST_agent_disposition.php index 389489cd..b7f8570e 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_disposition.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_disposition.php @@ -3,7 +3,7 @@ # # Date Range - Agent/Campaign Disposition (Perfect Network Corporation) # -# Copyright (C) 2014 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,7 @@ # 130902-0746 - Changed to mysqli PHP functions # 141114-0911 - Finalized adding QXZ translation to all admin files # 141230-1525 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -74,7 +75,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -115,6 +116,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_performance.php b/agc_2-X/trunk/www/vicidial/AST_agent_performance.php index cdb1016b..ada970af 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_performance.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_performance.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -15,6 +15,7 @@ # 130901-0828 - Changed to mysqli PHP functions # 141114-0909 - Finalized adding QXZ translation to all admin files # 141230-1524 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -75,7 +76,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -116,6 +117,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php index e0610c84..74e6803a 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -58,6 +58,7 @@ # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 161013-2142 - Added option to display live agents only # 161110-1830 - Fixed display issue for total averages +# 170409-1547 - Added IP List validation code # $startMS = microtime(); @@ -176,7 +177,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -217,6 +218,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail_SALES.php b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail_SALES.php index b82b46f4..33b31086 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail_SALES.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail_SALES.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -40,6 +40,7 @@ # 131010-1930 - Expanded user group column, added most recent user group # 140108-0712 - Added webserver and hostname to report logging # 150516-1309 - Fixed Javascript element problem, Issue #857 +# 170409-1535 - Added IP List validation code # $startMS = microtime(); @@ -114,7 +115,7 @@ else $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -155,6 +156,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php index 455d6f0f..f98266b1 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -33,6 +33,7 @@ # 160310-2115 - Fixed bug in HTML display # 160330-0648 - Fixed issue with names and non-latin setting # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs +# 170409-1556 - Added IP List validation code # $startMS = microtime(); @@ -112,7 +113,7 @@ else $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -153,6 +154,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php index f4e4e23c..cd5eb141 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php @@ -4,7 +4,7 @@ # Pulls time stats per agent selectable by campaign or user group # should be most accurate agent stats of all of the reports # -# Copyright (C) 2016 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # 90522-0723 - First build @@ -50,6 +50,7 @@ # 160330-0649 - Fixed issue with names and non-latin setting # 160411-1958 - Fixed issue with download field order # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs +# 170409-1542 - Added IP List validation code # $startMS = microtime(); @@ -192,7 +193,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -233,6 +234,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet.php b/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet.php index 3f27c45d..be036c32 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -25,6 +25,7 @@ # 141230-1523 - Added code for on-the-fly language translations display # 151227-1735 - Added option for searching archived data # 160325-1428 - Changes for sidebar update +# 170409-1539 - Added IP List validation code # $startMS = microtime(); @@ -121,7 +122,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -162,6 +163,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet_archive.php b/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet_archive.php index 3bc3be4d..38cff202 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet_archive.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_time_sheet_archive.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -16,6 +16,7 @@ # 140328-0005 - Converted division calculations to use MathZDC function # 141114-0906 - Finalized adding QXZ translation to all admin files # 141230-1521 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # $startMS = microtime(); @@ -80,7 +81,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -121,6 +122,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_timeclock_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_timeclock_detail.php index 7dfbe6c5..39cf4ceb 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_timeclock_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_timeclock_detail.php @@ -25,6 +25,7 @@ # 160227-1934 - Uniform form format # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 170227-1726 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -108,7 +109,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -149,6 +150,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_campaign_status_list_report.php b/agc_2-X/trunk/www/vicidial/AST_campaign_status_list_report.php index 1161206d..3106263a 100644 --- a/agc_2-X/trunk/www/vicidial/AST_campaign_status_list_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_campaign_status_list_report.php @@ -24,6 +24,7 @@ # 160227-1059 - Uniform form format # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 170227-1720 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -133,7 +134,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -174,6 +175,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_carrier_log_report.php b/agc_2-X/trunk/www/vicidial/AST_carrier_log_report.php index 0977dc24..1af53b8c 100644 --- a/agc_2-X/trunk/www/vicidial/AST_carrier_log_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_carrier_log_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # CHANGES # 120210-2202 - First build @@ -13,6 +13,7 @@ # 140108-0748 - Added webserver and hostname to report logging # 141114-0846 - Finalized adding QXZ translation to all admin files # 141230-1513 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # $startMS = microtime(); @@ -91,7 +92,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -132,6 +133,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_chat_log_report.php b/agc_2-X/trunk/www/vicidial/AST_chat_log_report.php index e446f4ba..d5d51bbe 100644 --- a/agc_2-X/trunk/www/vicidial/AST_chat_log_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_chat_log_report.php @@ -1,7 +1,7 @@ , Joe Johnson LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell , Joe Johnson LICENSE: AGPLv2 # # This is the report page where you can view report information of any of the dialer's chats. The web page will # display the information about the chat, including the start time and participants, and will also provide links @@ -9,9 +9,10 @@ # # CHANGES # -# 150608-0647 First build +# 150608-0647 - First build # 160108-2300 - Changed some mysqli_query to mysql_to_mysqli for consistency # 161217-0820 - Added chat-type to allow for multi-user internal chat sessions +# 170409-1550 - Added IP List validation code # $startMS = microtime(); @@ -112,7 +113,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -153,6 +154,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_dial_log_report.php b/agc_2-X/trunk/www/vicidial/AST_dial_log_report.php index 2cc51cd8..a2e5adaa 100644 --- a/agc_2-X/trunk/www/vicidial/AST_dial_log_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_dial_log_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # CHANGES # 130709-1346 - First build @@ -9,6 +9,7 @@ # 140108-0744 - Added webserver and hostname to report logging # 141114-0844 - Finalized adding QXZ translation to all admin files # 141230-1510 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # # describe vicidial_dial_log # +-------------------+-----------------------+------+-----+---------+-------+ @@ -209,7 +210,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -250,6 +251,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_dialer_inventory_report.php b/agc_2-X/trunk/www/vicidial/AST_dialer_inventory_report.php index a0d48901..763bd817 100644 --- a/agc_2-X/trunk/www/vicidial/AST_dialer_inventory_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_dialer_inventory_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson LICENSE: AGPLv2 # Matt Florell # # NOTES: @@ -23,6 +23,7 @@ # 141114-0006 - Finalized adding QXZ translation to all admin files # 141230-1509 - Added code for on-the-fly language translations display # 160227-1933 - Uniform form format +# 170409-1538 - Added IP List validation code # $startMS = microtime(); @@ -114,7 +115,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -155,6 +156,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_email_log_display.php b/agc_2-X/trunk/www/vicidial/AST_email_log_display.php index 0b3e630f..86e46d75 100644 --- a/agc_2-X/trunk/www/vicidial/AST_email_log_display.php +++ b/agc_2-X/trunk/www/vicidial/AST_email_log_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson LICENSE: AGPLv2 # # This page displays emails from the log # @@ -12,6 +12,7 @@ # 130902-0733 - Changed to mysqli PHP functions # 141114-0843 - Finalized adding QXZ translation to all admin files # 141230-1506 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -81,7 +82,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -122,6 +123,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_email_log_report.php b/agc_2-X/trunk/www/vicidial/AST_email_log_report.php index 1c56295b..a0935ca6 100644 --- a/agc_2-X/trunk/www/vicidial/AST_email_log_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_email_log_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # report of emails handled by the system # @@ -18,12 +18,13 @@ # 141230-1504 - Added code for on-the-fly language translations display # 151219-0117 - Added option for searching archived data # 160227-1045 - Uniform form format +# 170409-1538 - Added IP List validation code # $startMS = microtime(); -$version = '2.12-11'; -$build = '160227-1045'; +$version = '2.14-12'; +$build = '170409-1538'; header ("Content-type: text/html; charset=utf-8"); @@ -150,7 +151,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -191,6 +192,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_hangup_cause_report.php b/agc_2-X/trunk/www/vicidial/AST_hangup_cause_report.php index 25b9ca72..489ad870 100644 --- a/agc_2-X/trunk/www/vicidial/AST_hangup_cause_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_hangup_cause_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # CHANGES # 120331-2301 - First build @@ -14,6 +14,7 @@ # 140403-1830 - Fixed SIP hangup bug # 141114-0837 - Finalized adding QXZ translation to all admin files # 141230-1457 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # $startMS = microtime(); @@ -250,7 +251,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -291,6 +292,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_inboundEXTstats.php b/agc_2-X/trunk/www/vicidial/AST_inboundEXTstats.php index 14e278f2..9c89fd37 100644 --- a/agc_2-X/trunk/www/vicidial/AST_inboundEXTstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_inboundEXTstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES @@ -14,6 +14,7 @@ # 140328-0005 - Converted division calculations to use MathZDC function # 141114-0836 - Finalized adding QXZ translation to all admin files # 141230-1452 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -74,7 +75,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -115,6 +116,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_inboundEXTstats_department.php b/agc_2-X/trunk/www/vicidial/AST_inboundEXTstats_department.php index b54aaf7d..9cbb03d3 100644 --- a/agc_2-X/trunk/www/vicidial/AST_inboundEXTstats_department.php +++ b/agc_2-X/trunk/www/vicidial/AST_inboundEXTstats_department.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # 70201-1710 - First Build @@ -12,6 +12,7 @@ # 140328-0005 - Converted division calculations to use MathZDC function # 141114-0835 - Finalized adding QXZ translation to all admin files # 141230-1450 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -75,7 +76,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -116,6 +117,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_inbound_daily_report.php b/agc_2-X/trunk/www/vicidial/AST_inbound_daily_report.php index da2a0b99..b3c581cf 100644 --- a/agc_2-X/trunk/www/vicidial/AST_inbound_daily_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_inbound_daily_report.php @@ -29,6 +29,7 @@ # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 160819-0054 - Fixed chart bugs caused by DST # 170227-1710 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -139,7 +140,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -180,6 +181,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_parkstats.php b/agc_2-X/trunk/www/vicidial/AST_parkstats.php index b87591c5..07d03dc2 100644 --- a/agc_2-X/trunk/www/vicidial/AST_parkstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_parkstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,7 @@ # 140328-0005 - Converted division calculations to use MathZDC function # 141114-0732 - Finalized adding QXZ translation to all admin files # 141230-1441 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -71,7 +72,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -112,6 +113,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php b/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php index 9236689e..2bb07bcc 100644 --- a/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php @@ -1,7 +1,7 @@ , Joe Johnson , Joe Johnson 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -167,6 +168,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_recording_log_report.php b/agc_2-X/trunk/www/vicidial/AST_recording_log_report.php index cf5d9388..e30e9cba 100644 --- a/agc_2-X/trunk/www/vicidial/AST_recording_log_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_recording_log_report.php @@ -3,11 +3,12 @@ # # This report is for viewing the a report of which users accessed which recordings # -# Copyright (C) 2016 Joe Johnson, Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # CHANGES # # 160115-2303 - First build +# 170409-1538 - Added IP List validation code # $startMS = microtime(); @@ -145,7 +146,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -186,6 +187,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_server_performance.php b/agc_2-X/trunk/www/vicidial/AST_server_performance.php index e4980952..2c68fee9 100644 --- a/agc_2-X/trunk/www/vicidial/AST_server_performance.php +++ b/agc_2-X/trunk/www/vicidial/AST_server_performance.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -25,6 +25,7 @@ # 140328-0005 - Converted division calculations to use MathZDC function # 141114-0730 - Finalized adding QXZ translation to all admin files # 141230-1440 - Added code for on-the-fly language translations display +# 170409-1550 - Added IP List validation code # $startMS = microtime(); @@ -94,7 +95,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -135,6 +136,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_team_performance_detail.php b/agc_2-X/trunk/www/vicidial/AST_team_performance_detail.php index 50184b96..eae8351b 100644 --- a/agc_2-X/trunk/www/vicidial/AST_team_performance_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_team_performance_detail.php @@ -6,7 +6,7 @@ # QC statuses of QCFAIL, QCCANC and sales are defined by the Sale=Y status # flags being set on those statuses. # -# Copyright (C) 2016 Joe Johnson, Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -28,6 +28,7 @@ # 160121-2214 - Added report title header, default report format, cleaned up formatting # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 160718-0054 - Fixed ChartJS bug +# 170409-1542 - Added IP List validation code # $startMS = microtime(); @@ -136,7 +137,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -177,6 +178,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDAD.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDAD.php index 99b80c9a..6d5d71e9 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDAD.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDAD.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer # @@ -19,6 +19,7 @@ # 130901-2009 - Changed to mysqli PHP functions # 141114-0721 - Finalized adding QXZ translation to all admin files # 141230-1418 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # header ("Content-type: text/html; charset=utf-8"); @@ -81,7 +82,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -122,6 +123,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php index e087e3e9..5e5e87d9 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php @@ -105,10 +105,11 @@ # 160515-1300 - Added UK OFCOM feature # 160803-1901 - Fixed issue with ERROR in campaign/ingroup name # 170321-1145 - Added pause code time limits colors +# 170409-1556 - Added IP List validation code # -$version = '2.14-93'; -$build = '170321-1145'; +$version = '2.14-94'; +$build = '170409-1556'; header ("Content-type: text/html; charset=utf-8"); @@ -342,7 +343,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',0); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',0,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -383,6 +384,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADallREC.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADallREC.php index 88a0d9ee..ab4d6a17 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADallREC.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADallREC.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -33,6 +33,7 @@ # 140328-0005 - Converted division calculations to use MathZDC function # 141114-0717 - Finalized adding QXZ translation to all admin files # 141230-1416 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # header ("Content-type: text/html; charset=utf-8"); @@ -165,7 +166,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -206,6 +207,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADallSUMMARY.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADallSUMMARY.php index c5c312f7..33139184 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADallSUMMARY.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADallSUMMARY.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -29,6 +29,7 @@ # 140328-0005 - Converted division calculations to use MathZDC function # 141001-2200 - Finalized adding QXZ translation to all admin files # 141230-0038 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -111,7 +112,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -152,6 +153,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_url_log_report.php b/agc_2-X/trunk/www/vicidial/AST_url_log_report.php index 426c19ec..72856380 100644 --- a/agc_2-X/trunk/www/vicidial/AST_url_log_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_url_log_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # CHANGES # 130620-0806 - First build @@ -10,6 +10,7 @@ # 141114-0713 - Finalized adding QXZ translation to all admin files # 141230-1415 - Added code for on-the-fly language translations display # 151211-0950 - Added missing url types +# 170409-1536 - Added IP List validation code # $startMS = microtime(); @@ -96,7 +97,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -137,6 +138,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/AST_user_group_hourly_detail.php b/agc_2-X/trunk/www/vicidial/AST_user_group_hourly_detail.php index be9eb2af..6fc565d8 100644 --- a/agc_2-X/trunk/www/vicidial/AST_user_group_hourly_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_user_group_hourly_detail.php @@ -1,13 +1,14 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joseph Johnson LICENSE: AGPLv2 # # Gives hourly count of distinct agents per user group, with totals. # For single days only # # CHANGES # 160826-0054 - First build +# 170409-1542 - Added IP List validation code # $startMS = microtime(); @@ -118,7 +119,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -159,6 +160,13 @@ else 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"; @@ -635,31 +643,50 @@ o_cal.a_tpl.yearscroll = false; echo " "._QXZ("Campaigns").":
"; echo "\n"; echo ""._QXZ("Teams/User Groups").":
"; echo "\n"; echo "$UUgroups_list"; echo "\n"; - echo "$NWB#settings_containers-user_group$NWE\n"; + echo "$NWB#auto_reports-user_group$NWE\n"; + + echo "\n"; + echo "\n"; + } + else + { + echo _QXZ("You do not have permission to view this page")."\n"; + exit; + } + } + + +###################### +# ADD=195111111111 display the ADD NEW IP LIST screen +###################### +if ($ADD==195111111111) + { + if ($LOGmodify_ip_lists==1) + { + echo "
\n"; + echo "\"IP "; + + echo "
"._QXZ("ADD NEW IP LIST")."
\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
"._QXZ("IP List ID").": $NWB#ip_lists-ip_list_id$NWE
"._QXZ("IP List Name").": $NWB#ip_lists-ip_list_name$NWE
"._QXZ("Admin User Group").": $NWB#ip_lists-user_group$NWE
\n"; @@ -9070,7 +9148,7 @@ if ($ADD=="2A") $pass=''; } - $stmt="INSERT INTO vicidial_users (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,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,pass_hash,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports) SELECT \"$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,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,\"$pass_hash\",alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports from vicidial_users where user=\"$source_user_id\";"; + $stmt="INSERT INTO vicidial_users (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,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,pass_hash,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list) SELECT \"$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,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,\"$pass_hash\",alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today,group_type) SELECT \"$user\",group_id,group_rank,group_weight,\"0\",group_type from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -12342,6 +12420,48 @@ if ($ADD==294111111111) } +###################### +# ADD=295111111111 adds new ip list to the system +###################### +if ($ADD==295111111111) + { + if ( ($LOGmodify_ip_lists!=1) or ($add_copy_disabled > 0) ) + { + echo "
"._QXZ("You do not have permission to add records on this system")." -system_settings-\n"; + } + else + { + echo ""; + $stmt="SELECT count(*) from vicidial_ip_lists where ip_list_id='$ip_list_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] > 0) + {echo "
"._QXZ("IP LIST NOT ADDED - there is already a list in the system with this ID")."\n";} + else + { + if ( (strlen($ip_list_id) < 2) or (strlen($ip_list_name) < 2) ) + {echo "
"._QXZ("IP LIST NOT ADDED - Please go back and look at the data you entered")."\n";} + else + { + echo "
"._QXZ("IP LIST ADDED")."\n"; + + $stmt="INSERT INTO vicidial_ip_lists SET ip_list_id='$ip_list_id',ip_list_name='$ip_list_name',active='N',user_group='$user_group';"; + $rslt=mysql_to_mysqli($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = preg_replace('/;/', '', $SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='IPLISTS', event_type='ADD', record_id='$ip_list_id', event_code='ADMIN ADD IP LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + } + } + } + $ADD=395111111111; + } + + ###################### # ADD=2111111111111 adds new conference to the system ###################### @@ -12594,7 +12714,7 @@ if ($ADD=="4A") echo "
"._QXZ("USER MODIFIED - ADMIN").": $user\n"; - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',callcard_admin='$callcard_admin',agent_choose_blended='$agent_choose_blended',realtime_block_user_info='$realtime_block_user_info',custom_fields_modify='$custom_fields_modify',force_change_password='$force_change_password',agent_lead_search_override='$agent_lead_search',modify_shifts='$modify_shifts',modify_phones='$modify_phones',modify_carriers='$modify_carriers',modify_labels='$modify_labels',modify_statuses='$modify_statuses',modify_voicemail='$modify_voicemail',modify_audiostore='$modify_audiostore',modify_moh='$modify_moh',modify_tts='$modify_tts',preset_contact_search='$preset_contact_search',modify_contacts='$modify_contacts',modify_same_user_level='$modify_same_user_level',admin_hide_lead_data='$admin_hide_lead_data',admin_hide_phone_data='$admin_hide_phone_data',agentcall_email='$agentcall_email',agentcall_chat='$agentcall_chat',modify_email_accounts='$modify_email_accounts',failed_login_count=0,alter_admin_interface_options='$alter_admin_interface_options',max_inbound_calls='$max_inbound_calls',modify_custom_dialplans='$modify_custom_dialplans',wrapup_seconds_override='$wrapup_seconds_override',modify_languages='$modify_languages',selected_language='$selected_language',user_choose_language='$user_choose_language',ignore_group_on_search='$ignore_group_on_search',api_list_restrict='$api_list_restrict',api_allowed_functions='$api_allowed_functions',lead_filter_id='$lead_filter_id',admin_cf_show_hidden='$admin_cf_show_hidden',user_hide_realtime='$user_hide_realtime',access_recordings='$access_recordings',modify_colors='$modify_colors',user_nickname='$user_nickname',user_new_lead_limit='$user_new_lead_limit',api_only_user='$api_only_user',modify_auto_reports='$modify_auto_reports' $pass_hashSQL where user='$user' $LOGadmin_viewable_groupsSQL;"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',callcard_admin='$callcard_admin',agent_choose_blended='$agent_choose_blended',realtime_block_user_info='$realtime_block_user_info',custom_fields_modify='$custom_fields_modify',force_change_password='$force_change_password',agent_lead_search_override='$agent_lead_search',modify_shifts='$modify_shifts',modify_phones='$modify_phones',modify_carriers='$modify_carriers',modify_labels='$modify_labels',modify_statuses='$modify_statuses',modify_voicemail='$modify_voicemail',modify_audiostore='$modify_audiostore',modify_moh='$modify_moh',modify_tts='$modify_tts',preset_contact_search='$preset_contact_search',modify_contacts='$modify_contacts',modify_same_user_level='$modify_same_user_level',admin_hide_lead_data='$admin_hide_lead_data',admin_hide_phone_data='$admin_hide_phone_data',agentcall_email='$agentcall_email',agentcall_chat='$agentcall_chat',modify_email_accounts='$modify_email_accounts',failed_login_count=0,alter_admin_interface_options='$alter_admin_interface_options',max_inbound_calls='$max_inbound_calls',modify_custom_dialplans='$modify_custom_dialplans',wrapup_seconds_override='$wrapup_seconds_override',modify_languages='$modify_languages',selected_language='$selected_language',user_choose_language='$user_choose_language',ignore_group_on_search='$ignore_group_on_search',api_list_restrict='$api_list_restrict',api_allowed_functions='$api_allowed_functions',lead_filter_id='$lead_filter_id',admin_cf_show_hidden='$admin_cf_show_hidden',user_hide_realtime='$user_hide_realtime',access_recordings='$access_recordings',modify_colors='$modify_colors',user_nickname='$user_nickname',user_new_lead_limit='$user_new_lead_limit',api_only_user='$api_only_user',modify_auto_reports='$modify_auto_reports',modify_ip_lists='$modify_ip_lists',ignore_ip_list='$ignore_ip_list' $pass_hashSQL where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -15211,34 +15331,34 @@ if ($ADD==411111) } } - $custom_rpt_SQL=''; - $custom_stmt="show tables like 'vicidial_custom_reports'"; - $custom_rslt=mysql_to_mysqli($custom_stmt, $link); - if (mysqli_num_rows($custom_rslt)>0) - { - - $custom_report_str=""; - if (count($allowed_custom_reports)>0) + $custom_rpt_SQL=''; + $custom_stmt="show tables like 'vicidial_custom_reports'"; + $custom_rslt=mysql_to_mysqli($custom_stmt, $link); + if (mysqli_num_rows($custom_rslt)>0) { - for ($q=0; $q0) { - $custom_report_str.=$allowed_custom_reports[$q]."|"; + for ($q=0; $q"._QXZ("USER GROUP MODIFIED")."\n"; @@ -16662,7 +16782,7 @@ if ($ADD==411111111111111) } } - $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysqli_real_escape_string($link, $webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db'$custom_reports_slave_SQL,webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled',pllb_grouping_limit='$pllb_grouping_limit',did_ra_extensions_enabled='$did_ra_extensions_enabled',expanded_list_stats='$expanded_list_stats',contacts_enabled='$contacts_enabled',call_menu_qualify_enabled='$call_menu_qualify_enabled',admin_list_counts='$admin_list_counts',allow_voicemail_greeting='$allow_voicemail_greeting',queuemetrics_socket='$queuemetrics_socket',queuemetrics_socket_url='$queuemetrics_socket_url',enhanced_disconnect_logging='$enhanced_disconnect_logging',allow_emails='$allow_emails',level_8_disable_add='$level_8_disable_add',queuemetrics_record_hold='$queuemetrics_record_hold',country_code_list_stats='$country_code_list_stats',queuemetrics_pause_type='$queuemetrics_pause_type',frozen_server_call_clear='$frozen_server_call_clear',callback_time_24hour='$callback_time_24hour',enable_languages='$enable_languages',language_method='$language_method',meetme_enter_login_filename='$meetme_enter_login_filename',meetme_enter_leave3way_filename='$meetme_enter_leave3way_filename',enable_did_entry_list_id='$enable_did_entry_list_id',enable_third_webform='$enable_third_webform',allow_chats='$allow_chats',chat_url='$chat_url',chat_timeout='$chat_timeout',agent_debug_logging='$agent_debug_logging',default_language='$default_language',agent_whisper_enabled='$agent_whisper_enabled',user_hide_realtime_enabled='$user_hide_realtime_enabled',usacan_phone_dialcode_fix='$usacan_phone_dialcode_fix',cache_carrier_stats_realtime='$cache_carrier_stats_realtime',log_recording_access='$log_recording_access',report_default_format='$report_default_format',alt_ivr_logging='$alt_ivr_logging',default_phone_code='$default_phone_code',admin_row_click='$admin_row_click',admin_screen_colors='$admin_screen_colors',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',agent_screen_colors='$agent_screen_colors',script_remove_js='$script_remove_js',manual_auto_next='$manual_auto_next',user_new_lead_limit='$user_new_lead_limit',agent_xfer_park_3way='$agent_xfer_park_3way',agent_soundboards='$agent_soundboards',web_loader_phone_length='$web_loader_phone_length',agent_script='$agent_script',agent_chat_screen_colors='$agent_chat_screen_colors',enable_auto_reports='$enable_auto_reports',enable_pause_code_limits='$enable_pause_code_limits',enable_drop_lists='$enable_drop_lists'$custom_dialplanSQL;"; + $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysqli_real_escape_string($link, $webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db'$custom_reports_slave_SQL,webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password',admin_modify_refresh='$admin_modify_refresh',nocache_admin='$nocache_admin',generate_cross_server_exten='$generate_cross_server_exten',queuemetrics_addmember_enabled='$queuemetrics_addmember_enabled',queuemetrics_dispo_pause='$queuemetrics_dispo_pause',label_hide_field_logs='$label_hide_field_logs',queuemetrics_pe_phone_append='$queuemetrics_pe_phone_append',test_campaign_calls='$test_campaign_calls',agents_calls_reset='$agents_calls_reset',default_voicemail_timezone='$default_voicemail_timezone',default_local_gmt='$default_local_gmt',noanswer_log='$noanswer_log',alt_log_server_ip='$alt_log_server_ip',alt_log_dbname='$alt_log_dbname',alt_log_login='$alt_log_login',alt_log_pass='$alt_log_pass',tables_use_alt_log_db='$tables_use_alt_log_db',did_agent_log='$did_agent_log',campaign_cid_areacodes_enabled='$campaign_cid_areacodes_enabled',pllb_grouping_limit='$pllb_grouping_limit',did_ra_extensions_enabled='$did_ra_extensions_enabled',expanded_list_stats='$expanded_list_stats',contacts_enabled='$contacts_enabled',call_menu_qualify_enabled='$call_menu_qualify_enabled',admin_list_counts='$admin_list_counts',allow_voicemail_greeting='$allow_voicemail_greeting',queuemetrics_socket='$queuemetrics_socket',queuemetrics_socket_url='$queuemetrics_socket_url',enhanced_disconnect_logging='$enhanced_disconnect_logging',allow_emails='$allow_emails',level_8_disable_add='$level_8_disable_add',queuemetrics_record_hold='$queuemetrics_record_hold',country_code_list_stats='$country_code_list_stats',queuemetrics_pause_type='$queuemetrics_pause_type',frozen_server_call_clear='$frozen_server_call_clear',callback_time_24hour='$callback_time_24hour',enable_languages='$enable_languages',language_method='$language_method',meetme_enter_login_filename='$meetme_enter_login_filename',meetme_enter_leave3way_filename='$meetme_enter_leave3way_filename',enable_did_entry_list_id='$enable_did_entry_list_id',enable_third_webform='$enable_third_webform',allow_chats='$allow_chats',chat_url='$chat_url',chat_timeout='$chat_timeout',agent_debug_logging='$agent_debug_logging',default_language='$default_language',agent_whisper_enabled='$agent_whisper_enabled',user_hide_realtime_enabled='$user_hide_realtime_enabled',usacan_phone_dialcode_fix='$usacan_phone_dialcode_fix',cache_carrier_stats_realtime='$cache_carrier_stats_realtime',log_recording_access='$log_recording_access',report_default_format='$report_default_format',alt_ivr_logging='$alt_ivr_logging',default_phone_code='$default_phone_code',admin_row_click='$admin_row_click',admin_screen_colors='$admin_screen_colors',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',agent_screen_colors='$agent_screen_colors',script_remove_js='$script_remove_js',manual_auto_next='$manual_auto_next',user_new_lead_limit='$user_new_lead_limit',agent_xfer_park_3way='$agent_xfer_park_3way',agent_soundboards='$agent_soundboards',web_loader_phone_length='$web_loader_phone_length',agent_script='$agent_script',agent_chat_screen_colors='$agent_chat_screen_colors',enable_auto_reports='$enable_auto_reports',enable_pause_code_limits='$enable_pause_code_limits',enable_drop_lists='$enable_drop_lists',allow_ip_lists='$allow_ip_lists',system_ip_blacklist='$system_ip_blacklist'$custom_dialplanSQL;"; $rslt=mysql_to_mysqli($stmt, $link); if ( ($meetme_enter_login_filename != $SSmeetme_enter_login_filename) or ($meetme_enter_leave3way_filename != $SSmeetme_enter_leave3way_filename) ) @@ -17670,6 +17790,27 @@ if ($ADD==594111111111) } +###################### +# ADD=595111111111 confirmation before deletion of IP List record +###################### +if ($ADD==595111111111) + { + echo ""; + + if (strlen($ip_list_id) < 2) + { + echo "
"._QXZ("IP LIST NOT DELETED - Please go back and look at the data you entered")."\n"; + echo "
"._QXZ("IP LIST ID must be at least 2 characters in length")."\n"; + } + else + { + echo "
"._QXZ("IP LIST DELETION CONFIRMATION").": $ip_list_id - $ip_list_name\n"; + echo "

"._QXZ("Click here to delete IP List")." $ip_list_id - $ip_list_name


\n"; + } + $ADD='395111111111'; # go to IP LIST entry modification below + } + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -19955,6 +20096,46 @@ if ($ADD==694111111111) } +###################### +# ADD=695111111111 delete IP List record +###################### +if ($ADD==695111111111) + { + echo ""; + + if ( (strlen($ip_list_id) < 2) or ($CoNfIrM != 'YES') or ($LOGmodify_ip_lists!=1) ) + { + echo "
"._QXZ("IP LIST NOT DELETED - Please go back and look at the data you entered")."\n"; + echo "
"._QXZ("IP LIST ID must be at least 2 characters in length")."\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_ip_lists where ip_list_id='$ip_list_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] < 1) + {echo "
"._QXZ("IP LIST NOT FOUND").": $report_id\n";} + else + { + $stmt="DELETE from vicidial_ip_lists where ip_list_id='$ip_list_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = preg_replace('/;/', '', $SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='IPLISTS', event_type='DELETE', record_id='$ip_list_id', event_code='ADMIN DELETE IP LIST', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + + echo "
"._QXZ("IP LIST DELETION COMPLETED").": $ip_list_id\n"; + echo "

\n"; + } + } + $ADD='195000000000'; # go to IP List entry list + } + + ###################### # ADD=6111111111111 delete conference record ###################### @@ -20049,7 +20230,7 @@ if ($ADD==3) echo "\n"; } + if ($SSallow_ip_lists > 0) + { + echo "\n"; + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; echo "\n"; echo "\n"; @@ -30509,7 +30702,7 @@ if ($ADD==311111) echo "
\n"; echo ""; - $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,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,modify_email_accounts,failed_login_count,last_login_date,last_ip,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,agentcall_chat,admin_cf_show_hidden,user_hide_realtime,access_recordings,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; + $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,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,modify_email_accounts,failed_login_count,last_login_date,last_ip,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,agentcall_chat,admin_cf_show_hidden,user_hide_realtime,access_recordings,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $user_id = $row[0]; @@ -20173,6 +20354,8 @@ if ($ADD==3) $user_new_lead_limit = $row[120]; $api_only_user = $row[121]; $modify_auto_reports = $row[122]; + $modify_ip_lists = $row[123]; + $ignore_ip_list = $row[124]; if ( ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) or ( ($LOGmodify_same_user_level < 1) and ($LOGuser_level > 8) and ($user_level > 8) ) ) { @@ -20515,6 +20698,16 @@ if ($ADD==3) echo "
"._QXZ("Modify IP Lists").": $NWB#users-modify_sections$NWE
"._QXZ("Ignore IP List").": $NWB#users-modify_sections$NWE
"._QXZ("Add Timeclock Log Record").": $NWB#users-add_timeclock_log$NWE
"._QXZ("Modify Timeclock Log Record").": $NWB#users-modify_timeclock_log$NWE
"._QXZ("Delete Timeclock Log Record").": $NWB#users-delete_timeclock_log$NWE
\n"; - $custom_stmt="show tables like 'vicidial_custom_reports'"; - $custom_rslt=mysql_to_mysqli($custom_stmt, $link); - if (mysqli_num_rows($custom_rslt)>0) - { - - $custom_rpt_stmt="SELECT custom_report_id, report_name from vicidial_custom_reports order by report_name asc"; - $custom_rpt_rslt=mysql_to_mysqli($custom_rpt_stmt, $link); - - $allowed_rpt_stmt="SELECT allowed_custom_reports from vicidial_user_groups where user_group='$user_group'"; - $allowed_rpt_rslt=mysql_to_mysqli($allowed_rpt_stmt, $link); - - if (mysqli_num_rows($custom_rpt_rslt)>0) + $custom_stmt="show tables like 'vicidial_custom_reports'"; + $custom_rslt=mysql_to_mysqli($custom_stmt, $link); + if (mysqli_num_rows($custom_rslt)>0) { - $allowed_rpt_row=mysqli_fetch_row($allowed_rpt_rslt); - $allowed_custom_reports=$allowed_rpt_row[0]; - $allowed_reports_array=explode("|", $allowed_custom_reports); - echo "\n"; } - echo "$NWB#user_groups-allowed_custom_reports$NWE\n"; - } if (strlen($SSwebphone_url) > 5) @@ -30765,6 +30961,73 @@ if ($ADD==311111) echo "
 \n"; } + if ($SSallow_ip_lists > 0) + { + ##### get ip lists listing for dynamic pulldowns + $stmt="SELECT ip_list_id,ip_list_name from vicidial_ip_lists where active='Y' order by ip_list_id;"; + $rsltx=mysql_to_mysqli($stmt, $link); + $iplists_to_print = mysqli_num_rows($rsltx); + $ip_list=''; + $o=0; + while ($iplists_to_print > $o) + { + $rowx=mysqli_fetch_row($rsltx); + $ip_list .= "\n"; + $o++; + } + + if (strlen($admin_ip_list) < 1) + { + $ip_list_link_BEGIN = ""; $ip_list_link_END = ""; + $ip_list_menu = "\n"; + } + else + { + $ip_list_link_BEGIN = ""; $ip_list_link_END = ""; + $ip_list_menu = "\n"; + $ip_list_menu .= "\n"; + } + + echo "\n"; + + if (strlen($agent_ip_list) < 1) + { + $ip_list_link_BEGIN = ""; $ip_list_link_END = ""; + $ip_list_menu = "\n"; + } + else + { + $ip_list_link_BEGIN = ""; $ip_list_link_END = ""; + $ip_list_menu = "\n"; + $ip_list_menu .= "\n"; + } + + echo "\n"; + + if (strlen($api_ip_list) < 1) + { + $ip_list_link_BEGIN = ""; $ip_list_link_END = ""; + $ip_list_menu = "\n"; + } + else + { + $ip_list_link_BEGIN = ""; $ip_list_link_END = ""; + $ip_list_menu = "\n"; + $ip_list_menu .= "\n"; + } + + echo "\n"; + } + else + { + echo "\n"; + } echo " 0) {echo " onclick=\"window.document.location='$ADMIN?ADD=100000000';\"";} ?>> @@ -2056,7 +2060,14 @@ if ($subcamp_font_size < 4) {$subcamp_font_size='11';} if ($SSenable_auto_reports > 0) { ?> 0) {echo " onclick=\"window.document.location='$ADMIN?ADD=194000000000';\"";} ?>> +   \"Automated + + + 0) + { ?> + 0) {echo " onclick=\"window.document.location='$ADMIN?ADD=195000000000';\"";} ?>>> 25) { + ?> + > + 25) { ?> > diff --git a/agc_2-X/trunk/www/vicidial/admin_languages.php b/agc_2-X/trunk/www/vicidial/admin_languages.php index e0abd8d0..b66d6bc6 100644 --- a/agc_2-X/trunk/www/vicidial/admin_languages.php +++ b/agc_2-X/trunk/www/vicidial/admin_languages.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # this screen manages the optional language tables in ViciDial # @@ -16,10 +16,11 @@ # 160429-1124 - Added admin_row_click option # 160508-0210 - Added screen colors feature # 161120-0919 - Added CHAT option +# 170409-1547 - Added IP List validation code # -$admin_version = '2.12-10'; -$build = '161120-0919'; +$admin_version = '2.14-11'; +$build = '170409-1547'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -182,7 +183,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -196,6 +197,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_launch_trigger.php b/agc_2-X/trunk/www/vicidial/admin_launch_trigger.php index 4db24823..07722ad0 100644 --- a/agc_2-X/trunk/www/vicidial/admin_launch_trigger.php +++ b/agc_2-X/trunk/www/vicidial/admin_launch_trigger.php @@ -1,17 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # This script is designed to launch a CLI script on the voicemail server through # the triggering process # # CHANGELOG: # 161016-2014 - First build of script based upon admin_NANPA_updater.php +# 170409-1543 - Added IP List validation code # -$version = '2.12-1'; -$build = '161016-2014'; +$version = '2.14-2'; +$build = '170409-1543'; $startMS = microtime(); require("dbconnect_mysqli.php"); @@ -79,7 +80,7 @@ $user_auth=0; $auth=0; $reports_auth=0; $qc_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1,0); if ($auth_message == 'GOOD') {$user_auth=1;} @@ -136,6 +137,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php b/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php index 5cbbdbdf..e2444f11 100644 --- a/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php +++ b/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php @@ -69,10 +69,11 @@ # 161103-2224 - Added web_loader_phone_length option # 161114-2315 - Added file upload error checking # 170219-1427 - Added last-90-day duplicate check options +# 170409-1553 - Added IP List validation code # -$version = '2.14-67'; -$build = '170219-1427'; +$version = '2.14-68'; +$build = '170409-1553'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -248,7 +249,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -262,6 +263,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_listloader_third_gen.php b/agc_2-X/trunk/www/vicidial/admin_listloader_third_gen.php index 7fd7a8d8..b3d1898c 100644 --- a/agc_2-X/trunk/www/vicidial/admin_listloader_third_gen.php +++ b/agc_2-X/trunk/www/vicidial/admin_listloader_third_gen.php @@ -2,7 +2,7 @@ # admin_listloader_third_gen.php - version 2.8 # (based upon - new_listloader_superL.php script) # -# Copyright (C) 2013 Matt Florell,Joe Johnson LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell,Joe Johnson LICENSE: AGPLv2 # # ViciDial web-based lead loader from formatted file # @@ -49,10 +49,11 @@ # 130610-1055 - Finalized changing of all ereg instances to preg # 130621-1815 - Added filtering of input to prevent SQL injection attacks and new user auth # 130902-0753 - Changed to mysqli PHP functions +# 170409-1534 - Added IP List validation code # -$version = '2.8-48'; -$build = '130902-0753'; +$version = '2.14-49'; +$build = '170409-1534'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -195,7 +196,7 @@ $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -209,6 +210,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_lists_custom.php b/agc_2-X/trunk/www/vicidial/admin_lists_custom.php index 197ae483..fd41f151 100644 --- a/agc_2-X/trunk/www/vicidial/admin_lists_custom.php +++ b/agc_2-X/trunk/www/vicidial/admin_lists_custom.php @@ -43,10 +43,11 @@ # 170228-2254 - Changes to allow URLs in SCRIPT field types # 170301-0827 - Enabled required custom fields with INBOUND_ONLY option # 170321-1553 - Fixed list view permissions issue #1005 +# 170409-1558 - Added IP List validation code # -$admin_version = '2.14-35'; -$build = '170321-1553'; +$admin_version = '2.14-36'; +$build = '170409-1558'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -202,7 +203,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -216,6 +217,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php index f12252c8..edc46479 100644 --- a/agc_2-X/trunk/www/vicidial/admin_modify_lead.php +++ b/agc_2-X/trunk/www/vicidial/admin_modify_lead.php @@ -79,6 +79,7 @@ # 160407-2023 - Design changes, added more variable scrubbing, added more admin logging # 160926-1052 - Fix for inbound call notes display # 170224-1639 - Added ability to display archived recordings +# 170409-1554 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -320,7 +321,7 @@ else if (strlen($phone_number)<6) {$phone_number=$old_phone;} $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -334,6 +335,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_phones_bulk_insert.php b/agc_2-X/trunk/www/vicidial/admin_phones_bulk_insert.php index 1cdcdacc..fc6ca7dd 100644 --- a/agc_2-X/trunk/www/vicidial/admin_phones_bulk_insert.php +++ b/agc_2-X/trunk/www/vicidial/admin_phones_bulk_insert.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # this screen will insert phones into your multi-server system with aliases # @@ -17,10 +17,11 @@ # 130902-0751 - Changed to mysqli PHP functions # 141007-1145 - Finalized adding QXZ translation to all admin files # 141229-2101 - Added code for on-the-fly language translations display +# 170409-1532 - Added IP List validation code # -$admin_version = '2.10-11'; -$build = '141229-2101'; +$admin_version = '2.14-12'; +$build = '170409-1532'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -129,7 +130,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -143,6 +144,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_search_lead.php b/agc_2-X/trunk/www/vicidial/admin_search_lead.php index 5106ce7a..b1399b1c 100644 --- a/agc_2-X/trunk/www/vicidial/admin_search_lead.php +++ b/agc_2-X/trunk/www/vicidial/admin_search_lead.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # AST GUI database administration search for lead info # admin_modify_lead.php @@ -46,6 +46,7 @@ # 151203-2104 - Added option for called_count as search variable # 160325-1427 - Changes for sidebar update # 160508-0753 - Added colors features +# 170409-1541 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -156,7 +157,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -170,6 +171,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_soundboard.php b/agc_2-X/trunk/www/vicidial/admin_soundboard.php index 0ee7b6cb..0d2640b6 100644 --- a/agc_2-X/trunk/www/vicidial/admin_soundboard.php +++ b/agc_2-X/trunk/www/vicidial/admin_soundboard.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # this screen manages the optional soundboard tables in ViciDial # @@ -17,10 +17,11 @@ # 160429-1122 - Added admin_row_click option # 161103-1605 - Updated code for new admin links # 161111-1646 - Added HIDENUMBERS display option, Font size, button type and layout options +# 170409-1549 - Added IP List validation code # -$admin_version = '2.12-11'; -$build = '161111-1646'; +$admin_version = '2.14-12'; +$build = '170409-1549'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -172,7 +173,7 @@ if (file_exists('options.php')) {require('options.php');} $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -186,6 +187,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_url_multi.php b/agc_2-X/trunk/www/vicidial/admin_url_multi.php index 310e3fc6..19f1a1ff 100644 --- a/agc_2-X/trunk/www/vicidial/admin_url_multi.php +++ b/agc_2-X/trunk/www/vicidial/admin_url_multi.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # this screen will control the *url* settings needed when the Campaign or # In-Group or List URL setting is set to "ALT". This screen allows for multiple @@ -14,10 +14,11 @@ # 160331-2203 - Made URL form input fields longer # 160508-0815 - Added colors features # 160801-0657 - Added lists qualifier fields +# 170409-1545 - Added IP List validation code # -$admin_version = '2.12-4'; -$build = '160801-0657'; +$admin_version = '2.14-5'; +$build = '170409-1545'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -117,7 +118,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -131,6 +132,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_user_list_new.php b/agc_2-X/trunk/www/vicidial/admin_user_list_new.php index 7563b2c8..81fe1377 100644 --- a/agc_2-X/trunk/www/vicidial/admin_user_list_new.php +++ b/agc_2-X/trunk/www/vicidial/admin_user_list_new.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # this screen will control the optional user list new limit override settings # @@ -9,10 +9,11 @@ # changes: # 161012-1327 - First Build # 161031-1500 - Added overall user option +# 170409-1546 - Added IP List validation code # -$admin_version = '2.12-2'; -$build = '161031-1500'; +$admin_version = '2.14-3'; +$build = '170409-1546'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -97,7 +98,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -111,6 +112,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/asterisk_debug.php b/agc_2-X/trunk/www/vicidial/asterisk_debug.php index 1565a9f6..5b1f1bc7 100644 --- a/agc_2-X/trunk/www/vicidial/asterisk_debug.php +++ b/agc_2-X/trunk/www/vicidial/asterisk_debug.php @@ -1,10 +1,11 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # 151229-1703 - First build +# 170409-1536 - Added IP List validation code # $startMS = microtime(); @@ -69,7 +70,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -110,6 +111,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/audio_store.php b/agc_2-X/trunk/www/vicidial/audio_store.php index bbc3a113..716220f8 100644 --- a/agc_2-X/trunk/www/vicidial/audio_store.php +++ b/agc_2-X/trunk/www/vicidial/audio_store.php @@ -25,10 +25,11 @@ # 160508-0139 - Added screen colors feature # 160613-1002 - Added feature to copy recordings to a new filename # 170301-1650 - Added validation that sounds web dir exists +# 170409-1555 - Added IP List validation code # -$version = '2.14-19'; -$build = '170301-1650'; +$version = '2.14-20'; +$build = '170409-1555'; $MT[0]=''; @@ -190,7 +191,7 @@ if ( (!preg_match("/\|$ip\|/", $server_ips)) and ($formIPvalid < 1) ) $auth=0; $reports_auth=0; $admin_auth=0; - $auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); + $auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -220,6 +221,13 @@ if ( (!preg_match("/\|$ip\|/", $server_ips)) and ($formIPvalid < 1) ) 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"; diff --git a/agc_2-X/trunk/www/vicidial/call_report_export.php b/agc_2-X/trunk/www/vicidial/call_report_export.php index b604624b..062a0741 100644 --- a/agc_2-X/trunk/www/vicidial/call_report_export.php +++ b/agc_2-X/trunk/www/vicidial/call_report_export.php @@ -5,7 +5,7 @@ # and/or vicidial_closer_log information by status, list_id and date range. # downloads to a flat text file that is tab delimited # -# Copyright (C) 2016 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -52,6 +52,7 @@ # 161017-1242 - Added DID custom variables to EXTENDED_3 output option # 161111-1232 - Fixed debug output to work with export # 161122-1136 - Added code to check for recordings in archived/non-archived tables if none found +# 170409-1547 - Added IP List validation code # $startMS = microtime(); @@ -189,7 +190,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -230,6 +231,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/call_report_export_carrier.php b/agc_2-X/trunk/www/vicidial/call_report_export_carrier.php index c9b61ac4..5d344ce7 100644 --- a/agc_2-X/trunk/www/vicidial/call_report_export_carrier.php +++ b/agc_2-X/trunk/www/vicidial/call_report_export_carrier.php @@ -6,7 +6,7 @@ # downloads to a flat text file that is tab delimited. This version also # attempts to link carrier and dial log entries to those calls. # -# Copyright (C) 2015 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -17,6 +17,7 @@ # 150903-1537 - Added compatibility for custom fields data options # 150909-0748 - Fixed issues with translated select list values, issue #885 # 160510-2100 - Added coding to remove tab characters from the data +# 170409-1542 - Added IP List validation code # $startMS = microtime(); @@ -114,7 +115,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -155,6 +156,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/callbacks_bulk_change.php b/agc_2-X/trunk/www/vicidial/callbacks_bulk_change.php index ef332afa..b285ed2b 100644 --- a/agc_2-X/trunk/www/vicidial/callbacks_bulk_change.php +++ b/agc_2-X/trunk/www/vicidial/callbacks_bulk_change.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # 120819-0119 - First build @@ -12,6 +12,7 @@ # 141007-2207 - Finalized adding QXZ translation to all admin files # 141229-2050 - Added code for on-the-fly language translations display # 161104-0702 - Added option to change callbacks to ANYONE callbacks +# 170409-1547 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -87,7 +88,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -101,6 +102,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/callbacks_bulk_move.php b/agc_2-X/trunk/www/vicidial/callbacks_bulk_move.php index 23aa911f..961aac4e 100644 --- a/agc_2-X/trunk/www/vicidial/callbacks_bulk_move.php +++ b/agc_2-X/trunk/www/vicidial/callbacks_bulk_move.php @@ -1,12 +1,13 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # 150218-0923 - First build based on callbacks_bulk_change.php # 151025-1041 - Fixed issue with check-all # 161105-0056 - Added options to purge uncalled callbacks, and also to revert callbacks to their most recent non-callback-dispo based on the callback entry time and the log tables. +# 170409-1548 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -115,7 +116,7 @@ if (strlen($list_id) < 1) {$category='LISTS'; $record_id=$list_id;} if (strlen($campaign_id) < 1) {$category='CAMPAIGNS'; $record_id=$campaign_id;} $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -129,6 +130,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/callcard_admin.php b/agc_2-X/trunk/www/vicidial/callcard_admin.php index 4d01b54d..75837d56 100644 --- a/agc_2-X/trunk/www/vicidial/callcard_admin.php +++ b/agc_2-X/trunk/www/vicidial/callcard_admin.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # This callcard script is to administer the callcard accounts in ViciDial # it is separate from the standard admin.php script. callcard_enabled in @@ -19,10 +19,11 @@ # 141007-2040 - Finalized adding QXZ translation to all admin files # 141229-2044 - Added code for on-the-fly language translations display # 160330-1551 - navigation changes and fixes +# 170409-1539 - Added IP List validation code # -$version = '2.12-11'; -$build = '160330-1551'; +$version = '2.14-12'; +$build = '170409-1539'; $MT[0]=''; @@ -166,7 +167,7 @@ if ($callcard_enabled < 1) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($USER,$PASS,'',1); +$auth_message = user_authorization($USER,$PASS,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -207,6 +208,13 @@ else echo "$VDdisplayMESSAGE: |$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: |$USER|$PASS|$auth_message|\n"; diff --git a/agc_2-X/trunk/www/vicidial/callcard_report_export.php b/agc_2-X/trunk/www/vicidial/callcard_report_export.php index c7153dc8..b0a0e569 100644 --- a/agc_2-X/trunk/www/vicidial/callcard_report_export.php +++ b/agc_2-X/trunk/www/vicidial/callcard_report_export.php @@ -5,7 +5,7 @@ # batch, pack and date range. # downloads to a flat text file that is tab delimited # -# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -15,6 +15,7 @@ # 130901-1938 - Changed to mysqli PHP functions # 141114-0048 - Finalized adding QXZ translation to all admin files # 141230-1348 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -90,7 +91,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -131,6 +132,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/called_counts_multilist_report.php b/agc_2-X/trunk/www/vicidial/called_counts_multilist_report.php index 5c9ced69..e8157060 100644 --- a/agc_2-X/trunk/www/vicidial/called_counts_multilist_report.php +++ b/agc_2-X/trunk/www/vicidial/called_counts_multilist_report.php @@ -1,7 +1,7 @@ , Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson , Matt Florell LICENSE: AGPLv2 # # This is a report designed for showing called counts similar to the results # at the bottom of each list detail screen, but for multiple lists and using @@ -15,6 +15,7 @@ # 141230-1346 - Added code for on-the-fly language translations display # 151229-2050 - Added archive search option # 160227-1036 - Uniform form format +# 170409-1539 - Added IP List validation code # $startMS = microtime(); @@ -148,7 +149,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -189,6 +190,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/campaign_debug.php b/agc_2-X/trunk/www/vicidial/campaign_debug.php index 2a7d60f1..c663336b 100644 --- a/agc_2-X/trunk/www/vicidial/campaign_debug.php +++ b/agc_2-X/trunk/www/vicidial/campaign_debug.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # 110514-1231 - First build @@ -12,6 +12,7 @@ # 140108-0726 - Added webserver and hostname to report logging # 141007-2209 - Finalized adding QXZ translation to all admin files # 141229-2042 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # $startMS = microtime(); @@ -76,7 +77,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -117,6 +118,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/closer-fronter_popup.php b/agc_2-X/trunk/www/vicidial/closer-fronter_popup.php index d72e27f5..0706e02a 100644 --- a/agc_2-X/trunk/www/vicidial/closer-fronter_popup.php +++ b/agc_2-X/trunk/www/vicidial/closer-fronter_popup.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system. # CHANGES @@ -15,6 +15,7 @@ # 130901-1933 - Changed to mysqli PHP functions # 141007-2210 - Finalized adding QXZ translation to all admin files # 141229-2040 - Added code for on-the-fly language translations display +# 170409-1532 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -157,7 +158,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -171,6 +172,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/closer-fronter_popup2.php b/agc_2-X/trunk/www/vicidial/closer-fronter_popup2.php index 2f981187..d15aec12 100644 --- a/agc_2-X/trunk/www/vicidial/closer-fronter_popup2.php +++ b/agc_2-X/trunk/www/vicidial/closer-fronter_popup2.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system. # CHANGES @@ -15,6 +15,7 @@ # 130901-1934 - Changed to mysqli PHP functions # 141007-2211 - Finalized adding QXZ translation to all admin files # 141229-2038 - Added code for on-the-fly language translations display +# 170409-1532 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -159,7 +160,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -173,6 +174,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/closer.php b/agc_2-X/trunk/www/vicidial/closer.php index e31c7181..96b62a0f 100644 --- a/agc_2-X/trunk/www/vicidial/closer.php +++ b/agc_2-X/trunk/www/vicidial/closer.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) # CHANGES @@ -15,6 +15,7 @@ # 130901-1934 - Changed to mysqli PHP functions # 141007-2212 - Finalized adding QXZ translation to all admin files # 141229-2041 - Added code for on-the-fly language translations display +# 170409-1532 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -108,7 +109,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -122,6 +123,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/closer_dispo.php b/agc_2-X/trunk/www/vicidial/closer_dispo.php index 04687b98..459030f1 100644 --- a/agc_2-X/trunk/www/vicidial/closer_dispo.php +++ b/agc_2-X/trunk/www/vicidial/closer_dispo.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # this is the closer disposition screen of a call that has been grabbed. This # allows the closer to modify customer information and disposition the call @@ -16,6 +16,7 @@ # 130901-1932 - Changed to mysqli PHP functions # 141007-2138 - Finalized adding QXZ translation to all admin files # 141229-2037 - Added code for on-the-fly language translations display +# 170409-1532 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -141,7 +142,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -155,6 +156,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/closer_popup.php b/agc_2-X/trunk/www/vicidial/closer_popup.php index 0d695aa8..377ea5ad 100644 --- a/agc_2-X/trunk/www/vicidial/closer_popup.php +++ b/agc_2-X/trunk/www/vicidial/closer_popup.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # this is the closer popup of a specific call that grabs the call and allows you # to go and fetch info on that caller in the local CRM system. @@ -16,6 +16,7 @@ # 130901-1931 - Changed to mysqli PHP functions # 141007-2213 - Finalized adding QXZ translation to all admin files # 141229-2035 - Added code for on-the-fly language translations display +# 170409-1532 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -109,7 +110,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -123,6 +124,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/fcstats.php b/agc_2-X/trunk/www/vicidial/fcstats.php index 485f4079..7518a702 100644 --- a/agc_2-X/trunk/www/vicidial/fcstats.php +++ b/agc_2-X/trunk/www/vicidial/fcstats.php @@ -35,6 +35,7 @@ # 160227-1131 - Uniform form format # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 170227-1717 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -146,7 +147,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -187,6 +188,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/fcstats_detail.php b/agc_2-X/trunk/www/vicidial/fcstats_detail.php index 83eec506..7777d8ae 100644 --- a/agc_2-X/trunk/www/vicidial/fcstats_detail.php +++ b/agc_2-X/trunk/www/vicidial/fcstats_detail.php @@ -36,6 +36,7 @@ # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 161021-1326 - Rewrote most of this report to show detail records # 170227-1718 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -160,7 +161,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -201,6 +202,13 @@ else 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"; @@ -770,10 +778,12 @@ if ($campaign_ct>0 || $user_group_ct>0 || $user_ct>0) { } function cmp($a, $b) -{ + { return strcmp($a[0], $b[0]); -} -usort($complete_xfer_log, "cmp"); + } + +if (count($complete_xfer_log)>0) + {usort($complete_xfer_log, "cmp");} if (count($complete_xfer_log)>0) { $output_header="+---------------------+-----------+----------------------+----------------------+------------+----------------------+------------+----------------------+----------------------+----------------------+---------------------+--------+\n"; diff --git a/agc_2-X/trunk/www/vicidial/functions.php b/agc_2-X/trunk/www/vicidial/functions.php index e4e0a248..471ec8c9 100644 --- a/agc_2-X/trunk/www/vicidial/functions.php +++ b/agc_2-X/trunk/www/vicidial/functions.php @@ -28,17 +28,18 @@ # 160802-1149 - Added hex2rgb function # 161102-0039 - Patched sec_convert function to display hours # 170227-2230 - Change to allow horizontal_bar_chart header to be translated, issue #991 +# 170409-1003 - Added IP List features to user_authorization # ##### BEGIN validate user login credentials, check for failed lock out ##### -function user_authorization($user,$pass,$user_option,$user_update) +function user_authorization($user,$pass,$user_option,$user_update,$api_call) { global $link; # require("dbconnect_mysqli.php"); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### - $stmt = "SELECT use_non_latin,webroot_writable,pass_hash_enabled,pass_key,pass_cost FROM system_settings;"; + $stmt = "SELECT use_non_latin,webroot_writable,pass_hash_enabled,pass_key,pass_cost,allow_ip_lists,system_ip_blacklist FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); @@ -50,6 +51,8 @@ function user_authorization($user,$pass,$user_option,$user_update) $SSpass_hash_enabled = $row[2]; $SSpass_key = $row[3]; $SSpass_cost = $row[4]; + $SSallow_ip_lists = $row[5]; + $SSsystem_ip_blacklist = $row[6]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -128,12 +131,85 @@ function user_authorization($user,$pass,$user_option,$user_update) } else { - if ($user_update > 0) + ##### BEGIN IP LIST FEATURES ##### + if ($SSallow_ip_lists > 0) { - $stmt="UPDATE vicidial_users set last_login_date=NOW(),last_ip='$ip',failed_login_count=0 where user='$user';"; + $ignore_ip_list=0; + $whitelist_match=1; + $blacklist_match=0; + $stmt="SELECT user_group,ignore_ip_list from vicidial_users where user='$user';"; + if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} $rslt=mysql_to_mysqli($stmt, $link); + $iipl_user_ct = mysqli_num_rows($rslt); + if ($iipl_user_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $user_group = $row[0]; + $ignore_ip_list = $row[1]; + } + if ($ignore_ip_list < 1) + { + $ip_class_c = preg_replace('~\.\d+(?!.*\.\d+)~', '.x', $ip); + + if (strlen($SSsystem_ip_blacklist) > 1) + { + $blacklist_match=1; + $stmt="SELECT count(*) from vicidial_ip_list_entries where ip_list_id='$SSsystem_ip_blacklist' and ip_address IN('$ip','$ip_class_c');"; + $rslt=mysql_to_mysqli($stmt, $link); + $vile_ct = mysqli_num_rows($rslt); + if ($vile_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $blacklist_match = $row[0]; + } + } + + $stmt="SELECT admin_ip_list,api_ip_list from vicidial_user_groups where user_group='$user_group';"; + $rslt=mysql_to_mysqli($stmt, $link); + $iipl_user_ct = mysqli_num_rows($rslt); + if ($iipl_user_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $admin_ip_list = $row[0]; + $api_ip_list = $row[1]; + + if ($api_call != '1') + {$check_ip_list = $admin_ip_list;} + else + {$check_ip_list = $api_ip_list;} + + if (strlen($check_ip_list) > 1) + { + $whitelist_match=0; + $stmt="SELECT count(*) from vicidial_ip_list_entries where ip_list_id='$check_ip_list' and ip_address IN('$ip','$ip_class_c');"; + $rslt=mysql_to_mysqli($stmt, $link); + $vile_ct = mysqli_num_rows($rslt); + if ($vile_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $whitelist_match = $row[0]; + } + } + } + } + + if ( ($whitelist_match < 1) or ($blacklist_match > 0) ) + { + $auth_key='IPBLOCK'; + $login_problem++; + } + } + ##### END IP LIST FEATURES ##### + + if ($login_problem < 1) + { + if ($user_update > 0) + { + $stmt="UPDATE vicidial_users set last_login_date=NOW(),last_ip='$ip',failed_login_count=0 where user='$user';"; + $rslt=mysql_to_mysqli($stmt, $link); + } + $auth_key='GOOD'; } - $auth_key='GOOD'; } return $auth_key; } diff --git a/agc_2-X/trunk/www/vicidial/group_hourly_stats.php b/agc_2-X/trunk/www/vicidial/group_hourly_stats.php index 48039b4d..9e44ce6b 100644 --- a/agc_2-X/trunk/www/vicidial/group_hourly_stats.php +++ b/agc_2-X/trunk/www/vicidial/group_hourly_stats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -19,6 +19,7 @@ # 141114-0043 - Finalized adding QXZ translation to all admin files # 141230-1343 - Added code for on-the-fly language translations display # 160325-1426 - Changes for sidebar update +# 170409-1539 - Added IP List validation code # $startMS = microtime(); @@ -88,7 +89,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -129,6 +130,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/help.php b/agc_2-X/trunk/www/vicidial/help.php index c38ae987..355259ef 100644 --- a/agc_2-X/trunk/www/vicidial/help.php +++ b/agc_2-X/trunk/www/vicidial/help.php @@ -120,6 +120,7 @@ # 170326-1135 - Added drop lists entries # 170327-1649 - updated the campaigns-use_custom_cid entry # 170407-0745 - Added Agents count on server page +# 170409-0939 - Added IP Lists entries # @@ -3619,6 +3620,21 @@ if ($SSoutbound_autodial_active > 0)
- +
+ +
+ - + +
+
+
+ - + +
+
+
+ - +

@@ -5347,6 +5363,16 @@ FR_SPAC 00 00 00 00 00 - - +
+
+
+ - + +
+
+
+ - +

@@ -5887,6 +5913,52 @@ FR_SPAC 00 00 00 00 00 -


+ +IP LISTS TABLE

+
+
+

+ +

+ +

+ +

+ +
+
+ - + +
+
+
+ - + +
+
+
+ - + +
+
+
+ - + +
+
+
+ - + + + + + + + +



STATUS_CATEGORIES TABLE

diff --git a/agc_2-X/trunk/www/vicidial/images/icon_iplists.png b/agc_2-X/trunk/www/vicidial/images/icon_iplists.png new file mode 100644 index 0000000000000000000000000000000000000000..5d93f1390612b6499e1b809fb05ba91d9c2f1254 GIT binary patch literal 1018 zcmVWFU8GbZ8()Nlj2>E@cM*00Ul0L_t(o!|j+&NK{c2 z$A2?^CJxwy5(H&YSteLm1W{2CL173L5ke3ZEoxB^w5dhy`;Zp3Da?g|o7xt+NR)CH zg+yu4H<@Lo4wE^~n>PP}%j3;B@A=*XqXUN zc^I#PjsVT_*B~Ku1Mnc%Hwy7l3z(3gG5Ki{NJ$H2z;9qm`^991gi9+-=6l}_GR1*= zK(`Pni#C10De;X!FK|l-FewgH3pUa78bPzK5LyH@D2-GZrC_}RF6(FOfI0^g-T)pN zWn7C6dCqSLMb(X2n_9MC`@BhYI^;s}iv*{&K|pBAhV>~4m$vzI%3_yHW$J8jzgnxU+wxuz#4 z7`1Fjl(xZW+5tu_17g$0y1-0-QWek#@m;`Ep%Ln;>~rw{4Ddz&uLF0Lie`cmbkO1I zV45olyqaZ?&l;}!J^w`1XA9Z8mj@)Xd%r5lgiW=s&=W# zI^c}%QI~;VE?g|4mQQ~e8rdo!81@r-^O=4bu-mwd6+)J-7bQk2OS%l&DfO>hA=AWs oDDy_uZL171kfMUx{}ed=1=+U|qX}0MaR2}S07*qoM6N<$f)vlWRR910 literal 0 HcmV?d00001 diff --git a/agc_2-X/trunk/www/vicidial/lead_report_export.php b/agc_2-X/trunk/www/vicidial/lead_report_export.php index d6268975..a04a6af8 100644 --- a/agc_2-X/trunk/www/vicidial/lead_report_export.php +++ b/agc_2-X/trunk/www/vicidial/lead_report_export.php @@ -5,7 +5,7 @@ # vicidial_log and/or vicidial_closer_log information by status, list_id and # date range. downloads to a flat text file that is tab delimited # -# Copyright (C) 2016 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -26,6 +26,7 @@ # 160420-1407 - Added archive search options # 160509-2155 - Added coding to remove tab characters from the data # 160914-2200 - Added option to grab reports by either call date or entry date +# 170409-1542 - Added IP List validation code # $startMS = microtime(); @@ -165,7 +166,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -206,6 +207,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/lead_tools.php b/agc_2-X/trunk/www/vicidial/lead_tools.php index 4d16abbb..839dd84d 100644 --- a/agc_2-X/trunk/www/vicidial/lead_tools.php +++ b/agc_2-X/trunk/www/vicidial/lead_tools.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell,Michael Cargile LICENSE: AGPLv2 # # CHANGES # 121110-1446 - Initial Build @@ -13,10 +13,11 @@ # 131016-2029 - Added links to advanced lead tools # 141007-2039 - Finalized adding QXZ translation to all admin files # 141229-2033 - Added code for on-the-fly language translations display +# 170409-1533 - Added IP List validation code # -$version = '2.10-9'; -$build = '141229-2033'; +$version = '2.14-10'; +$build = '170409-1533'; # This limit is to prevent data inconsistancies. # If there are too many leads in a list this @@ -113,7 +114,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -127,6 +128,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/lead_tools_advanced.php b/agc_2-X/trunk/www/vicidial/lead_tools_advanced.php index 5a792927..15705104 100644 --- a/agc_2-X/trunk/www/vicidial/lead_tools_advanced.php +++ b/agc_2-X/trunk/www/vicidial/lead_tools_advanced.php @@ -11,10 +11,11 @@ # 141229-2028 - Added code for on-the-fly language translations display # 150312-1508 - Allow for single quotes in vicidial_list data fields # 170225-1436 - Added date/time range options +# 170409-1554 - Added IP List validation code # -$version = '2.14-7'; -$build = '170225-1436'; +$version = '2.14-8'; +$build = '170409-1554'; # This limit is to prevent data inconsistancies. # If there are too many leads in a list this @@ -127,7 +128,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -141,6 +142,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/leadloader_template_display.php b/agc_2-X/trunk/www/vicidial/leadloader_template_display.php index 80b83aee..0735e2ac 100644 --- a/agc_2-X/trunk/www/vicidial/leadloader_template_display.php +++ b/agc_2-X/trunk/www/vicidial/leadloader_template_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell,Joe Johnson LICENSE: AGPLv2 # # CHANGES # 120402-2238 - First Build @@ -15,6 +15,7 @@ # 141007-2203 - Finalized adding QXZ translation to all admin files # 141229-2021 - Added code for on-the-fly language translations display # 150210-0619 - Fixed small display issue +# 170409-1534 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -88,7 +89,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -102,6 +103,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/list_download.php b/agc_2-X/trunk/www/vicidial/list_download.php index 8e5aa6f5..a11643f8 100644 --- a/agc_2-X/trunk/www/vicidial/list_download.php +++ b/agc_2-X/trunk/www/vicidial/list_download.php @@ -33,6 +33,7 @@ # 150727-2158 - Enabled user features for hiding phone numbers and lead data # 150903-1538 - Added compatibility for custom fields data options # 170306-0858 - Added proper report URL logging +# 170409-1556 - Added IP List validation code # $startMS = microtime(); @@ -108,7 +109,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -122,6 +123,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/list_merge.php b/agc_2-X/trunk/www/vicidial/list_merge.php index cd26225f..24172034 100644 --- a/agc_2-X/trunk/www/vicidial/list_merge.php +++ b/agc_2-X/trunk/www/vicidial/list_merge.php @@ -1,14 +1,15 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell,Joseph Johnson LICENSE: AGPLv2 # # CHANGES # 161004-2240 - Initial Build +# 170409-1548 - Added IP List validation code # -$version = '2.12-1'; -$build = '161004-2240'; +$version = '2.14-2'; +$build = '170409-1548'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -119,7 +120,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -133,6 +134,13 @@ if ($auth < 1) 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"; @@ -520,7 +528,12 @@ if (($submit != "submit" ) && ($confirm != "CONFIRM")) $i = 0; while ( $i < $allowed_lists_count ) { - if (in_array($list_ary[$i], $available_lists)) {$x="selected";} else {$x="";} + if (is_array($available_lists)) + { + if (in_array($list_ary[$i], $available_lists)) {$x="selected";} + else {$x="";} + } + else {$x="";} echo "\n"; $i++; } diff --git a/agc_2-X/trunk/www/vicidial/list_split.php b/agc_2-X/trunk/www/vicidial/list_split.php index 311cccb8..a36d5a77 100644 --- a/agc_2-X/trunk/www/vicidial/list_split.php +++ b/agc_2-X/trunk/www/vicidial/list_split.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell,Michael Cargile LICENSE: AGPLv2 # # CHANGES # 140916-1215 - Initial Build @@ -9,10 +9,11 @@ # 141229-1822 - Added code for on-the-fly language translations display # 150808-2042 - Added compatibility for custom fields data option # 161014-0842 - Added screen colors +# 170409-1542 - Added IP List validation code # -$version = '2.12-5'; -$build = '161014-0842'; +$version = '2.14-6'; +$build = '170409-1542'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -99,7 +100,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -113,6 +114,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/manager_chat_actions.php b/agc_2-X/trunk/www/vicidial/manager_chat_actions.php index aa6d07cf..6bffd36b 100644 --- a/agc_2-X/trunk/www/vicidial/manager_chat_actions.php +++ b/agc_2-X/trunk/www/vicidial/manager_chat_actions.php @@ -1,21 +1,22 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # Contains PHP actions for manager_chat_interface.php - works with vicidial_chat.js # # changes: -# 150605-2022 First Build +# 150605-2022 - First Build # 151213-1114 - Added variable filtering # 151218-0739 - Added translation where missing # 160107-2315 - Bug fix to prevent sending messages on dead chats # 160108-2300 - Changed some mysqli_query to mysql_to_mysqli for consistency # 161217-0821 - Added chat-type to allow for multi-user internal chat sessions +# 170409-1550 - Added IP List validation code # -$admin_version = '2.14-6'; -$build = '161217-0821'; +$admin_version = '2.14-7'; +$build = '170409-1550'; $sh="managerchats"; @@ -75,7 +76,7 @@ else } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -89,6 +90,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/manager_chat_interface.php b/agc_2-X/trunk/www/vicidial/manager_chat_interface.php index e46432b9..cba81062 100644 --- a/agc_2-X/trunk/www/vicidial/manager_chat_interface.php +++ b/agc_2-X/trunk/www/vicidial/manager_chat_interface.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # This page is for managers (level 8 or higher) to chat with live agents # @@ -13,10 +13,11 @@ # 160108-2300 - Changed some mysqli_query to mysql_to_mysqli for consistency # 161029-2127 - Fixed menu displays, text sizes # 161217-0819 - Added chat-type to allow for multi-user internal chat sessions +# 170409-1551 - Added IP List validation code # -$admin_version = '2.14-7'; -$build = '161217-0819'; +$admin_version = '2.14-8'; +$build = '170409-1551'; $sh="managerchats"; @@ -126,7 +127,7 @@ $user = $PHP_AUTH_USER; $add_copy_disabled=0; $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -140,6 +141,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/medialog_inventory_report.php b/agc_2-X/trunk/www/vicidial/medialog_inventory_report.php index 6802be0d..ffb6e243 100644 --- a/agc_2-X/trunk/www/vicidial/medialog_inventory_report.php +++ b/agc_2-X/trunk/www/vicidial/medialog_inventory_report.php @@ -1,7 +1,7 @@ , Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson , Matt Florell LICENSE: AGPLv2 # # This is a report designed for showing custom statistics based on client # requirements. This is not a standard VICIdial report. @@ -10,6 +10,7 @@ # 160411-1917 - First build based upon called_counts_multilist_report.php # 160412-2022 - Callback bug fixed, modified Total count to use modify_date instead of entry_date # 160427-1655 - Added called count categories +# 170409-1540 - Added IP List validation code # $startMS = microtime(); @@ -147,7 +148,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -188,6 +189,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/nanpa_type.php b/agc_2-X/trunk/www/vicidial/nanpa_type.php index 22ea228c..197215d8 100644 --- a/agc_2-X/trunk/www/vicidial/nanpa_type.php +++ b/agc_2-X/trunk/www/vicidial/nanpa_type.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # This script is designed to work with the NANPA exchange(NPA-NXX-X) data and # the wireless-to-wired and wired-to-wireless number portability data from @@ -29,10 +29,11 @@ # CHANGELOG: # 130822-1433 - First build of script # 140702-2251 - Added prefix phone type of V as landline +# 170409-1531 - Added IP List validation code # -$version = '2.10-2'; -$build = '140702-2251'; +$version = '2.14-3'; +$build = '170409-1531'; $startMS = microtime(); @@ -97,7 +98,7 @@ if ($function == 'version') ##### BEGIN user authentication for all functions below ##### $auth=0; -$auth_message = user_authorization($user,$pass,'REPORTS',1); +$auth_message = user_authorization($user,$pass,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -111,6 +112,13 @@ if ($auth < 1) echo "$VDdisplayMESSAGE: |$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 ("Content-type: text/html; charset=utf-8"); echo "$VDdisplayMESSAGE: |$user|$pass|$auth_message|\n"; exit; diff --git a/agc_2-X/trunk/www/vicidial/non_agent_api.php b/agc_2-X/trunk/www/vicidial/non_agent_api.php index 69452d02..a9e11991 100644 --- a/agc_2-X/trunk/www/vicidial/non_agent_api.php +++ b/agc_2-X/trunk/www/vicidial/non_agent_api.php @@ -115,10 +115,11 @@ # 170219-1520 - Added 90-day duplicate check option # 170223-0743 - Added QXZ translation to admin web user functions text # 170301-1649 - Added validation that sounds web dir exists to sounds_list function +# 170409-1603 - Added IP List validation code # -$version = '2.14-91'; -$build = '170301-1649'; +$version = '2.14-92'; +$build = '170409-1603'; $api_url_log = 0; $startMS = microtime(); @@ -701,7 +702,7 @@ if ($function == 'version') ##### BEGIN user authentication for all functions below ##### $auth=0; -$auth_message = user_authorization($user,$pass,'REPORTS',1); +$auth_message = user_authorization($user,$pass,'REPORTS',1,1); if ($auth_message == 'GOOD') {$auth=1;} @@ -715,6 +716,13 @@ if ($auth < 1) echo "$VDdisplayMESSAGE: |$user|$auth_message|\n"; exit; } + if ($auth_message == 'IPBLOCK') + { + $VDdisplayMESSAGE = "ERROR: 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 ("Content-type: text/html; charset=utf-8"); echo "$VDdisplayMESSAGE: |$user|$pass|$auth_message|\n"; exit; diff --git a/agc_2-X/trunk/www/vicidial/phone_stats.php b/agc_2-X/trunk/www/vicidial/phone_stats.php index b9743176..e6ac70c1 100644 --- a/agc_2-X/trunk/www/vicidial/phone_stats.php +++ b/agc_2-X/trunk/www/vicidial/phone_stats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # # changes: @@ -17,6 +17,7 @@ # 141114-0034 - Finalized adding QXZ translation to all admin files # 141128-0903 - Code cleanup for QXZ functions # 141230-0911 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -103,7 +104,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -144,6 +145,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/qc_api.php b/agc_2-X/trunk/www/vicidial/qc_api.php index c5791ff8..e1803e09 100644 --- a/agc_2-X/trunk/www/vicidial/qc_api.php +++ b/agc_2-X/trunk/www/vicidial/qc_api.php @@ -285,7 +285,7 @@ else else { $auth=0; - $auth_message = user_authorization($user,$pass,'',0); + $auth_message = user_authorization($user,$pass,'',0,0); if ($auth_message == 'GOOD') {$auth=1;} diff --git a/agc_2-X/trunk/www/vicidial/qc_call_client_iframe.php b/agc_2-X/trunk/www/vicidial/qc_call_client_iframe.php index 3da7d258..05686374 100644 --- a/agc_2-X/trunk/www/vicidial/qc_call_client_iframe.php +++ b/agc_2-X/trunk/www/vicidial/qc_call_client_iframe.php @@ -4,7 +4,7 @@ # ViciDial database administration modify lead in vicidial_list # # Copyright (C) 2012 poundteam.com LICENSE: AGPLv2 -# Copyright (C) 2014 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # This script is designed to allow QC review and modification of leads, contributed by poundteam.com # @@ -16,6 +16,7 @@ # 140706-0826 - Incorporated includes into code # 141007-2156 - Finalized adding QXZ translation to all admin files # 141229-2013 - Added code for on-the-fly language translations display +# 170409-1533 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -180,7 +181,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -194,6 +195,13 @@ if ($auth < 1) 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=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$PHP_AUTH_PW|$auth_message|\n"; diff --git a/agc_2-X/trunk/www/vicidial/qc_modify_lead.php b/agc_2-X/trunk/www/vicidial/qc_modify_lead.php index a5273ca4..26f435d8 100644 --- a/agc_2-X/trunk/www/vicidial/qc_modify_lead.php +++ b/agc_2-X/trunk/www/vicidial/qc_modify_lead.php @@ -1,12 +1,12 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # This script is designed to allow QC review and modification of leads, contributed by poundteam.com # @@ -24,6 +24,7 @@ # 150908-1531 - Fixed input lengths for several standard fields to match DB # 150917-1311 - Added dynamic default field maxlengths based on DB schema # 160611-1217 - Fixed for external server IP recording link issue +# 170409-1542 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -186,7 +187,7 @@ $VUselected_language = $rights_row[5]; if (strlen($phone_number)<6) {$phone_number=$old_phone;} $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -200,6 +201,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/realtime_report.php b/agc_2-X/trunk/www/vicidial/realtime_report.php index 697a33d0..aaa940f7 100644 --- a/agc_2-X/trunk/www/vicidial/realtime_report.php +++ b/agc_2-X/trunk/www/vicidial/realtime_report.php @@ -38,12 +38,13 @@ # 160803-1902 - Fixed issue with ERROR in campaign/ingroup name # 170318-0942 - Added websocket variable for embedded webphone # 170321-1145 - Added pause code time limits colors +# 170409-1557 - Added IP List validation code # $startMS = microtime(); -$version = '2.14-26'; -$build = '170321-1145'; +$version = '2.14-27'; +$build = '170409-1557'; header ("Content-type: text/html; charset=utf-8"); @@ -325,7 +326,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -366,6 +367,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/record_conf_1_hour.php b/agc_2-X/trunk/www/vicidial/record_conf_1_hour.php index bcb2b55f..e19821c0 100644 --- a/agc_2-X/trunk/www/vicidial/record_conf_1_hour.php +++ b/agc_2-X/trunk/www/vicidial/record_conf_1_hour.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # grab: $server_ip $station $session_id # @@ -14,6 +14,7 @@ # 130610-1109 - Finalized changing of all ereg instances to preg # 130616-2230 - Added filtering of input to prevent SQL injection attacks and new user auth # 130901-0857 - Changed to mysqli PHP functions +# 170409-1534 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -75,7 +76,7 @@ else $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -116,6 +117,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/recording_log_redirect.php b/agc_2-X/trunk/www/vicidial/recording_log_redirect.php index e8ca42f0..37787583 100644 --- a/agc_2-X/trunk/www/vicidial/recording_log_redirect.php +++ b/agc_2-X/trunk/www/vicidial/recording_log_redirect.php @@ -1,10 +1,11 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # CHANGELOG # 160116-1349 - First Build +# 170409-1538 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -65,7 +66,7 @@ else $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -81,6 +82,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/remote_dispo.php b/agc_2-X/trunk/www/vicidial/remote_dispo.php index 07f027f1..c79f32e5 100644 --- a/agc_2-X/trunk/www/vicidial/remote_dispo.php +++ b/agc_2-X/trunk/www/vicidial/remote_dispo.php @@ -157,7 +157,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REMOTE',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REMOTE',1,0); if ($auth_message == 'GOOD') {$auth=1;} diff --git a/agc_2-X/trunk/www/vicidial/reset_campaign_lists.php b/agc_2-X/trunk/www/vicidial/reset_campaign_lists.php index 839b6c59..ce68cdb9 100644 --- a/agc_2-X/trunk/www/vicidial/reset_campaign_lists.php +++ b/agc_2-X/trunk/www/vicidial/reset_campaign_lists.php @@ -1,7 +1,7 @@ , Joe Johnson LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell , Joe Johnson LICENSE: AGPLv2 # # CHANGES # 130711-2051 - First build @@ -9,10 +9,11 @@ # 141007-2058 - Finalized adding QXZ translation to all admin files # 141229-2009 - Added code for on-the-fly language translations display # 160508-2301 - Added colors features, fixed allowed campaigns bug +# 170409-1541 - Added IP List validation code # -$admin_version = '2.12-5'; -$build = '160508-2301'; +$admin_version = '2.14-6'; +$build = '170409-1541'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -81,7 +82,7 @@ $user_auth=0; $auth=0; $reports_auth=0; $qc_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1,0); if ($auth_message == 'GOOD') {$user_auth=1;} @@ -138,6 +139,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/send_CID_call.php b/agc_2-X/trunk/www/vicidial/send_CID_call.php index fecf3911..27a632a3 100644 --- a/agc_2-X/trunk/www/vicidial/send_CID_call.php +++ b/agc_2-X/trunk/www/vicidial/send_CID_call.php @@ -3,7 +3,7 @@ # # Send calls with custom callerID numbers from web form # -# Copyright (C) 2014 Matt Florell LICENSE: GPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: GPLv2 # # CHANGES # @@ -15,6 +15,7 @@ # 130901-0853 - Changed to mysqli PHP functions # 141007-2151 - Finalized adding QXZ translation to all admin files # 141229-2008 - Added code for on-the-fly language translations display +# 170409-1533 - Added IP List validation code # require("dbconnect_mysqli.php"); @@ -85,7 +86,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -99,6 +100,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/sph_report.php b/agc_2-X/trunk/www/vicidial/sph_report.php index 95d7510e..c5eeb904 100644 --- a/agc_2-X/trunk/www/vicidial/sph_report.php +++ b/agc_2-X/trunk/www/vicidial/sph_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -15,6 +15,7 @@ # 140108-0721 - Added webserver and hostname to report logging # 141114-0031 - Finalized adding QXZ translation to all admin files # 141230-0950 - Added code for on-the-fly language translations display +# 170409-1534 - Added IP List validation code # $startMS = microtime(); @@ -106,7 +107,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -147,6 +148,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/timeclock_edit.php b/agc_2-X/trunk/www/vicidial/timeclock_edit.php index 40df1b6b..0a260d9d 100644 --- a/agc_2-X/trunk/www/vicidial/timeclock_edit.php +++ b/agc_2-X/trunk/www/vicidial/timeclock_edit.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -18,6 +18,7 @@ # 141229-1905 - Added code for on-the-fly language translations display # 151203-1902 - Fix for javascript timezone issues in editing of timeclock entries # 160329-1610 - Fix for DST time and editing entries +# 170409-1539 - Added IP List validation code # header ("Content-type: text/html; charset=utf-8"); @@ -133,7 +134,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -163,6 +164,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/timeclock_report.php b/agc_2-X/trunk/www/vicidial/timeclock_report.php index 1a2e065f..41924d52 100644 --- a/agc_2-X/trunk/www/vicidial/timeclock_report.php +++ b/agc_2-X/trunk/www/vicidial/timeclock_report.php @@ -29,6 +29,7 @@ # 160714-2348 - Added and tested ChartJS features for more aesthetically appealing graphs # 161019-2253 - Added screen colors # 170227-1723 - Fix for default HTML report format, issue #997 +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -130,7 +131,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -171,6 +172,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/timeclock_status.php b/agc_2-X/trunk/www/vicidial/timeclock_status.php index cdc44403..3a654e38 100644 --- a/agc_2-X/trunk/www/vicidial/timeclock_status.php +++ b/agc_2-X/trunk/www/vicidial/timeclock_status.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -23,6 +23,7 @@ # 141007-2216 - Finalized adding QXZ translation to all admin files # 141229-1853 - Added code for on-the-fly language translations display # 161019-2254 - Added screen colors +# 170409-1544 - Added IP List validation code # #header ("Content-type: text/html; charset=utf-8"); @@ -121,7 +122,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -162,6 +163,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/user_group_bulk_change.php b/agc_2-X/trunk/www/vicidial/user_group_bulk_change.php index e6304a73..b1d6c5a7 100644 --- a/agc_2-X/trunk/www/vicidial/user_group_bulk_change.php +++ b/agc_2-X/trunk/www/vicidial/user_group_bulk_change.php @@ -19,6 +19,7 @@ # 160106-1318 - Added options.php option to disable this utility # 160325-1429 - Changes for sidebar update # 170217-1213 - Fixed non-latin auth issue #995 +# 170409-1553 - Added IP List validation code # header ("Content-type: text/html; charset=utf-8"); @@ -103,7 +104,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -117,6 +118,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/user_stats.php b/agc_2-X/trunk/www/vicidial/user_stats.php index 26706977..49717dfe 100644 --- a/agc_2-X/trunk/www/vicidial/user_stats.php +++ b/agc_2-X/trunk/www/vicidial/user_stats.php @@ -54,6 +54,7 @@ # 160508-0807 - Added colors features # 161030-0829 - Fixed excess load Issue #963 # 170228-1626 - Change to display emergency manager logout note +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -215,7 +216,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -256,6 +257,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/user_status.php b/agc_2-X/trunk/www/vicidial/user_status.php index 5dbe2a5e..9951d49c 100644 --- a/agc_2-X/trunk/www/vicidial/user_status.php +++ b/agc_2-X/trunk/www/vicidial/user_status.php @@ -39,6 +39,7 @@ # 161102-1041 - Fixed QM partition problem # 170217-1213 - Fixed non-latin auth issue #995 # 170228-1623 - Changed emergency logout to hangup all agent session calls, and more logging +# 170409-1555 - Added IP List validation code # $startMS = microtime(); @@ -173,7 +174,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -214,6 +215,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/user_territories.php b/agc_2-X/trunk/www/vicidial/user_territories.php index 1fb8bd0e..37c2ba1b 100644 --- a/agc_2-X/trunk/www/vicidial/user_territories.php +++ b/agc_2-X/trunk/www/vicidial/user_territories.php @@ -142,7 +142,7 @@ if ($sl_ct > 0) $auth=0; $modify_users_auth=0; -$auth_message = user_authorization($USER,$PASS,'',1); +$auth_message = user_authorization($USER,$PASS,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} diff --git a/agc_2-X/trunk/www/vicidial/vdremote.php b/agc_2-X/trunk/www/vicidial/vdremote.php index 390b116b..a2ed1db2 100644 --- a/agc_2-X/trunk/www/vicidial/vdremote.php +++ b/agc_2-X/trunk/www/vicidial/vdremote.php @@ -129,7 +129,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REMOTE',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REMOTE',1,0); if ($auth_message == 'GOOD') {$auth=1;} diff --git a/agc_2-X/trunk/www/vicidial/vicidial_custom_reports_admin.php b/agc_2-X/trunk/www/vicidial/vicidial_custom_reports_admin.php index 7f4ddb53..b82efb8b 100644 --- a/agc_2-X/trunk/www/vicidial/vicidial_custom_reports_admin.php +++ b/agc_2-X/trunk/www/vicidial/vicidial_custom_reports_admin.php @@ -5,11 +5,13 @@ # custom reports and make them available to user groups # of their choosing # -# Copyright (C) 2015 Joseph Johnson LICENSE: AGPLv2 +# Copyright (C) 2017 Joseph Johnson LICENSE: AGPLv2 # # CHANGES # # 151023-0106 - First build +# 170409-1542 - Added IP List validation code +# $startMS = microtime(); @@ -94,7 +96,7 @@ if ($sl_ct > 0) $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -135,6 +137,13 @@ else 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"; @@ -188,9 +197,12 @@ if (preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) { array_push($allowedUGarray, $user_group_row[0]); } - if (in_array('---ALL---',$custom_reports_user_groups)) + if (is_array($custom_reports_user_groups)) { - $custom_reports_user_groups=$allowedUGarray; + if (in_array('---ALL---',$custom_reports_user_groups)) + { + $custom_reports_user_groups=$allowedUGarray; + } } } diff --git a/agc_2-X/trunk/www/vicidial/vicidial_sales_viewer.php b/agc_2-X/trunk/www/vicidial/vicidial_sales_viewer.php index 5a992b91..40d426dd 100644 --- a/agc_2-X/trunk/www/vicidial/vicidial_sales_viewer.php +++ b/agc_2-X/trunk/www/vicidial/vicidial_sales_viewer.php @@ -68,7 +68,7 @@ $dcampaign = preg_replace('/[^0-9a-zA-Z]/', '', $dcampaign); $auth=0; $reports_auth=0; $admin_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} diff --git a/agc_2-X/trunk/www/vicidial/voice_lab.php b/agc_2-X/trunk/www/vicidial/voice_lab.php index 580b87d5..08092c09 100644 --- a/agc_2-X/trunk/www/vicidial/voice_lab.php +++ b/agc_2-X/trunk/www/vicidial/voice_lab.php @@ -108,7 +108,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -127,13 +127,10 @@ else $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $LOGfullname=$row[0]; - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n"); - fclose($fp); } else { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n"); - fclose($fp); + # nothing } $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER';";
\n"; echo ""; - $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,webphone_url_override,webphone_systemkey_override,webphone_dialpad_override,admin_viewable_groups,admin_viewable_call_times,agent_allowed_chat_groups,agent_xfer_park_3way from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL;"; + $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,webphone_url_override,webphone_systemkey_override,webphone_dialpad_override,admin_viewable_groups,admin_viewable_call_times,agent_allowed_chat_groups,agent_xfer_park_3way,admin_ip_list,agent_ip_list,api_ip_list from vicidial_user_groups where user_group='$user_group' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $user_group = $row[0]; @@ -30535,6 +30728,9 @@ if ($ADD==311111) $admin_viewable_call_times = $row[23]; $VGROUP_chatgroups = $row[24]; $agent_xfer_park_3way = $row[25]; + $admin_ip_list = $row[26]; + $agent_ip_list = $row[27]; + $api_ip_list = $row[28]; echo ""; @@ -30706,38 +30902,38 @@ if ($ADD==311111) echo "$NWB#user_groups-allowed_reports$NWE
"._QXZ("Allowed Custom Reports").":
"._QXZ("Allowed Custom Reports").": $NWB#user_groups-allowed_custom_reports$NWE
$ip_list_link_BEGIN"._QXZ("Admin IP Whitelist")."$ip_list_link_END: $NWB#user_groups-admin_ip_list$NWE
$ip_list_link_BEGIN"._QXZ("Agent IP Whitelist")."$ip_list_link_END: $NWB#user_groups-agent_ip_list$NWE
$ip_list_link_BEGIN"._QXZ("API IP Whitelist")."$ip_list_link_END: $NWB#user_groups-api_ip_list$NWE
"._QXZ("Allowed User Groups").":
$NWB#user_groups-admin_viewable_groups$NWE
\n"; if ($admin_viewable_groupsALL > 0) @@ -33858,10 +34121,6 @@ if ($ADD==393111111111) } - - - - ###################### # ADD=394111111111 modify automated report info in the system ###################### @@ -34003,7 +34262,203 @@ if ($ADD==394111111111) } +###################### +# ADD=395111111111 modify IP Lists screen +###################### +if ($ADD==395111111111) + { + echo "\n"; + echo "\n"; + + ##### get ip lists listing for dynamic pulldown + $stmt="SELECT ip_list_id,ip_list_name from vicidial_ip_lists where active='Y' order by ip_list_id;"; + $rsltx=mysql_to_mysqli($stmt, $link); + $iplists_to_print = mysqli_num_rows($rsltx); + $ip_list=''; + $o=0; + while ($iplists_to_print > $o) + { + $rowx=mysqli_fetch_row($rsltx); + $ip_list .= "\n"; + $o++; + } + + if (strlen($system_ip_blacklist) < 1) + { + $ip_list_link_BEGIN = ""; $ip_list_link_END = ""; + $ip_list_menu = "\n"; + } + else + { + $ip_list_link_BEGIN = ""; $ip_list_link_END = ""; + $ip_list_menu = "\n"; + $ip_list_menu .= "\n"; + } + + echo "\n"; + echo "\n"; echo "\n"; @@ -37505,6 +37993,63 @@ if ($ADD==194000000000) } +###################### +# ADD=195000000000 display all IP List entries +###################### +if ($ADD==195000000000) + { + echo "
\n"; + echo ""; + if ($LOGmodify_ingroups==1) + { + $stmt = "SELECT count(*) FROM vicidial_ip_lists where ip_list_id='$ip_list_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $vig_exists = $row[0]; + + if ($vig_exists > 0) + { + ### read in all ip_addresses in this IP List + $stmt = "SELECT ip_address FROM vicidial_ip_list_entries where ip_list_id='$ip_list_id' order by ip_address;"; + $rslt=mysql_to_mysqli($stmt, $link); + $vaf_ct = mysqli_num_rows($rslt); + $vaf=0; + while ($vaf_ct > $vaf) + { + $row=mysqli_fetch_row($rslt); + $vaf_list[$vaf] = $row[0]; + $vaf_count[$vaf] = 0; + $vaf++; + } + + $stmt_log=''; $log_notes=''; + if (strlen($ip_address) > 2) + { + $PN = explode("\n",$ip_address); + $PNct = count($PN); + $p=0; $ip_added=0; $ip_removed=0; + while ($p < $PNct) + { + if (strlen($PN[$p]) > 0) + { + $PN[$p] = preg_replace("/\r|\n|\t/",'',$PN[$p]); + $ac_found=0; + $vaf=0; + while ($vaf_ct > $vaf) + { + if ($PN[$p] == $vaf_list[$vaf]) + { + $vaf_count[$vaf]++; + $ac_found++; + } + $vaf++; + } + if ($ac_found < 1) + { + $stmt="SELECT count(*) from vicidial_ip_list_entries where ip_address='$PN[$p]' and ip_list_id='$ip_list_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] < 1) + { + $stmt="INSERT INTO vicidial_ip_list_entries (ip_address,ip_list_id) values('$PN[$p]','$ip_list_id');"; + $rslt=mysql_to_mysqli($stmt, $link); + $stmt_log .= "$stmt|"; + $ip_added++; + if ($DB > 0) {echo "Added ip_address $PN[$p]
\n";} + } + else + {if ($DB > 0) {echo "Skipped add, already exists: $PN[$p]
\n";}} + } + } + $p++; + } + + $vaf=0; + while ($vaf_ct > $vaf) + { + if ($vaf_count[$vaf] < 1) + { + $stmt="SELECT count(*) from vicidial_ip_list_entries where ip_address='$vaf_list[$vaf]' and ip_list_id='$ip_list_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt="DELETE FROM vicidial_ip_list_entries where ip_address='$vaf_list[$vaf]' and ip_list_id='$ip_list_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $stmt_log .= "$stmt|"; + $ip_removed++; + if ($DB > 0) {echo "Removed ip_address $vaf_list[$vaf]
\n";} + } + else + {if ($DB > 0) {echo "Skipped delete, already removed: $vaf_list[$vaf]
\n";}} + } + $vaf++; + } + $log_notes .= "$ip_added IPs Added|$ip_removed IPs Removed|"; + } + + if ( (strlen($ip_list_name) > 2) and (strlen($active) > 0) ) + { + $stmt="UPDATE vicidial_ip_lists set ip_list_name='$ip_list_name',active='$active',user_group='$user_group' where ip_list_id='$ip_list_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $stmt_log .= "$stmt|"; + $ILaffected_rows = mysqli_affected_rows($link); + if ($ILaffected_rows > 0) + {$log_notes .= "main entry edited|";} + } + else + { + $stmt="SELECT ip_list_id,ip_list_name,active,user_group from vicidial_ip_lists where ip_list_id='$ip_list_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $ip_list_id = $row[0]; + $ip_list_name = $row[1]; + $active = $row[2]; + $user_group = $row[3]; + } + + if (strlen($stmt_log) > 10) + { + echo "
"._QXZ("IP LIST MODIFIED").": $ip_list_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt_log|"; + $SQL_log = preg_replace('/;/', '', $SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='IPLISTS', event_type='MODIFY', record_id='$ip_list_id', event_code='ADMIN MODIFY IP LIST', event_sql=\"$SQL_log\", event_notes='$log_notes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + } + + ### read in all ip_addresses in this IP List + $stmt = "SELECT ip_address FROM vicidial_ip_list_entries where ip_list_id='$ip_list_id' order by ip_address;"; + $rslt=mysql_to_mysqli($stmt, $link); + $vaf_ct = mysqli_num_rows($rslt); + $vaf=0; $vaf_textarea=''; + while ($vaf_ct > $vaf) + { + $row=mysqli_fetch_row($rslt); + $vaf_textarea .= "$row[0]\n"; + $vaf++; + } + + echo "
"._QXZ("MODIFY IP LIST")."\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
"._QXZ("IP List").": $ip_list_id
"._QXZ("IP List Name").": $NWB#ip_lists-ip_list_name$NWE
"._QXZ("Active").": $NWB#ip_lists-active$NWE
"._QXZ("Admin User Group").": $NWB#ip_lists-user_group$NWE
"._QXZ("IP Addresses").":

("._QXZ("one ip address per line only").")
$NWB#ip_lists-ip_address$NWE

\n"; + + echo ""._QXZ("USER GROUPS USING THIS IP LIST").":
\n"; + echo "\n"; + $stmt="SELECT distinct user_group,group_name from vicidial_user_groups where ( (admin_ip_list='$ip_list_id') or (agent_ip_list='$ip_list_id') or (api_ip_list='$ip_list_id') ) $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $ugs_to_print = mysqli_num_rows($rslt); + $o=0; + while ($ugs_to_print > $o) + { + $row=mysqli_fetch_row($rslt); + echo "\n"; + $o++; + } + echo "
$row[0] $row[1]

\n"; + + } + else + { + echo _QXZ("You must use a valid IP List")."\n"; + exit; + } + + if ($LOGmodify_ip_lists > 0) + { + echo "

"._QXZ("DELETE THIS IP LIST")."\n"; + } + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) ) + { + echo "

"._QXZ("Click here to see Admin changes to this IP List")."
\n"; + } + } + else + { + echo _QXZ("You do not have permission to view this page")."\n"; + exit; + } + } @@ -34200,7 +34655,7 @@ if ($ADD==311111111111111) $ALLagent_count = $rowx[2]; } - $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,queuemetrics_socket,queuemetrics_socket_url,enhanced_disconnect_logging,allow_emails,level_8_disable_add,pass_hash_enabled,pass_key,pass_cost,disable_auto_dial,queuemetrics_record_hold,country_code_list_stats,reload_timestamp,queuemetrics_pause_type,frozen_server_call_clear,callback_time_24hour,allow_chats,chat_url,chat_timeout,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,agent_debug_logging,default_language,agent_whisper_enabled,user_hide_realtime_enabled,usacan_phone_dialcode_fix,cache_carrier_stats_realtime,oldest_logs_date,log_recording_access,report_default_format,alt_ivr_logging,default_phone_code,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,rec_prompt_count,agent_soundboards,web_loader_phone_length,agent_script,agent_chat_screen_colors,enable_auto_reports,enable_pause_code_limits,enable_drop_lists from system_settings;"; + $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password,admin_modify_refresh,nocache_admin,generate_cross_server_exten,queuemetrics_addmember_enabled,queuemetrics_dispo_pause,label_hide_field_logs,queuemetrics_pe_phone_append,test_campaign_calls,agents_calls_reset,default_voicemail_timezone,default_local_gmt,noanswer_log,alt_log_server_ip,alt_log_dbname,alt_log_login,alt_log_pass,tables_use_alt_log_db,did_agent_log,campaign_cid_areacodes_enabled,pllb_grouping_limit,did_ra_extensions_enabled,expanded_list_stats,contacts_enabled,call_menu_qualify_enabled,admin_list_counts,allow_voicemail_greeting,svn_revision,queuemetrics_socket,queuemetrics_socket_url,enhanced_disconnect_logging,allow_emails,level_8_disable_add,pass_hash_enabled,pass_key,pass_cost,disable_auto_dial,queuemetrics_record_hold,country_code_list_stats,reload_timestamp,queuemetrics_pause_type,frozen_server_call_clear,callback_time_24hour,allow_chats,chat_url,chat_timeout,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_did_entry_list_id,enable_third_webform,agent_debug_logging,default_language,agent_whisper_enabled,user_hide_realtime_enabled,usacan_phone_dialcode_fix,cache_carrier_stats_realtime,oldest_logs_date,log_recording_access,report_default_format,alt_ivr_logging,default_phone_code,admin_row_click,admin_screen_colors,ofcom_uk_drop_calc,agent_screen_colors,script_remove_js,manual_auto_next,user_new_lead_limit,agent_xfer_park_3way,rec_prompt_count,agent_soundboards,web_loader_phone_length,agent_script,agent_chat_screen_colors,enable_auto_reports,enable_pause_code_limits,enable_drop_lists,allow_ip_lists,system_ip_blacklist from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $version = $row[0]; @@ -34363,6 +34818,8 @@ if ($ADD==311111111111111) $enable_auto_reports = $row[157]; $enable_pause_code_limits = $row[158]; $enable_drop_lists = $row[159]; + $allow_ip_lists = $row[160]; + $system_ip_blacklist = $row[161]; if ($pass_hash_enabled > 0) {$pass_hash_enabled = 'ENABLED';} else {$pass_hash_enabled = 'DISABLED';} @@ -34643,6 +35100,37 @@ if ($ADD==311111111111111) echo "
"._QXZ("Call Menu Alt DTMF Logging").": $NWB#settings-alt_ivr_logging$NWE
"._QXZ("Allow IP Lists").": $NWB#settings-allow_ip_lists$NWE
$ip_list_link_BEGIN"._QXZ("System IP Blacklist")."$ip_list_link_END: $NWB#settings-system_ip_blacklist$NWE
"._QXZ("Level 8 Disable Add").": $NWB#settings-level_8_disable_add$NWE
"._QXZ("Script Text Remove JS").": $NWB#settings-script_remove_js$NWE
\n"; echo "\n"; } + if ($SSallow_ip_lists > 0) + { + echo " 0) {echo " onclick=\"window.document.location='$PHP_SELF?ADD=195000000000';\"";} echo ">\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } echo "
\n"; + echo " "; + + $stmt="SELECT ip_list_id,ip_list_name,active,user_group from vicidial_ip_lists $whereLOGadmin_viewable_groupsSQL order by ip_list_id;"; + $rslt=mysql_to_mysqli($stmt, $link); + $ip_lists_to_print = mysqli_num_rows($rslt); + + echo "
"._QXZ("IP LIST LISTINGS").":\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + while ($ip_lists_to_print > $o) + { + $row=mysqli_fetch_row($rslt); + $Xip_list_id[$o] = $row[0]; + $ip_list_name[$o] = $row[1]; + $active[$o] = $row[2]; + $admin_group[$o] = $row[3]; + $o++; + } + + $o=0; + while ($ip_lists_to_print > $o) + { + $stmt="SELECT count(*) from vicidial_ip_list_entries where ip_list_id=\"$Xip_list_id[$o]\";"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if (preg_match('/1$|3$|5$|7$|9$/i', $o)) + {$bgcolor='class="records_list_x"';} + else + {$bgcolor='class="records_list_y"';} + echo " 0) {echo " onclick=\"window.document.location='$PHP_SELF?ADD=395111111111&ip_list_id=$Xip_list_id[$o]'\"";} echo ">"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
"._QXZ("IP LIST ID").""._QXZ("NAME").""._QXZ("ACTIVE").""._QXZ("GROUP").""._QXZ("IPS").""._QXZ("MODIFY")."
$Xip_list_id[$o] $ip_list_name[$o] $active[$o] $admin_group[$o] $row[0]"._QXZ("MODIFY")."
\n"; + } + + ###################### # ADD=1000000000000 display all conferences ###################### @@ -38830,6 +39375,13 @@ if ($ADD==999998) echo "
"._QXZ("Automated Reports")."
"._QXZ("IP Lists")."
\n"; echo "
  \n"; } diff --git a/agc_2-X/trunk/www/vicidial/admin_NANPA_updater.php b/agc_2-X/trunk/www/vicidial/admin_NANPA_updater.php index b40bc5f8..7a9895e8 100644 --- a/agc_2-X/trunk/www/vicidial/admin_NANPA_updater.php +++ b/agc_2-X/trunk/www/vicidial/admin_NANPA_updater.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # This script is designed to launch NANPA filter batch proccesses through the # triggering process @@ -13,10 +13,11 @@ # 141007-1123 - Finalized adding QXZ translation to all admin files # 141230-0014 - Added code for on-the-fly language translations display # 160108-2300 - Changed some mysqli_query to mysql_to_mysqli for consistency +# 170409-1536 - Added IP List validation code # -$version = '2.12-6'; -$build = '160108-2300'; +$version = '2.14-7'; +$build = '170409-1536'; $startMS = microtime(); require("dbconnect_mysqli.php"); @@ -100,7 +101,7 @@ $user_auth=0; $auth=0; $reports_auth=0; $qc_auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'QC',1,0); if ($auth_message == 'GOOD') {$user_auth=1;} @@ -157,6 +158,13 @@ else 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_amm_multi.php b/agc_2-X/trunk/www/vicidial/admin_amm_multi.php index bad3227a..3488ce0c 100644 --- a/agc_2-X/trunk/www/vicidial/admin_amm_multi.php +++ b/agc_2-X/trunk/www/vicidial/admin_amm_multi.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 # # this screen will control the *amd* settings needed when the Campaign setting # "AM Message Wildcards" is enabled. This screen allows for multiple messages @@ -11,10 +11,11 @@ # changes: # 151109-1653 - First Build # 160801-1201 - Added colors features +# 170409-1544 - Added IP List validation code # -$admin_version = '2.12-2'; -$build = '160801-1201'; +$admin_version = '2.14-3'; +$build = '170409-1544'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -112,7 +113,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -126,6 +127,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_bulk_tools.php b/agc_2-X/trunk/www/vicidial/admin_bulk_tools.php index 2336e6a3..305e9513 100644 --- a/agc_2-X/trunk/www/vicidial/admin_bulk_tools.php +++ b/agc_2-X/trunk/www/vicidial/admin_bulk_tools.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Mike Coate, Mike Cargile, Matt Florell LICENSE: AGPLv2 # # This is the admin screen for various bulk copy/delete tools. # @@ -18,13 +18,15 @@ # 160801-1208 - Added colors features and added missing QXZ text output # 161218-1819 - Added CSV method to AC-CID # 161218-2144 - Added STATE FILL method to AC-CID and upped the max insertion limit to 5K 'cause why not?' +# 170409-1552 - Added IP List validation code # require("dbconnect_mysqli.php"); require("functions.php"); -$version = '2.14-13'; -$build = '161218-2144'; +$version = '2.14-14'; +$build = '170409-1552'; + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -150,7 +152,7 @@ if ($sl_ct > 0) # Valid user $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -164,6 +166,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_campaign_multi_alt.php b/agc_2-X/trunk/www/vicidial/admin_campaign_multi_alt.php index 1b491bc2..54a17f98 100644 --- a/agc_2-X/trunk/www/vicidial/admin_campaign_multi_alt.php +++ b/agc_2-X/trunk/www/vicidial/admin_campaign_multi_alt.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Matt Florell 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 @@ -19,10 +19,11 @@ # 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 # -$admin_version = '2.12-9'; -$build = '150728-1046'; +$admin_version = '2.14-10'; +$build = '170409-1535'; require("dbconnect_mysqli.php"); require("functions.php"); @@ -98,7 +99,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -112,6 +113,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_email_accounts.php b/agc_2-X/trunk/www/vicidial/admin_email_accounts.php index eb388567..46f05dac 100644 --- a/agc_2-X/trunk/www/vicidial/admin_email_accounts.php +++ b/agc_2-X/trunk/www/vicidial/admin_email_accounts.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2017 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # This page manages the inbound email accounts in ViciDial # @@ -21,10 +21,11 @@ # 160404-0936 - design changes # 160429-1123 - Added admin_row_click option # 160508-0139 - Added screen colors feature +# 170409-1540 - Added IP List validation code # -$admin_version = '2.12-15'; -$build = '160508-0139'; +$admin_version = '2.14-16'; +$build = '170409-1540'; $sh="emails"; @@ -180,7 +181,7 @@ if ($sl_ct > 0) } $auth=0; -$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1); +$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0); if ($auth_message == 'GOOD') {$auth=1;} @@ -194,6 +195,13 @@ if ($auth < 1) 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"; diff --git a/agc_2-X/trunk/www/vicidial/admin_header.php b/agc_2-X/trunk/www/vicidial/admin_header.php index 410a95ea..e8aa2202 100644 --- a/agc_2-X/trunk/www/vicidial/admin_header.php +++ b/agc_2-X/trunk/www/vicidial/admin_header.php @@ -70,9 +70,10 @@ # 161103-2136 - Added agent_soundboards option # 170113-1633 - Added dynamic call menu in-group option DYNAMIC_INGROUP_VAR for use with cm_phonesearch.agi # 170304-1354 - Added Automated Reports section to Admin +# 170409-0757 - Added IP Lists # -$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled,allow_emails,level_8_disable_add,allow_chats,enable_languages,admin_row_click,admin_screen_colors,user_new_lead_limit,user_territories_active,qc_features_active,agent_soundboards,enable_drop_lists from system_settings;"; +$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled,allow_emails,level_8_disable_add,allow_chats,enable_languages,admin_row_click,admin_screen_colors,user_new_lead_limit,user_territories_active,qc_features_active,agent_soundboards,enable_drop_lists,allow_ip_lists from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $admin_home_url_LU = $row[0]; @@ -90,6 +91,7 @@ $SSuser_territories_active = $row[11]; $SSqc_features_active = $row[12]; $SSagent_soundboards = $row[13]; $SSenable_drop_lists = $row[14]; +$SSallow_ip_lists = $row[15]; $SSmenu_background='015B91'; $SSframe_background='D9E6FE'; @@ -1941,6 +1943,7 @@ if ($subcamp_font_size < 4) {$subcamp_font_size='11';} $sg_sh="CLASS=\"subhead_style\""; $emails_sh="CLASS=\"subhead_style\""; $ar_sh="CLASS=\"subhead_style\""; + $il_sh="CLASS=\"subhead_style\""; if ($sh=='times') {$times_sh="CLASS=\"subhead_style_selected\"";} if ($sh=='shifts') {$shifts_sh="CLASS=\"subhead_style_selected\"";} @@ -1965,6 +1968,7 @@ if ($subcamp_font_size < 4) {$subcamp_font_size='11';} if ($sh=='sg') {$sg_sh="CLASS=\"subhead_style_selected\"";} if ($sh=='emails') {$emails_sh="CLASS=\"subhead_style_selected\"";} if ($sh=='ar') {$ar_sh="CLASS=\"subhead_style_selected\"";} + if ($sh=='il') {$il_sh="CLASS=\"subhead_style_selected\"";} ?>
>   -   \"Users\"
>   +   \"IP
    |  
    |  
    |