Added settings for languages for users
Added on-the-fly language use for the agent screen Standardization of filtering of user/pass variables in agent scripts git-svn-id: svn://192.168.202.10@2221 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -65,8 +65,12 @@
|
||||
# 140811-0848 - Changed to use QXZ function for echoing text
|
||||
# 141118-1230 - Formatting changes for QXZ output
|
||||
# 141125-0947 - Using pass hashes in AJAX
|
||||
# 141216-2115 - Added language settings lookups and user/pass variable standardization
|
||||
#
|
||||
|
||||
$version = '2.2.6-1';
|
||||
$build = '141216-2110';
|
||||
|
||||
require_once("dbconnect_mysqli.php");
|
||||
require_once("functions.php");
|
||||
|
||||
@@ -97,17 +101,49 @@ $user_abb = "$user$user$user$user";
|
||||
while ( (strlen($user_abb) > 4) and ($forever_stop < 200) )
|
||||
{$user_abb = preg_replace("/^./","",$user_abb); $forever_stop++;}
|
||||
|
||||
$version = '2.2.6-1';
|
||||
$build = '141125-0947';
|
||||
|
||||
### security strip all non-alphanumeric characters out of the variables ###
|
||||
$DB=preg_replace("/[^0-9a-z]/","",$DB);
|
||||
$phone_login=preg_replace("/[^0-9a-zA-Z]/","",$phone_login);
|
||||
$phone_pass=preg_replace("/[^0-9a-zA-Z]/","",$phone_pass);
|
||||
$user=preg_replace("/[^0-9a-zA-Z]/","",$user);
|
||||
$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
|
||||
$DB=preg_replace("/[^0-9a-z]/","",$DB);
|
||||
$phone_login=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_login);
|
||||
$phone_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_pass);
|
||||
$user=preg_replace("/\'|\"|\\\\|;| /","",$user);
|
||||
$pass=preg_replace("/\'|\"|\\\\|;| /","",$pass);
|
||||
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP #####
|
||||
$VUselected_language = '';
|
||||
$stmt="SELECT selected_language from vicidial_users where user='$user';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$sl_ct = mysqli_num_rows($rslt);
|
||||
if ($sl_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$VUselected_language = $row[0];
|
||||
}
|
||||
|
||||
$stmt = "SELECT use_non_latin,enable_languages,language_method FROM system_settings;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysqli_num_rows($rslt);
|
||||
if ($qm_conf_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$SSenable_languages = $row[1];
|
||||
$SSlanguage_method = $row[2];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
|
||||
$pass=preg_replace("/[^-_0-9a-zA-Z]/","",$pass);
|
||||
}
|
||||
|
||||
if ($force_logout)
|
||||
{
|
||||
if( (strlen($_SERVER['user'])>0) or (strlen($_SERVER['pass'])>0) )
|
||||
|
||||
Reference in New Issue
Block a user