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
general_extra_ldap_attrmap: %{general_base_dir}/conf/extra.ldap-attrmap
}
$config["$key"]="$v";
}
+if ($config[general_use_session] == 'yes'){
+ // Start session
+ @session_start();
+}
?>
--- /dev/null
+<?php
+session_start();
+session_unset();
+session_destroy();
+?>
+<html>
+<head>
+<title>Session Cache Destroy Page</title>
+<link rel="stylesheet" href="style.css">
+</head>
+<body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
+<center>
+<b>Session Cache Destroyed</b>
+</body>
+</html>
$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]";
<tr align=left><td id="menu10" onmouseover='myin("10");' onmouseout='myout("10");'>
<a id="a10" href="user_test.php3?login=da_server_test&test_user=1" target="content" title="Check Server Response">Check Server</a>
</td></tr>
+<?php
+include('../conf/config.php3');
+if ($config[general_use_session] == 'yes')
+ echo <<<EOM
+ <tr align=left><td><img src="images/black.gif" vspace=2 hspace=0 width=80 height=1></td></tr>
+ <tr align=left><td id="menu15" onmouseover='myin("15");' onmouseout='myout("15");'>
+ <a id="a15" href="session_destroy.php3" target="content" title="Clear Session Cache">Clear Cache</a>
+ </td></tr>
+EOM;
+?>
<tr align=left><td><img src="images/black.gif" vspace=2 hspace=0 width=80 height=1></td></tr>
<tr align=left><td id="menu5" onmouseover='myin("5");' onmouseout='myout("5");' nowrap>
<a id="a5" href="help/help.php3" target="content" title="Show Help">Help</a>
<?php
#Read sql attribute map
-$ARR = file($config[general_sql_attrs_file]);
-foreach($ARR as $val){
- $val=chop($val);
- if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
- continue;
- list($key,$desc,$show,$func)=split("\t+",$val);
- $sql_attrs["$key"][desc] = "$desc";
- $sql_attrs["$key"][show] = "$show";
- $sql_attrs["$key"][func] = ($func == "") ? "nothing" : "$func";
+if (!isset($sql_attrs)){
+ $ARR = file($config[general_sql_attrs_file]);
+ foreach($ARR as $val){
+ $val=chop($val);
+ if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
+ continue;
+ list($key,$desc,$show,$func)=split("\t+",$val);
+ $sql_attrs["$key"][desc] = "$desc";
+ $sql_attrs["$key"][show] = "$show";
+ $sql_attrs["$key"][func] = ($func == "") ? "nothing" : "$func";
+ }
+ if ($config[general_use_session] == 'yes')
+ session_register('sql_attrs');
}
?>
<?php
#Read user_edit attribute map
-$ARR = file($config[general_user_edit_attrs_file]);
-foreach($ARR as $val){
- $val=chop($val);
- if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
- continue;
- list($key,$v)=split("\t+",$val);
- $show_attrs["$key"]=($v != '') ? "$v" : "$key";
+if (!isset($show_attrs)){
+ $ARR = file($config[general_user_edit_attrs_file]);
+ foreach($ARR as $val){
+ $val=chop($val);
+ if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
+ continue;
+ list($key,$v)=split("\t+",$val);
+ $show_attrs["$key"]=($v != '') ? "$v" : "$key";
+ }
+ if ($config[general_use_session] == 'yes')
+ session_register('show_attrs');
}
?>
<?php
#Read ldap attribute map
-$ARR = file("$config[general_ldap_attrmap]");
-foreach($ARR as $val){
- $val=chop($val);
- if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
- continue;
- list(,$key,$v,$g)=split('[[:space:]]+',$val);
- $v = strtolower($v);
- $attrmap["$key"]=$v;
- $attrmap[generic]["$key"]=$g;
-}
-$ARR = file("$config[general_extra_ldap_attrmap]");
-foreach($ARR as $val){
- $val=chop($val);
- if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
- continue;
- list(,$key,$v,$g)=split('[[:space:]]+',$val);
- $v = strtolower($v);
- $attrmap["$key"]=$v;
- $attrmap[generic]["$key"]=$g;
+if (!isset($attrmap)){
+ $ARR = file("$config[general_ldap_attrmap]");
+ foreach($ARR as $val){
+ $val=chop($val);
+ if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
+ continue;
+ list(,$key,$v,$g)=split('[[:space:]]+',$val);
+ $v = strtolower($v);
+ $attrmap["$key"]=$v;
+ $attrmap[generic]["$key"]=$g;
+ }
+ $ARR = file("$config[general_extra_ldap_attrmap]");
+ foreach($ARR as $val){
+ $val=chop($val);
+ if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
+ continue;
+ list(,$key,$v,$g)=split('[[:space:]]+',$val);
+ $v = strtolower($v);
+ $attrmap["$key"]=$v;
+ $attrmap[generic]["$key"]=$g;
+ }
+ if ($config[general_use_session] == 'yes')
+ session_register('attrmap');
}
?>