From 4fc48d259daf978c79597ec829501717812d77e4 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 12 Oct 2020 20:44:39 +0000 Subject: [PATCH] Added force change password feature functionality for the agent screen git-svn-id: svn://192.168.202.10@3304 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/www/agc/vicidial.php | 207 +++++++++++++++--- .../trunk/www/vicidial/help_documentation.txt | 4 +- 2 files changed, 183 insertions(+), 28 deletions(-) diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index c97d7d93..905c1729 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -646,10 +646,11 @@ # 200913-0817 - Added UNSELECTED options for campaign alt_number_dialing # 200922-0948 - Added manual_dial_phone_strip system setting feature # 201004-1112 - Added pause_max_exceptions campaign feature +# 201010-2223 - Added force change password feature # -$version = '2.14-614c'; -$build = '201004-1112'; +$version = '2.14-615c'; +$build = '201010-2223'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=92; $one_mysql_log=0; @@ -694,6 +695,12 @@ if (isset($_GET["LOGINvarFIVE"])) {$LOGINvarFIVE=$_GET["LOGINvarFIVE"];} elseif (isset($_POST["LOGINvarFIVE"])) {$LOGINvarFIVE=$_POST["LOGINvarFIVE"];} if (isset($_GET["hide_relogin_fields"])) {$hide_relogin_fields=$_GET["hide_relogin_fields"];} elseif (isset($_POST["hide_relogin_fields"])) {$hide_relogin_fields=$_POST["hide_relogin_fields"];} +if (isset($_GET["set_pass"])) {$set_pass=$_GET["set_pass"];} + elseif (isset($_POST["set_pass"])) {$set_pass=$_POST["set_pass"];} +if (isset($_GET["new_pass1"])) {$new_pass1=$_GET["new_pass1"];} + elseif (isset($_POST["new_pass1"])) {$new_pass1=$_POST["new_pass1"];} +if (isset($_GET["new_pass2"])) {$new_pass2=$_GET["new_pass2"];} + elseif (isset($_POST["new_pass2"])) {$new_pass2=$_POST["new_pass2"];} if (!isset($phone_login)) { @@ -731,6 +738,11 @@ $LOGINvarTHREE=preg_replace("/[^-_0-9a-zA-Z]/","",$LOGINvarTHREE); $LOGINvarFOUR=preg_replace("/[^-_0-9a-zA-Z]/","",$LOGINvarFOUR); $LOGINvarFIVE=preg_replace("/[^-_0-9a-zA-Z]/","",$LOGINvarFIVE); $hide_relogin_fields=preg_replace("/[^-_0-9a-zA-Z]/","",$hide_relogin_fields); +$set_pass=preg_replace("/\'|\"|\\\\|;| /","",$set_pass); +$new_pass1=preg_replace("/\'|\"|\\\\|;| /","",$new_pass1); +$new_pass2=preg_replace("/\'|\"|\\\\|;| /","",$new_pass2); +$JS_browser_width=preg_replace("/[^0-9a-z]/","",$JS_browser_width); +$JS_browser_height=preg_replace("/[^0-9a-z]/","",$JS_browser_height); $forever_stop=0; @@ -754,7 +766,7 @@ $VUselected_language = ''; $random = (rand(1000000, 9999999) + 10000000); -$stmt="SELECT user,selected_language from vicidial_users where user='$VD_login';"; +$stmt="SELECT user,selected_language,force_change_password from vicidial_users where user='$VD_login';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01081',$VD_login,$server_ip,$session_name,$one_mysql_log);} @@ -762,13 +774,14 @@ $sl_ct = mysqli_num_rows($rslt); if ($sl_ct > 0) { $row=mysqli_fetch_row($rslt); - $VUuser = $row[0]; - $VUselected_language = $row[1]; + $VUuser = $row[0]; + $VUselected_language = $row[1]; + $VUforce_change_password = $row[2]; } ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled,pllb_grouping_limit,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_third_webform,default_language,active_modules,allow_chats,chat_url,default_phone_code,agent_screen_colors,manual_auto_next,agent_xfer_park_3way,admin_web_directory,agent_script,agent_push_events,agent_push_url,agent_logout_link,agentonly_callback_campaign_lock,manual_dial_validation,mute_recordings,enable_second_script,enable_first_webform,recording_buttons,outbound_cid_any,browser_call_alerts,manual_dial_phone_strip FROM system_settings;"; +$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled,pllb_grouping_limit,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_third_webform,default_language,active_modules,allow_chats,chat_url,default_phone_code,agent_screen_colors,manual_auto_next,agent_xfer_park_3way,admin_web_directory,agent_script,agent_push_events,agent_push_url,agent_logout_link,agentonly_callback_campaign_lock,manual_dial_validation,mute_recordings,enable_second_script,enable_first_webform,recording_buttons,outbound_cid_any,browser_call_alerts,manual_dial_phone_strip,require_password_length,pass_hash_enabled FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -820,6 +833,8 @@ if ($qm_conf_ct > 0) $SSoutbound_cid_any = $row[41]; $SSbrowser_call_alerts = $row[42]; $SSmanual_dial_phone_strip = $row[43]; + $SSrequire_password_length = $row[44]; + $SSpass_hash_enabled = $row[45]; } else { @@ -1292,13 +1307,13 @@ if ($relogin == 'YES') if (!preg_match("/^YES$|^READONLY_LOGIN$|^READONLY_LOGINPHONE$/",$hide_relogin_fields)) { echo ""._QXZ("Phone Login:")." "; - echo "\n"; + echo "\n"; echo ""._QXZ("Phone Password:")." "; - echo "\n"; + echo "\n"; echo ""._QXZ("User Login").": "; - echo "\n"; + echo "\n"; echo ""._QXZ("User Password:")." "; - echo "\n"; + echo "\n"; } echo ""._QXZ("Campaign:")." "; echo "$camp_form_code\n"; @@ -1343,9 +1358,9 @@ if ($user_login_first == 1) echo "\n"; echo "   \n"; echo ""._QXZ("User Login").": "; - echo "\n"; + echo "\n"; echo ""._QXZ("User Password:")." "; - echo "\n"; + echo "\n"; echo ""._QXZ("Campaign:")." "; echo "$camp_form_code\n"; echo "   \n"; @@ -1395,13 +1410,13 @@ if ($user_login_first == 1) echo "\n"; echo "   \n"; echo ""._QXZ("Phone Login:")." "; - echo "\n"; + echo "\n"; echo ""._QXZ("Phone Password:")." "; - echo "\n"; + echo "\n"; echo ""._QXZ("User Login").": "; - echo "\n"; + echo "\n"; echo ""._QXZ("User Password:")." "; - echo "\n"; + echo "\n"; echo ""._QXZ("Campaign:")." "; echo "$camp_form_code\n"; echo "   \n"; @@ -1486,6 +1501,146 @@ else if($auth>0) { + if ($VUforce_change_password == 'Y') + { + echo "\n"; + + if ($DB > 0) + {$DBoutput = "\n";} + $set_pass_message = _QXZ("You are required to change your password. Please enter a new password below"); + if ($set_pass == '1') + { + $set_pass=2; + if ($new_pass1 != $new_pass2) + { + $set_pass_message = _QXZ("You must confirm your new password by typing it in twice"); + $set_pass=1; + } + if (strlen($new_pass1) < $SSrequire_password_length) + { + $set_pass_message = _QXZ("Your password is not long enough").', '.$SSrequire_password_length.' '._QXZ("characters minimum"); + $set_pass=1; + } + if ($set_pass == '2') + { + $pass_hash=''; + $pass_hashSQL=''; + if ($SSpass_hash_enabled > 0) + { + if (strlen($new_pass1) > 1) + { + $pass = preg_replace("/\'|\"|\\\\|;| /","",$new_pass1); + $pass_hash = exec("../agc/bp.pl --pass=$pass"); + $pass_hash = preg_replace("/PHASH: |\n|\r|\t| /",'',$pass_hash); + $pass_hashSQL = ",pass_hash='$pass_hash'"; + } + $new_pass1=''; + } + + $stmt="UPDATE vicidial_users SET force_change_password='N',pass='$new_pass1' $pass_hashSQL where user='$VD_login';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VUpassword_affected_rows = mysqli_affected_rows($link); + + echo ""._QXZ("Agent web client: Change Password")."\n"; + echo "\n"; + echo "\n"; + if ($hide_timeclock_link < 1) + {echo " "._QXZ("Timeclock")."

