From 64831634a41a0cf4184484cd0778d4025b37bce1 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 18 Jun 2009 11:14:13 +0000 Subject: [PATCH] fix to audio store for proxy or tunneled users git-svn-id: svn://192.168.202.10@1158 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/www/vicidial/audio_store.php | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/agc_2-X/trunk/www/vicidial/audio_store.php b/agc_2-X/trunk/www/vicidial/audio_store.php index 5dfcd532..68d3dc22 100644 --- a/agc_2-X/trunk/www/vicidial/audio_store.php +++ b/agc_2-X/trunk/www/vicidial/audio_store.php @@ -6,11 +6,12 @@ # Central Audio Storage script # # CHANGES -# 90511-1325 - first build +# 90511-1325 - First build +# 90618-0640 - Fix for users going through proxy or tunnel # -$version = '2.2.0-1'; -$build = '90511-1325'; +$version = '2.2.0-2'; +$build = '90618-0640'; $MT[0]=''; @@ -104,13 +105,16 @@ while ($sv_conf_ct > $i) $server_ips .= "$row[0]|"; $i++; } + +$user_set=0; $ip = getenv("REMOTE_ADDR"); if (!preg_match("/\|$ip\|/", $server_ips)) { + $user_set=1; $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; - $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); - $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1'"; if ($DB) {echo "|$stmt|\n";} @@ -205,6 +209,13 @@ if ($action == "AUTOUPLOAD")