]> git.entuzijast.net Git - freeradius-dialup-admin.git/commitdiff
* A LOT of security related fixes. Now dialupadmin should hopefully be secure enough to
authorkkalev <kkalev>
Mon, 26 Jul 2004 20:37:38 +0000 (20:37 +0000)
committerkkalev <kkalev>
Mon, 26 Jul 2004 20:37:38 +0000 (20:37 +0000)
  be accessed by normal users (not administrators).
* Move a few elements in the CSS file from the body tag. Suggestion by Gary McKinney
* Update FAQ about using php with no sql support.
* Allow the user to select between viewing FAQ,HOWTO or README in the help page.
* Use $_SERVER instead of $HTTP_SERVER_VARS

46 files changed:
Changelog
conf/config.php3
doc/FAQ
htdocs/about.html
htdocs/accounting.php3
htdocs/badusers.php3
htdocs/buttons.php3
htdocs/clear_opensessions.php3
htdocs/content.html
htdocs/failed_logins.php3
htdocs/find.php3
htdocs/group_admin.php3
htdocs/group_new.php3
htdocs/help/help.php3
htdocs/login_time_create.php3
htdocs/nas_admin.php3
htdocs/session_destroy.php3
htdocs/show_groups.php3
htdocs/stats.php3
htdocs/style.css
htdocs/user_accounting.php3
htdocs/user_admin.php3
htdocs/user_delete.php3
htdocs/user_edit.php3
htdocs/user_finger.php3
htdocs/user_info.php3
htdocs/user_new.php3
htdocs/user_stats.php3
htdocs/user_test.php3
html/buttons/default/buttons.html.php3
html/user_admin.html.php3
lib/acctshow.php3
lib/add_badusers.php3
lib/attrshow.php3
lib/defaults.php3
lib/ldap/attrmap.php3
lib/ldap/functions.php3
lib/ldap/user_info.php3
lib/sql/attrmap.php3
lib/sql/change_attrs.php3
lib/sql/change_passwd.php3
lib/sql/create_group.php3
lib/sql/create_user.php3
lib/sql/find.php3
lib/sql/nas_list.php3
lib/xlat.php3

index 0020ba9930e3d6c479e6574360c670273a9827f3..24bf5bd1775d76b50549db1f3c52723a5ba8406f 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,10 @@
+Ver 1.75:
+* A LOT of security related fixes. Now dialupadmin should hopefully be secure enough to
+  be accessed by normal users (not administrators).
+* Move a few elements in the CSS file from the body tag. Suggestion by Gary McKinney
+* Update FAQ about using php with no sql support.
+* Allow the user to select between viewing FAQ,HOWTO or README in the help page.
+* Use $_SERVER instead of $HTTP_SERVER_VARS
 Ver 1.72:
 * Move the xlat function to a separate file in lib/xlat.php3
 * Add a lib/sql/nas_list.php3 to also get the nas list from sql (naslist.conf still works)
@@ -20,6 +27,8 @@ Ver 1.72:
 * Set general_restrict_nasadmin_access to no by default. It causes confusion.
 * Set the general_username_mappings_file variable
 * Fix a small error in lib/sql/find.php3. This closes bug #103
+* Add a small note in the FAQ about checking for sql/ldap driver availability in PHP if the user get's
+  a blank white page back.
 Ver 1.70:
 * Add the /bin postgresql compatibility patch from Guy Fraser
 * Add ldap_userdn as a configuration directive. If set we use that for
index 1001eabbdb1dae7df73c32fc2e1611a65d17b145..adc99ae1f1d22ea2b2d0d2dea0be0ad7289ea036 100644 (file)
@@ -9,12 +9,17 @@ if( $curVer >= $testVer )
 # If using sessions set use_session to 1 to also cache the config file
 #
 $use_session = 0;