\n";} + echo "\n"; + echo "\n"; + echo "\n"; + echo "$DBoutput"; + echo "
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "


"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\"Agent "._QXZ("Password has been changed successfully")."
  \n"; + echo "

"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; + echo "
\n\n"; + echo "\n\n"; + echo "\n\n"; + exit; + } + } + if ( ($set_pass == '0') or (strlen($set_pass) < 1) ) + { + $set_pass=1; + } + echo ""._QXZ("Agent web client: Change Password")."\n"; + echo "\n"; + echo "\n"; + if ($hide_timeclock_link < 1) + {echo " "._QXZ("Timeclock")."

\n";} + echo "\n"; + echo "\n"; + echo "$DBoutput"; + echo "
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "


"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\"Agent $set_pass_message
"._QXZ("New Password").":  
"._QXZ("Confirm New Password").":  
  \n"; + echo "

"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; + echo "
\n\n"; + echo "\n\n"; + echo "\n\n"; + exit; + } + ##### grab the full name and other settings of the agent $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,agent_call_log_view_override,agent_choose_blended,agent_lead_search_override,preset_contact_search,max_inbound_calls,wrapup_seconds_override,email,user_choose_language,ready_max_logout,mute_recordings,max_inbound_filter_enabled,status_group_id from vicidial_users where user='$VD_login' and active='Y' and api_only_user != '1';"; $rslt=mysql_to_mysqli($stmt, $link); @@ -1834,8 +1989,8 @@ else echo "\n"; echo "\n"; echo "\n"; - echo ""._QXZ("Login").": \n
"; - echo ""._QXZ("Password").":
\n"; + echo ""._QXZ("Login").": \n
"; + echo ""._QXZ("Password").":
\n"; echo ""._QXZ("Campaign").": $camp_form_code
\n"; echo "   \n"; echo "\n"; @@ -2892,9 +3047,9 @@ else echo "\n"; echo "   \n"; echo ""._QXZ("User Login").": "; - echo "\n"; + echo "\n"; echo ""._QXZ("User Password:")." "; - echo "\n"; + echo "\n"; echo ""._QXZ("Campaign:")." "; echo "$camp_form_code\n"; echo "   \n"; @@ -2998,9 +3153,9 @@ else echo "\n"; echo "  
"._QXZ("Sorry, your phone login and password are not active in this system, please try again:")."
 
