From: kkalev Date: Tue, 20 Apr 2004 13:14:18 +0000 (+0000) Subject: Keep the nas list in a separate array $nas_list. Update various pages to use that... X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=e382027cb369fda73a624591d8ca8e20130c3b1a;p=freeradius-dialup-admin.git Keep the nas list in a separate array $nas_list. Update various pages to use that one now. --- diff --git a/Changelog b/Changelog index c1788c0..4886701 100644 --- a/Changelog +++ b/Changelog @@ -20,6 +20,7 @@ Ver 1.70: * Add a nas administration page for sql based clients * Fix small bugs in accounting.php3 and user_stats.php3. Add nas_admin.php3 to the buttons page * Add da_sql_escape_string for all relevant variables in lib/sql files +* Keep the nas list in a separate array $nas_list. Update various pages to use that one now. Ver 1.68: * Huge PostgreSQL compatibility patch by Guy Fraser diff --git a/conf/config.php3 b/conf/config.php3 index 11823d9..e276a0b 100644 --- a/conf/config.php3 +++ b/conf/config.php3 @@ -14,6 +14,7 @@ if ($use_session){ @session_start(); } if (!isset($config)){ + unset($nas_list); $ARR=file("../conf/admin.conf"); $EXTRA_ARR = array(); foreach($ARR as $val) { @@ -25,6 +26,8 @@ if (!isset($config)){ $val=$config[$matches[1]]; $v=preg_replace("/%\{$matches[1]\}/",$val,$v); } + if (preg_match("/^general_nas(\d+)_(\w+)$/",$key,$matches)) + $nas_list[$matches[2]][$matches[1]] = $key; if ($key == 'INCLUDE'){ if (is_readable($v)) array_push($EXTRA_ARR,file($v)); @@ -44,11 +47,16 @@ if (!isset($config)){ $val=$config[$matches[1]]; $v=preg_replace("/%\{$matches[1]\}/",$val,$v); } + if (preg_match("/^general_nas(\d+)_(\w+)$/",$key,$matches)) + $nas_list[$matches[2]][$matches[1]] = $key; $config["$key"]="$v"; } } - if ($use_session) + if ($use_session){ session_register('config'); + session_register('nas_list'); + } + } if ($use_session == 0 && $config[general_use_session] == 'yes'){ // Start session diff --git a/htdocs/failed_logins.php3 b/htdocs/failed_logins.php3 index 2527e52..23b77c4 100644 --- a/htdocs/failed_logins.php3 +++ b/htdocs/failed_logins.php3 @@ -198,17 +198,9 @@ EOM; $ip){