From: kkalev Date: Wed, 10 Jul 2002 14:53:51 +0000 (+0000) Subject: * If the same attribute appears more than once in the user edit page then show a... X-Git-Url: https://git.entuzijast.net/?a=commitdiff_plain;h=910984375c980291b7eed6029b7b96ea00d446a2;p=freeradius-dialup-admin.git * If the same attribute appears more than once in the user edit page then show a count of the number of occurences next to the attribute name * Add a server argument to user_finger.php3. If it is set then the page will only show the logged in users in that access server instead of all of them. Update the README with documentation for that fact. --- diff --git a/Changelog b/Changelog index 4e7634c..89f3327 100644 --- a/Changelog +++ b/Changelog @@ -14,6 +14,10 @@ Ver 1.30: * Pass the whole password as salt in da_encrypt() in password_check.php3 * Refresh the online users page every 50 secs. Patch by Alexandre Strube * Check if the last logged in server and client ip are valid before calling gethostbyaddr +* If the same attribute appears more than once in the user edit page then show a count of the number of + occurences next to the attribute name +* Add a server argument to user_finger.php3. If it is set then the page will only show the logged in users + in that access server instead of all of them. Update the README with documentation for that fact. Ver 1.29: * Add general_ld_library_path directive and set LD_LIBRARY_PATH accordingly (used in snmpfinger and radaclient). diff --git a/README b/README index a106ef8..b6f7ff1 100644 --- a/README +++ b/README @@ -19,6 +19,7 @@ There are also a few more things included: stoptime = 0. It will not do an harm even if it deletes valid entries since radiusd will fall back to insert if update fails. + The structure of the tree is: conf:: Contains various configuration files. @@ -63,6 +64,9 @@ htdocs:: user_state.php3 => separated by new lines: account_status(active or inactive),lock message,weekly limit,daily limit, weekly used,weekly connections,daily used,daily connections +htdocs:: user_finger.php3 => + It will inger the nas(es) and show the logged in users. If an argument server is passed then + it will only show users for the specific access server. html:: Contains the html code for a few pages html::user_admin.html.php3 => diff --git a/htdocs/user_edit.php3 b/htdocs/user_edit.php3 index bd8bf68..b7f5c3c 100644 --- a/htdocs/user_edit.php3 +++ b/htdocs/user_edit.php3 @@ -119,10 +119,14 @@ User Password (changes only) print << -$desc +EOM; + if ($i == 1) + echo "$desc\n"; + else + echo "$desc ($i)\n"; + print << EOM; - if ($show_ops) print << diff --git a/htdocs/user_finger.php3 b/htdocs/user_finger.php3 index 1613d20..7211f6b 100644 --- a/htdocs/user_finger.php3 +++ b/htdocs/user_finger.php3 @@ -31,6 +31,7 @@ $link = @da_sql_pconnect($config); $link2 = connect2db($config); if ($link){ $h = 21; + $servers_num = 0; while(1){ $i++; $num = 0; @@ -45,10 +46,18 @@ if ($link){ $i--; break; } + if ($server != ''){ + if ($config[$name] == $server) + $servers_num++; + else + continue; + } + else + $servers_num++; $name_data = $config[$ip]; $community_data = $config[$community]; - $server_name[$i] = $config[$name]; - $server_model[$i] = $config[$model]; + $server_name[$servers_num] = $config[$name]; + $server_model[$servers_num] = $config[$model]; if ($config[general_ld_library_path] != '') putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]"); $extra = ""; @@ -67,26 +76,26 @@ if ($link){ $num++; $h += 21; $user = $row['UserName']; - $finger_info[$i][$num]['ip'] = $row['FramedIPAddress']; - if ($finger_info[$i][$num]['ip'] == '') - $finger_info[$i][$num]['ip'] = '-'; + $finger_info[$servers_num][$num]['ip'] = $row['FramedIPAddress']; + if ($finger_info[$servers_num][$num]['ip'] == '') + $finger_info[$servers_num][$num]['ip'] = '-'; $session_time = $row['AcctStartTime']; $session_time = date2timediv($session_time); - $finger_info[$i][$num]['session_time'] = time2strclock($session_time); - $finger_info[$i][$num]['user'] = $user; - $finger_info[$i][$num]['callerid'] = $row['CallingStationId']; - if ($finger_info[$i][$num]['callerid'] == '') - $finger_info[$i][$num]['callerid'] = '-'; + $finger_info[$servers_num][$num]['session_time'] = time2strclock($session_time); + $finger_info[$servers_num][$num]['user'] = $user; + $finger_info[$servers_num][$num]['callerid'] = $row['CallingStationId']; + if ($finger_info[$servers_num][$num]['callerid'] == '') + $finger_info[$servers_num][$num]['callerid'] = '-'; if ($user_info["$user"] == ''){ $user_info["$user"] = get_user_info($link2,$user,$config); if ($user_info["$user"] == '' || $user_info["$user"] == ' ') $user_info["$user"] = 'Unknown User'; } } - $height[$i] = $h; + $height[$servers_num] = $h; } - $server_loggedin[$i] = $num; - $server_rem[$i] = ($config[$portnum]) ? ($config[$portnum] - $num) : 'unknown'; + $server_loggedin[$servers_num] = $num; + $server_rem[$servers_num] = ($config[$portnum]) ? ($config[$portnum] - $num) : 'unknown'; } } ?> @@ -116,7 +125,7 @@ if ($link){ echo <<$date EOM; - for($j = 1; $j <= $i; $j++){ + for($j = 1; $j <= $servers_num; $j++){ echo <<