\n"; echo ""._QXZ("Phone Login:")." "; - echo "\n"; + echo "\n"; echo ""._QXZ("Phone Password:")." "; - echo "\n"; + echo "\n"; echo "\n"; echo "
"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; echo "\n"; @@ -3870,8 +4025,8 @@ else echo "\n"; echo "\n"; echo "\n"; - echo ""._QXZ("Login:")." \n
"; - echo ""._QXZ("Password:")."
\n"; + echo ""._QXZ("Login:")." \n
"; + echo ""._QXZ("Password:")."
\n"; echo ""._QXZ("Campaign:")." $camp_form_code
\n"; echo "   \n"; echo "\n"; @@ -3903,8 +4058,8 @@ else echo "\n"; echo "\n"; echo "\n"; - echo ""._QXZ("Login:")." \n
"; - echo ""._QXZ("Password:")."
\n"; + echo ""._QXZ("Login:")." \n
"; + echo ""._QXZ("Password:")."
\n"; echo ""._QXZ("Campaign:")." $camp_form_code
\n"; echo "   \n"; echo "\n"; diff --git a/agc_2-X/trunk/www/vicidial/help_documentation.txt b/agc_2-X/trunk/www/vicidial/help_documentation.txt index d8956089..c422567e 100644 --- a/agc_2-X/trunk/www/vicidial/help_documentation.txt +++ b/agc_2-X/trunk/www/vicidial/help_documentation.txt @@ -1,7 +1,7 @@ -# version: 202001004105201 +# version: 202001012164301 users-user User ID This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length. users-pass Password This field is where you put the users password. Must be at least 2 characters in length. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters. -users-force_change_password Force Change Password If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N. +users-force_change_password Force Change Password If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N. users-last_login_date Last Login Info This shows the last login attempt date and time, and if there has been a recent failed login attempt. If this modify user form is submitted, then the failed login attempt counter will be reset and the agent can immediately attempt to log in again. If an agent has 10 failed login attempts in a row then they cannot attempt to log in again for at least 15 minutes unless their account is manually reset. users-full_name Full Name This field is where you put the users full name. Must be at least 2 characters in length. users-user_level User Level This menu is where you select the users user level. Must be a level of 1 to log into the agent screen, Must be level greater than 2 to log in as a closer, level 7 is for Reports only. Must be user level 8 or greater to get into admin web section. User Level 9 is able to edit all user levels in the admin web section. User Level 8 can only edit level 7 users and lower.