+unset($config);
+unset($nas_list);
 if ($use_session){
        // Start session
        @session_start();
+       if (isset($_SESSION['config']))
+               $config = $_SESSION['config'];
+       if (isset($_SESSION['nas_list']))
+               $nas_list = $_SESSION['nas_list'];
 }
 if (!isset($config)){
-       unset($nas_list);
        $ARR=file("../conf/admin.conf");
        $EXTRA_ARR = array();
        foreach($ARR as $val) {
@@ -61,10 +66,12 @@ if (!isset($config)){
 if ($use_session == 0 && $config[general_use_session] == 'yes'){
        // Start session
        @session_start();
+       if (isset($nas_list))
+               session_register('nas_list');
 }
 //Make sure we are only passed allowed strings in username
 if ($login != '')
-       $login = preg_replace("/[^\w\s\.\/\@\:]\-i\=/",'',$login);
+       $login = preg_replace("/[^\w\s\.\/\@\:]/",'',$login);
 
 if ($login != '' && $config[general_strip_realms] == 'yes'){
        $realm_del = ($config[general_realm_delimiter] != '') ? $config[general_realm_delimiter] : '@';
@@ -73,6 +80,9 @@ if ($login != '' && $config[general_strip_realms] == 'yes'){
        if (count($new) == 2)
                $login = ($realm_for == 'suffix') ? $new[0] : $new[1];
 }
+unset($mappings);
+if (isset($_SESSION['mappings']))
+       $mappings = $_SESSION['mappings'];
 if (!isset($mappings) && $config[general_username_mappings_file] != ''){
        $ARR = file($config[general_username_mappings_file]);
        foreach($ARR as $val){
diff --git a/doc/FAQ b/doc/FAQ
index 9c2b211b9b47152c080d8547fd4fcc193988fa62..7c7b13cdc1b33243a6d5f61f095b92dab301fd25 100644 (file)
--- a/doc/FAQ
+++ b/doc/FAQ
@@ -81,6 +81,13 @@ Set general_prefered_lang to en
 
 If you are using sessions then remember to use the 'Clear Cache' page after making any changes
 
+>
+> When i try to access a dynamic web page it only shows a blank white page
+>
+
+You may have not enabled support for the corresponding sql driver in PHP. If you are also using ldap, check for
+php ldap support.
+
 >
 > It is still not working
 >
index 8e4201ecdba9aad1dfc593a0601fcfc54cdaae8e..65172e8f3123ba6b244f83bbfa35bdecbdf66e3c 100644 (file)
@@ -3,7 +3,7 @@
 <title>About page</title>
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
index db57b45bc0b4bfd921ebfd5fa7d76454d35745ad..5f618cb2f5f72f1ab703d3f7d69e17858cc93230 100644 (file)
@@ -15,7 +15,7 @@ else{
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Could not include SQL library functions. Aborting</b>
 </body>
@@ -33,6 +33,8 @@ $link = @da_sql_pconnect ($config) or die('cannot connect to sql databse');
 $fields = @da_sql_list_fields($config[sql_accounting_table],$link,$config);
 $no_fields = @da_sql_num_fields($fields,$config);
 
+unset($items);
+
 for($i=0;$i<$no_fields;$i++){
        $key = strtolower(@da_sql_field_name($fields,$i,$config));
        $val = $sql_attrs[$key][desc];
@@ -109,7 +111,7 @@ EOM;
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 
 <?php
 if(!$queryflag) {
@@ -222,12 +224,20 @@ while (${"item_of_w$i"}){
 
 $order = ($order_by != '') ? "$order_by" : 'username';
 
+if (preg_match("/[\s;]/",$order))
+       die("ORDER BY pattern is illegal. Exiting abnornally.");
+
+if (!is_numeric($maxresults))
+       die("Max Results is not in numeric form. Exiting abnormally.");
+
+unset($query_view);
 foreach ($accounting_show_attrs as $val)
        $query_view .= $val . ',';
 $query_view = ereg_replace(',$','',$query_view);
-$sql_extra_query = '';
+unset($sql_extra_query);
 if ($config[sql_accounting_extra_query] != '')
        $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
+       $sql_extra_query = da_sql_escape_string($sql_extra_query);
 $query="SELECT $query_view FROM $config[sql_accounting_table] $where $sql_extra_query ORDER BY $order LIMIT $maxresults;";
 
 echo <<<EOM
@@ -235,7 +245,7 @@ echo <<<EOM
 <head>
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <br>
 <table border=0 width=940 cellpadding=1 cellspacing=1>
 <tr valign=top>
index fa560a9575c026b5856d3c2725348423b4ce0885..c179a8cb70473470044e892684662c33455954ff 100644 (file)
@@ -13,7 +13,7 @@ else{
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Could not include SQL library functions. Aborting</b>
 </body>
@@ -48,7 +48,7 @@ echo <<<EOM
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
@@ -79,7 +79,7 @@ if ($link){
                $row = @da_sql_fetch_array($search,$config);
                if ($row[id] == $row_id){
                        $admin = "$row[Admin]";
-                       if (($admin != '-' && $HTTP_SERVER_VARS["PHP_AUTH_USER"] == $admin) || $admin == '-'){
+                       if (($admin != '-' && $_SERVER["PHP_AUTH_USER"] == $admin) || $admin == '-'){
                                $sql_servers = array();
                                if ($config[sql_extra_servers] != '')
                                        $sql_servers = explode(' ',$config[sql_extra_servers]);
@@ -137,7 +137,7 @@ EOM;
        </tr>
 
 <?php
-$auth_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
+$auth_user = $_SERVER["PHP_AUTH_USER"];
 if ($config[general_restrict_badusers_access] == 'yes'){
        $auth_user = da_sql_escape_string($auth_user);
        $extra_query = "AND Admin == '$auth_user'";
index 12c2c32b7c5bfeb5d3fd5b6154f0f94ef9b39b68..6a16eefb13aec1321aa9bf900f71083c540f800c 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-$auth_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
+$auth_user = $_SERVER["PHP_AUTH_USER"];
 if ($auth_user){
        if (is_file("../html/buttons/$auth_user/buttons.html.php3"))
                include("../html/buttons/$auth_user/buttons.html.php3");
index 21b5d14f0272f6617acca003c87d2668427ab03b..979aa6595d368611472d7b2e137e6ad74717bb16 100644 (file)
@@ -9,7 +9,7 @@ else{
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Could not include SQL library functions. Aborting</b>
 </body>
@@ -25,7 +25,7 @@ echo <<<EOM
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
@@ -41,8 +41,10 @@ include("../html/user_toolbar.html.php3");
 $open_sessions = 0;
 
 $sql_extra_query = '';
-if ($config[sql_accounting_extra_query] != '')
+if ($config[sql_accounting_extra_query] != ''){
        $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
+       $sql_extra_query = da_sql_escape_string($sql_extra_query);
+}
 
 print <<<EOM
 </table>
index d8fa823dcb3928fc8c6fd62380b56c19d2cc048e..cbc05c4adb43b44d5ff41884cac8d6cfc9482364 100644 (file)
@@ -1,5 +1,5 @@
 <html>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center><img src="images/title2.gif">
 <br><font size=+1><br>
 <b>A web based administration interface for the freeradius radius server</b>
index f9dc7b93142dd0a267eb3ea97bd7e33dcd2ca7cf..d2ee47ef6777fceebd7f8994b97cd4574c92409d 100644 (file)
@@ -15,7 +15,7 @@ else{
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Could not include SQL library functions. Aborting</b>
 </body>
@@ -25,8 +25,10 @@ EOM;
 }
 
 $now = time();
-if ($last == 0)
+if (!isset($last))
        $last = ($config[general_most_recent_fl]) ? $config[general_most_recent_fl] : 5;
+if (!is_numeric($last))
+       $last = 5;
 $start = $now - ($last*60);
 $now_str = date($config[sql_full_date_format],$now);
 $prev_str = date($config[sql_full_date_format],$start);
@@ -52,6 +54,10 @@ if ($server != '' && $server != 'all'){
        $server_str = "AND nasipaddress = '$server'";
 }
 
+unset($da_name_cache);
+if (isset($_SESSION['da_name_cache']))
+       $da_name_cache = $_SESSION['da_name_cache'];
+
 ?>
 
 <head>
@@ -59,7 +65,7 @@ if ($server != '' && $server != 'all'){
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
@@ -97,9 +103,11 @@ if ($acct_attrs['fl'][2] != '') echo "<th>" . $acct_attrs['fl'][2] . "</th>\n";
 if ($acct_attrs['fl'][7] != '') echo "<th>" . $acct_attrs['fl'][7] . "</th>\n";
 if ($acct_attrs['fl'][8] != '') echo "<th>" . $acct_attrs['fl'][8] . "</th>\n";
 if ($acct_attrs['fl'][9] != '') echo "<th>" . $acct_attrs['fl'][9] . "</th>\n";
-$sql_extra_query = '';
-if ($config[sql_accounting_extra_query] != '')
+unset($sql_extra_query);
+if ($config[sql_accounting_extra_query] != ''){
        $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
+       $sql_extra_query = da_sql_escape_string($sql_extra_query);
+}
 ?>
        </tr>
 
index 94c6ed6e1914810383be7c65198cd8df3726d72c..bde88d54feca355730c70c4de8675e8314d86a1b 100644 (file)
@@ -10,7 +10,7 @@ $max = ($max_results) ? $max_results : 40;
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
@@ -36,6 +36,7 @@ $max = ($max_results) ? $max_results : 40;
 
 <?php
 if ($find_user == 1){
+       unset($found_users);
        if (is_file("../lib/$config[general_lib_type]/find.php3"))
                include("../lib/$config[general_lib_type]/find.php3");
        if (isset($found_users)){
index 535536da719e3788f9533e8a7bb4c239bf5fdb1f..6f60f5cb4f17fbe5cbeea1aae3226a6a44a89a93 100644 (file)
@@ -10,7 +10,7 @@ if ($config[general_lib_type] != 'sql'){
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>This page is only available if you are using sql as general library type</b>
 </body>
@@ -19,6 +19,7 @@ EOM;
        exit();
 }
 
+unset($group_members);
 if (is_file("../lib/$config[general_lib_type]/group_info.php3")){
        include("../lib/$config[general_lib_type]/group_info.php3");
        if ($group_exists == 'no'){
@@ -27,7 +28,7 @@ if (is_file("../lib/$config[general_lib_type]/group_info.php3")){
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <form action="group_admin.php3" method=get>
 <b>Group Name&nbsp;&nbsp;</b>
@@ -48,7 +49,7 @@ EOM;
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
index 8a1faddb97661ead960110a21b9acbd98611e98b..fe0d6e1cc03903fe492189cf961ec8a4b3937fd0 100644 (file)
@@ -11,7 +11,7 @@ if ($config[general_lib_type] != 'sql'){
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>This page is only available if you are using sql as general library type</b>
 </body>
@@ -39,7 +39,7 @@ if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
index 54cca94333e1a62cfca5fb1e447fec4b6a70589d..725797ffe2196801d1d20a6399019d27b6b50476 100644 (file)
        <table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
        <tr><td>
 <br>
-<pre>
-
-<b>For now we just include the README file</b><br>
 
+<b>Please choose which file you wish to read:</b><br><br>
+<form name="readhelp" method=post>
+<select name=help_file>
 <?php
-readfile('../../README');
+$selected[$help_file] = 'selected';
+
+echo <<<EOM
+<option $selected[readme] value="readme">README File
+<option $selected[howto] value="howto">HOWTO File
+<option $selected[faq] value="faq">FAQ File
+EOM;
 ?>
+</select>
+<br><br>
+<input type=submit class=button value="Read File">
+</form>
 
+<pre>
+<?php
+$in_file = '';
+if ($help_file == 'readme')
+       $in_file = '../../README';
+else if ($help_file == 'howto')
+       $in_file = '../../doc/HOWTO';
+else if ($help_file == 'faq')
+       $in_file = '../../doc/FAQ';
+if ($in_file != '')
+       readfile("$in_file");
+?>
 </pre>
 <br>
 </td></tr>
index 39e437ad49a6d68d3dda8d8ee432de31a1820dc0..3c2e1da397434ce6c45e5b22c2acfbd832fb476e 100644 (file)
@@ -4,7 +4,7 @@
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <?php
 
 function check_day($day){
index 1c3aab28488f7cd45a789510da8f816ddf80275a..6a6b5e9f0b0c0ad8ca9611ff3554c4c521161d3e 100644 (file)
@@ -8,7 +8,7 @@ else{
 <title>NAS Administration Page</title>
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Could not include SQL library functions. Aborting</b>
 </body>
@@ -17,13 +17,13 @@ EOM;
        exit();
 }
 if ($config[general_restrict_nasadmin_access] == 'yes'){
-       $auth_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
+       $auth_user = $_SERVER["PHP_AUTH_USER"];
        if ($auth_user == '' || $mappings[$auth_user][nasadmin] != 'yes'){
                echo <<<EOM
 <title>NAS Administration Page</title>
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Access is not allowed to this username.</b>
 </body>
@@ -64,6 +64,14 @@ if ($link){
                                if ($nasname == '' || $nassecret == '' || $nasshortname == '')
                                        $msg = "<b>Error. Required fields are not set</b><br>\n";
                                else{
+                                       $nasshortname = da_sql_escape_string($nasshortname);
+                                       $nastype = da_sql_escape_string($nastype);
+                                       $nasportnum = da_sql_escape_string($nasportnum);
+                                       $nassecret = da_sql_escape_string($nassecret);
+                                       $nascommunity = da_sql_escape_string($nascommunity);
+                                       $nasdescription = da_sql_escape_string($nasdescription);
+                                       $nasname = da_sql_escape_string($nasname);
+
                                        $res = @da_sql_query($link,$config,
                                        "INSERT INTO $config[sql_nas_table]
                                        (nasname,shortname,type,ports,secret,community,description)
@@ -81,6 +89,14 @@ if ($link){
                                if ($nassecret == '' || $nasshortname == '')
                                        $msg = "<b>Error. Required fields are not set</b><br>\n";
                                else{
+                                       $nasshortname = da_sql_escape_string($nasshortname);
+                                       $nastype = da_sql_escape_string($nastype);
+                                       $nasportnum = da_sql_escape_string($nasportnum);
+                                       $nassecret = da_sql_escape_string($nassecret);
+                                       $nascommunity = da_sql_escape_string($nascommunity);
+                                       $nasdescription = da_sql_escape_string($nasdescription);
+                                       $nasname = da_sql_escape_string($nasname);
+
                                        $res = @da_sql_query($link,$config,
                                        "UPDATE $config[sql_nas_table] SET
                                        shortname = '$nasshortname',
@@ -131,7 +147,7 @@ else
 <title>NAS Administration Page</title>
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
index 589f75b733896eeecea4b82a833213e4f9e9858a..7934552e5a143cd18e6b474ffdbb1016ba9a23d6 100644 (file)
@@ -8,7 +8,7 @@ session_destroy();
 <title>Session Cache Destroy Page</title>
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Session Cache Destroyed</b>
 </body>
index eba5f5a44a922a7a95303fc3f9dd0f62f2715b75..b652cab59681c42a4d95cd63c04a738660f99896 100644 (file)
@@ -12,7 +12,7 @@ else{
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Could not include SQL library functions. Aborting</b>
 </body>
@@ -26,7 +26,7 @@ EOM;
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
index a9333500d5848950219d32c9cdd87b80fc65cf62..7f2c07c43f8eb1f614bc006384d0b96d94044d2d 100644 (file)
@@ -9,7 +9,7 @@ require_once('../lib/xlat.php3');
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 
 <?php
index 09c0faf021b5b4ffab3f61cfdc0b5aa734a68155..44f19d8e373972e990f1ea002c31c9d32b3ffb74 100644 (file)
@@ -29,4 +29,18 @@ body
        scrollbar-highlight-color:#fffff0;
        scrollbar-3dlight-color:#000000;
        scrollbar-darkshadow-color:#000000;
+       bgcolor:#80a040;
+       background-image: url(images/greenlines1.gif);
+}
+a:link {
+       color: #000000;
+}
+a:visited {
+       color:#000000;
+}
+a:hover {
+       color:#000000;
+}
+a:active {
+       color:#000000;
 }
index ee0e3fc1de01edff5772b139d4c65bf41204c7ba..1b59ce6d12e670ad858bdd08c632be813e749a39 100644 (file)
@@ -15,7 +15,7 @@ else{
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Could not include SQL library functions. Aborting</b>
 </body>
@@ -40,6 +40,10 @@ $selected[$order] = 'selected';
 $now_str = da_sql_escape_string($now_str);
 $prev_str = da_sql_escape_string($prev_str);
 
+unset($da_name_cache);
+if (isset($_SESSION['da_name_cache']))
+       $da_name_cache = $_SESSION['da_name_cache'];
+
 
 echo <<<EOM
 <head>
@@ -47,7 +51,7 @@ echo <<<EOM
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
index 8c21348ec3cfe811c6a3f6ef4a34f6810ab6c8da..18b0fa3f3bc96964625f948f6e236e3c48cf00b0 100644 (file)
@@ -16,7 +16,7 @@ if (is_file("../lib/$config[general_lib_type]/user_info.php3")){
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <form action="user_admin.php3" method=get>
 <b>User Name&nbsp;&nbsp;</b>
@@ -38,7 +38,7 @@ else{
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Could not include SQL library functions. Aborting</b>
 </body>
index bf63795c55d73a374b3fd24b1fd35893c7436267..6edd6478691616e8ae37e7631263edbf521415de 100644 (file)
@@ -24,7 +24,7 @@ echo <<<EOM
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
index 9f3bde32a45c9bb066ac8d55773fcf82d9602cde..2daad5686775835c093ea530bbbb7d6ae1d61fed 100644 (file)
@@ -39,7 +39,7 @@ else
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
index f9da8418d467841af2cebd8d534b7dabd7659567..36242f5b5c11d9fe2fa5ff23074698689dbdf713 100644 (file)
@@ -29,7 +29,7 @@ if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php3"))
        include_once("../lib/sql/drivers/$config[sql_type]/functions.php3");
 else{
        echo <<<EOM
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Could not include SQL library functions. Aborting</b>
 </body>
@@ -41,8 +41,10 @@ EOM;
 $date = strftime('%A, %e %B %Y, %T %Z');
 
 $sql_extra_query = '';
-if ($config[sql_accounting_extra_query] != '')
+if ($config[sql_accounting_extra_query] != ''){
        $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
+       $sql_extra_query = da_sql_escape_string($sql_extra_query);
+}
 
 $link = @da_sql_pconnect($config);
 $link2 = connect2db($config);
@@ -127,7 +129,7 @@ if (isset($usage_summary)){
 }
 ?>
 
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
index 03d8266b985d29bb230320e6530c538affbe32b2..f5868cb9ca75b09fb0abaa356057723dc06214b8 100644 (file)
@@ -8,7 +8,7 @@ require('../conf/config.php3');
 <title>Personal information page</title>
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
index ef70d454ff4d7af58c96b50b1883e570c6262f40..71ccb57d536f2ccd09da3e0459667be8ee098955 100644 (file)
@@ -23,7 +23,7 @@ if ($config[general_lib_type] == 'sql' && $config[sql_use_operators] == 'true'){
 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $config[general_charset]?>">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 
 <?php
 include("password_generator.jsc");
index 041cf51fa3385429fb26886d9eed27bb0cfe6227..13b5ab1cc0d2074f0f99aed811bc5a98b932368c 100644 (file)
@@ -15,7 +15,7 @@ else{
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <b>Could not include SQL library functions. Aborting</b>
 </body>
@@ -35,7 +35,9 @@ $stop = da_sql_escape_string($stop);
 $pagesize = ($pagesize) ? $pagesize : 10;
 if (!is_numeric($pagesize))
        $pagezise = 10;
-$limit = ($pagesize == 'all') ? '' : "LIMIT $pagesize";
+if ($pagesize > 100)
+       $pagesize = 100;
+$limit = ($pagesize == 'all') ? 'LIMIT 100' : "LIMIT $pagesize";
 $selected[$pagesize] = 'selected';
 $order = ($order) ? $order : $config[general_accounting_info_order];
 if ($order != 'desc' && $order != 'asc')
@@ -54,8 +56,14 @@ $selected[$order] = 'selected';
 $selected[$sortby] = 'selected';
 
 $sql_extra_query = '';
-if ($config[sql_accounting_extra_query] != '')
+if ($config[sql_accounting_extra_query] != ''){
        $sql_extra_query = xlat($config[sql_accounting_extra_query],$login,$config);
+       $sql_extra_query = da_sql_escape_string($sql_extra_query);
+}
+
+unset($da_name_cache);
+if (isset($_SESSION['da_name_cache']))
+       $da_name_cache = $_SESSION['da_name_cache'];
 
 ?>
 
@@ -63,7 +71,7 @@ if ($config[sql_accounting_extra_query] != '')
 <title>User Statistics</title>
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
index 34ed7150cec4fc84b30d75ecffe2bdad62a2555e..60c351995feb34196ba65017f79e764958d77c71 100644 (file)
@@ -13,7 +13,7 @@ echo <<<EOM
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 <link rel="stylesheet" href="style.css">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <center>
 <table border=0 width=550 cellpadding=0 cellspacing=0>
 <tr valign=top>
index 7a7b9db64fbe00e9a8aaa4fd135b79fd19046a80..2777723f3e68d6ad3d535a79c6220274ad97479d 100644 (file)
@@ -12,15 +12,15 @@ function myout(a) {
 }
 </script>
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <form action="user_admin.php3" method=get target="content">
 <table border=0 width=100 cellpadding=1 cellspacing=1>
 <tr><td align=center>
 <img src="images/logo2.gif" vspace=2>
 </td></tr>
 <?php
-if ($HTTP_SERVER_VARS["PHP_AUTH_USER"])
-       echo "<tr valign=top><td align=center><b>Logged in as " . $HTTP_SERVER_VARS["PHP_AUTH_USER"] . "...</b><br><br></td></tr>\n";
+if ($_SERVER["PHP_AUTH_USER"])
+       echo "<tr valign=top><td align=center><b>Logged in as " . $_SERVER["PHP_AUTH_USER"] . "...</b><br><br></td></tr>\n";
 ?>
 <tr bgcolor="black" valign=top><td>
 <table border=0 width=100% cellpadding=2 cellspacing=0>
index 2f1f85b0661ca621c47e93dcda30af87b4a3f9ab..6309eeda3692c95ae16755fc78379ab5ec917ada 100644 (file)
@@ -4,7 +4,7 @@ echo <<<EOM
 <title>user information for $cn</title>
 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
 </head>
-<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<body>
 <link rel="stylesheet" href="style.css">
 EOM;
 if ($logged_now)
index bb2b0e3e4011aa1a4855a0a2fe3bb41f04cc2946..de39327f92e40cd7b4a65b4523e1720732016855 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 #Read sql attribute map
+unset($sql_attrs);
+if (isset($_SESSION['sql_attrs']))
+       $sql_attrs = $_SESSION["sql_attrs"];
 if (!isset($sql_attrs)){
        $ARR = file($config[general_sql_attrs_file]);
        foreach($ARR as $val){
index 83bbde5cad2080405e1680202a2f94f23dad5b8c..ed635bdda71a51a664eb3d82ee023febfeb5a8eb 100644 (file)
@@ -10,8 +10,8 @@ $date=date($config[sql_full_date_format]);
 $lockmsg_name = $attrmap['Dialup-Lock-Msg'] . '0';
 $msg = $$lockmsg_name;
 $admin = '-';
-if ($HTTP_SERVER_VARS["PHP_AUTH_USER"] != '')
-       $admin = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
+if ($_SERVER["PHP_AUTH_USER"] != '')
+       $admin = $_SERVER["PHP_AUTH_USER"];
 if ($msg == '')
        echo "<b>Lock Message should not be empty</b><br>\n";
 else{
index 945a5fdaad9e1eb32eca2ce2b7473a74a0735335..98f90e7beaddaec8f37497fa4de952b33cce4dc3 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 include_once('../lib/xlat.php3');
 #Read user_edit attribute map
+unset($show_attrs);
+if (isset($_SESSION['show_attrs']))
+       $show_attrs = $_SESSION['show_attrs'];
 if (!isset($show_attrs)){
        $infile = xlat($config[general_user_edit_attrs_file],$login,$config);
        $ARR = file($infile);
@@ -14,6 +17,9 @@ if (!isset($show_attrs)){
        if ($config[general_use_session] == 'yes')
                session_register('show_attrs');
 }
+unset($acct_attrs);
+if (isset($_SESSION['acct_attrs']))
+       $acct_attrs = $_SESSION['acct_attrs'];
 if (!isset($acct_attrs) && isset($config[general_accounting_attrs_file])){
        $infile = xlat($config[general_accounting_attrs_file],$login,$config);
        $ARR = file($infile);
index 6aec80cbf4aedaf31ed45fa66b859bcfe813b485..c821fa277854381e2be0f5d8a9a5963edcd99cf4 100644 (file)
@@ -1,4 +1,8 @@
 <?php
+unset($text_default_vals);
+unset($default_vals);
+if (isset($_SESSION['text_default_vals']))
+       $text_default_vals = $_SESSION['text_default_vals'];
 if (!isset($text_default_vals)){
        $ARR=file("$config[general_default_file]");
        foreach($ARR as $val) {
index 6469c86fd4ea07e28f435445f163a80eced95e6c..c79b6c4a43c9839b707cb45fbd04cd04980add67 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 #Read ldap attribute map
+unset($attrmap);
+if (isset($_SESSION['attrmap']))
+       $attrmap = $_SESSION['attrmap'];
 if (!isset($attrmap)){
        $ARR = file("$config[general_ldap_attrmap]");
        foreach($ARR as $val){
index be67ca065262ba53247871ebd63c399188faca52..e09f699616f494ec3e6732b8d96e49a43fbee31a 100644 (file)
@@ -5,9 +5,8 @@ function da_ldap_bind($ds,$config)
 {
        if ($ds){
                if ($config[ldap_use_http_credentials] == 'yes'){
-                       global $HTTP_SERVER_VARS;
-                       $din = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
-                       $pass = $HTTP_SERVER_VARS["PHP_AUTH_PW"];
+                       $din = $_SERVER["PHP_AUTH_USER"];
+                       $pass = $_SERVER["PHP_AUTH_PW"];
                        if ($config[ldap_map_to_directory_manager] != '' &&
                        $din == $config[ldap_map_to_directory_manager] &&
                        $config[ldap_directory_manager] != '')
index b38061dad5f17249dccc81ec0222c15c6705e470..6939bd194b4ace9ea473723393b74c9c82dde697 100644 (file)
@@ -23,6 +23,9 @@ $homephone = '-';
 $mobile = '-';
 $mail = '-';
 $mailalt = '-';
+$dn = '';
+$user_exists = 'no';
+unset($item_vals);
 
 if ($config[general_decode_normal_attributes] == 'yes')
        $decode_normal = 1;
@@ -55,7 +58,6 @@ if ($ds) {
        else{
                $user_exists = 'yes';
                $user_info = 1;
-               unset($item_vals);
                $k = init_decoder();
                $cn = ($info[0]['cn'][0]) ? $info[0]['cn'][0] : '-';
                if ($decode_normal)
index b4c02efd938aeb5e785fb0d6b9f999ed8b79decb..f7e5e8ff24173095a0fa2cc10cb0fb1bfc130c07 100644 (file)
@@ -1,5 +1,14 @@
 <?php
 #Read sql attribute map
+unset($attrmap);
+unset($rev_attrmap);
+unset($attr_type);
+if (isset($_SESSION['attrmap'])){
+       #If attrmap is set then the rest will also be set
+        $attrmap = $_SESSION['attrmap'];
+       $rev_attrmap =$_SESSION['rev_attrmap'];
+       $attr_type = $_SESSION['attr_type'];
+}
 $ARR = file("$config[general_sql_attrmap]");
 foreach($ARR as $val){
        $val=chop($val);
@@ -9,4 +18,9 @@ foreach($ARR as $val){
        $attrmap["$key"]=$v;
        $rev_attrmap["$v"] = $key;
        $attr_type["$key"]=$type;
+       if ($config[general_use_session] == 'yes'){
+               session_register('attrmap');
+               session_register('rev_attrmap');
+               session_register('attr_type');
+       }
 }
index 1c80c2bce917e2037a9a72fbae7e610c7629c429..a9013159093249559e46db40fc8dd70373f2ddb3 100644 (file)
@@ -50,10 +50,13 @@ if ($link){
                                                echo "<b>Invalid operator ($op_val) for attribute $key</b><br>\n";
                                                continue;
                                        }
-                                       $op_val1 = "'$op_val'";
                                        $op_val2 = ",'$op_val'";
                                }
                        }
+                       $op_val = da_sql_escape_string($op_val);
+                       $sql_attr = da_sql_escape_string($sql_attr);
+                       $val = da_sql_escape_string($val);
+                       $op_val2 = da_sql_escape_string($op_val2);
        // if we have operators, the operator has changed and the corresponding value exists then update
                        if ($use_ops && isset($item_vals["$key"][operator][$j]) &&
                                $op_val != $item_vals["$key"][operator][$j] ){
@@ -81,6 +84,7 @@ if ($link){
                        else{
                                if (isset($item_vals["$key"][$j])){
                                        $old_val = $item_vals["$key"][$j];
+                                       $old_val = da_sql_escape_string($old_val);
                                        $res = @da_sql_query($link,$config,
                                        "UPDATE $table SET value = '$val' WHERE $query_key = '$login' AND
                                        attribute = '$sql_attr' AND value = '$old_val';");
index 856b17bc3221ff57eab911374ab7976f53021fc6..5da1f822bc7f4b43d77a6e82f61b0fde28d4cfc2 100644 (file)
@@ -20,6 +20,7 @@ if ($link){
        if (is_file("../lib/crypt/$config[general_encryption_method].php3")){
                include("../lib/crypt/$config[general_encryption_method].php3");
                $passwd = da_encrypt($passwd);
+               $passwd = da_sql_escape_string($passwd);
                $res = @da_sql_query($link,$config,
                        "SELECT value FROM $config[sql_check_table] WHERE username = '$login'
                        AND attribute = '$config[sql_password_attribute]';");
index e37d7bbf4115915bf2a33332028c1323fea55717..22ecf69ae9bd21288f7ece9ba99e3a445747b2aa 100644 (file)
@@ -12,6 +12,7 @@ if ($config[sql_use_operators] == 'true'){
        $passwd_op = ",':='";
 }
 $da_abort=0;
+$op_val2 = '';
 $link = @da_sql_pconnect($config);
 if ($link){
        $Members = preg_split("/[\n\s]+/",$members,-1,PREG_SPLIT_NO_EMPTY);
@@ -49,6 +50,7 @@ if ($link){
                        $op_name = $attrmap["$key"] . '_op';
                        $op_val = $$op_name;
                        if ($op_val != ''){
+                               $op_val = da_sql_escape_string($op_val);
                                if (check_operator($op_val,$type) == -1){
                                        echo "<b>Invalid operator ($op_val) for attribute $key</b><br>\n";
                                        coninue;
index ab6131d3e07bd111c673af6b5066756422735393..1f3e876d83c9472b64d31051456010f1db3e3a9d 100644 (file)
@@ -12,11 +12,13 @@ if ($config[sql_use_operators] == 'true'){
        $passwd_op = ",':='";
 }
 $da_abort=0;
+$op_val2 = '';
 $link = @da_sql_pconnect($config);
 if ($link){
        if (is_file("../lib/crypt/$config[general_encryption_method].php3")){
                include("../lib/crypt/$config[general_encryption_method].php3");
                $passwd = da_encrypt($passwd);
+               $passwd = da_sql_escape_string($passwd);
                $res = @da_sql_query($link,$config,
                "INSERT INTO $config[sql_check_table] (attribute,value,username $text)
                VALUES ('$config[sql_password_attribute]','$passwd','$login' $passwd_op);");
@@ -92,6 +94,7 @@ if ($link){
                                $op_name = $attrmap["$key"] . '_op';
                                $op_val = $$op_name;
                                if ($op_val != ''){
+                                       $op_val = da_sql_escape_string($op_val);
                                        if (check_operator($op_val,$type) == -1){
                                                echo "<b>Invalid operator ($op_val) for attribute $key</b><br>\n";
                                                coninue;
index 3eb6893219b087b1f4f175e09dc734f2c7414f60..754fba90e66a7ff97538cd69fe151312818907e9 100644 (file)
@@ -6,11 +6,15 @@ else{
        exit();
 }
 
+unset($found_users);
+
 $link = @da_sql_pconnect($config);
 if ($link){
        $search = da_sql_escape_string($search);
        if (!is_numeric($max_results))
                $max_results = 10;
+       if ($max_results > 500)
+               $max_results = 10;
        if (($search_IN == 'name' || $search_IN == 'department' || $search_IN == 'username') && 
                        $config[sql_use_user_info_table] == 'true'){
                $res = @da_sql_query($link,$config,
@@ -31,6 +35,7 @@ if ($link){
                }
                $table = ($attr_type[$radius_attr] == 'checkItem') ? $config[sql_check_table] : $config[sql_reply_table];
                $attr = $attrmap[$radius_attr];
+               $attr = da_sql_escape_string($attr);
                $res = @da_sql_query($link,$config,
                "SELECT username FROM $table WHERE attribute = '$attr' AND value LIKE '%$search%' LIMIT $max_results;");
                if ($res){
index 6ac4ded2561270bb80df27806eb9194dabd506fe..c7448d64bd000526f0b8a3d73f075579d3d1c0e8 100644 (file)
@@ -1,6 +1,9 @@
 <?php
 require('../conf/config.php3');
 
+unset($da_name_cache);
+if (isset($_SESSION['da_name_cache']))
+       $da_name_cache = $_SESSION['da_name_cache'];
 if ($config[sql_nas_table] != ''){
 
        if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php3"))
@@ -11,7 +14,7 @@ if ($config[sql_nas_table] != ''){
        }
        $link = @da_sql_pconnect($config);
        if ($link){
-               $auth_user = $HTTP_SERVER_VARS["PHP_AUTH_USER"];
+               $auth_user = $_SERVER["PHP_AUTH_USER"];
                $extra = '';
                if (isset($mappings[$auth_user][nasdb])){
                        $NAS_ARR = array();
index ff5c2f95b72152813da78439dd531f898431644e..ac282ee5a7011635b13613c81667c6228c7d8e6d 100644 (file)
@@ -4,7 +4,7 @@ function xlat($filter,$login,$config)
        $string = $filter;
        if ($filter != ''){
                $string = preg_replace('/%u/',$login,$string);
-               $string = preg_replace('/%U/',$HTTP_SERVER_VARS["PHP_AUTH_USER"],$string);
+               $string = preg_replace('/%U/',$_SERVER["PHP_AUTH_USER"],$string);
                $string = preg_replace('/%ma/',$mappings[$http_user][accounting],$string);
                $string = preg_replace('/%mu/',$mappings[$http_user][userdb],$string);
                $string = preg_replace('/%mn/',$mappings[$http_user][nasdb],$string);