From: kkalev Date: Sun, 8 Sep 2002 00:17:18 +0000 (+0000) Subject: Add sessions in order to cache the various mappings. Add a corresponding X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=ddfe1c3835bae61c517eff3dd40ea90c0be53132;p=freeradius-dialup-admin.git Add sessions in order to cache the various mappings. Add a corresponding configuration directive general_use_session. Also add a session cache destroy page. --- diff --git a/conf/admin.conf b/conf/admin.conf index 2fbc503..d747336 100644 --- a/conf/admin.conf +++ b/conf/admin.conf @@ -11,6 +11,11 @@ general_prefered_lang_name: Greek general_base_dir: /usr/local/dialup_admin general_radiusd_base_dir: /usr/local/radiusd general_domain: company.com +# +# Set it to yes to use sessions and cache the various mappings +# This feature is considered experimantal for the moment +general_use_session: no + # general_ldap_attrmap: %{general_radiusd_base_dir}/etc/raddb/ldap.attrmap general_sql_attrmap: %{general_base_dir}/conf/sql.attrmap diff --git a/conf/config.php3 b/conf/config.php3 index 9f352a7..1a2f345 100644 --- a/conf/config.php3 +++ b/conf/config.php3 @@ -11,4 +11,8 @@ foreach($ARR as $val) { } $config["$key"]="$v"; } +if ($config[general_use_session] == 'yes'){ + // Start session + @session_start(); +} ?> diff --git a/htdocs/session_destroy.php3 b/htdocs/session_destroy.php3 new file mode 100644 index 0000000..589f75b --- /dev/null +++ b/htdocs/session_destroy.php3 @@ -0,0 +1,15 @@ + + + +Session Cache Destroy Page + + + +
+Session Cache Destroyed + + diff --git a/htdocs/user_accounting.php3 b/htdocs/user_accounting.php3 index 71cfd5c..3bab802 100644 --- a/htdocs/user_accounting.php3 +++ b/htdocs/user_accounting.php3 @@ -106,7 +106,12 @@ if ($link){ $acct_server = $da_name_cache[$row[NASIPAddress]]; if (!isset($acct_server)){ $acct_server = gethostbyaddr($row[NASIPAddress]); - $da_name_cache[$row[NASIPAddress]] = $acct_server; + if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){ + $da_name_cache[$row[NASIPAddress]] = $acct_server; + session_register('da_name_cache'); + } + else + $da_name_cache[$row[NASIPAddress]] = $acct_server; } $acct_server = "$acct_server:$row[NASPortId]"; $acct_terminate_cause = "$row[AcctTerminateCause]"; diff --git a/html/buttons/default/buttons.html.php3 b/html/buttons/default/buttons.html.php3 index 49ab0b2..32aba01 100644 --- a/html/buttons/default/buttons.html.php3 +++ b/html/buttons/default/buttons.html.php3 @@ -77,6 +77,16 @@ if ($HTTP_SERVER_VARS["PHP_AUTH_USER"]) Check Server + + + Clear Cache + +EOM; +?> Help diff --git a/lib/acctshow.php3 b/lib/acctshow.php3 index 3ba0d66..a5d5c64 100644 --- a/lib/acctshow.php3 +++ b/lib/acctshow.php3 @@ -1,13 +1,17 @@ diff --git a/lib/attrshow.php3 b/lib/attrshow.php3 index 8c26f14..a14b9ef 100644 --- a/lib/attrshow.php3 +++ b/lib/attrshow.php3 @@ -1,11 +1,15 @@ diff --git a/lib/ldap/attrmap.php3 b/lib/ldap/attrmap.php3 index e5aac1c..6469c86 100644 --- a/lib/ldap/attrmap.php3 +++ b/lib/ldap/attrmap.php3 @@ -1,23 +1,27 @@