2 require('../conf/config.php3');
3 require('../lib/attrshow.php3');
4 if (!isset($usage_summary)){
8 <META HTTP-EQUIV="Refresh" CONTENT="50">
9 <meta http-equiv="Content-Type" content="text/html; charset=$config[general_charset]">
10 <title>User Finger Facility</title>
11 <link rel="stylesheet" href="style.css">
16 if ($config[general_decode_normal_attributes] == 'yes'){
17 if (is_file("../lib/lang/$config[general_prefered_lang]/utf8.php3"))
18 include_once("../lib/lang/$config[general_prefered_lang]/utf8.php3");
20 include_once('../lib/lang/default/utf8.php3');
24 require('../lib/functions.php3');
25 require("../lib/$config[general_lib_type]/functions.php3");
27 if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php3"))
28 include_once("../lib/sql/drivers/$config[sql_type]/functions.php3");
31 <body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
33 <b>Could not include SQL library functions. Aborting</b>
40 $date = strftime('%A, %e %B %Y, %T %Z');
42 $sql_extra_query = '';
43 if ($config[sql_accounting_extra_query] != '')
44 $sql_extra_query = sql_xlat($config[sql_accounting_extra_query],$login,$config);
46 $link = @da_sql_pconnect($config);
47 $link2 = connect2db($config);
48 $tot_in = $tot_rem = 0;
52 foreach($nas_list as $nas){
56 if ($nas[name] == $server)
63 $name_data = $nas[ip];
64 $community_data = $nas[community];
65 $server_name[$servers_num] = $nas[name];
66 $server_model[$servers_num] = $nas[model];
67 if ($config[general_ld_library_path] != '')
68 putenv("LD_LIBRARY_PATH=$config[general_ld_library_path]");
70 if ($config[$finger_type] != 'database' && $config[general_finger_type] == 'snmp'){
71 if ($config[$nas_type] == '')
72 $nas_type = $config[general_nas_type];
74 $nas_type = $nas[type];
78 $users=exec("$config[general_snmpfinger_bin] $name_data $community_data $nas_type");
80 $extra = "AND username IN ($users)";
82 $search = @da_sql_query($link,$config,
83 "SELECT DISTINCT username,acctstarttime,framedipaddress,callingstationid
84 FROM $config[sql_accounting_table] WHERE
85 acctstoptime IS NULL AND nasipaddress = '$name_data' $extra $sql_extra_query
86 GROUP BY username ORDER BY acctstarttime;");
89 while($row = @da_sql_fetch_array($search,$config)){
92 $user = $row['username'];
93 $finger_info[$servers_num][$num]['ip'] = $row['framedipaddress'];
94 if ($finger_info[$servers_num][$num]['ip'] == '')
95 $finger_info[$servers_num][$num]['ip'] = '-';
96 $session_time = $row['acctstarttime'];
97 $session_time = date2timediv($session_time,$now);
98 $finger_info[$servers_num][$num]['session_time'] = time2strclock($session_time);
99 $finger_info[$servers_num][$num]['user'] = $user;
100 $finger_info[$servers_num][$num]['callerid'] = $row['callingstationid'];
101 if ($finger_info[$servers_num][$num]['callerid'] == '')
102 $finger_info[$servers_num][$num]['callerid'] = '-';
103 if ($user_info["$user"] == ''){
104 $user_info["$user"] = get_user_info($link2,$user,$config,$decode_normal,$k);
105 if ($user_info["$user"] == '' || $user_info["$user"] == ' ')
106 $user_info["$user"] = 'Unknown User';
109 $height[$servers_num] = $h;
111 $server_loggedin[$servers_num] = $num;
112 $server_rem[$servers_num] = ($config[$portnum]) ? ($config[$portnum] - $num) : 'unknown';
114 if (is_numeric($server_rem[$servers_num]))
115 $tot_rem += $server_rem[$servers_num];
119 echo "<b>Could not connect to SQL database</b><br>\n";
120 if (isset($usage_summary)){
121 echo "Online: $tot_in Free: $tot_rem\n";
126 <body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
128 <table border=0 width=550 cellpadding=0 cellspacing=0>
130 <td align=center><img src="images/title2.gif"></td>
134 <table border=0 width=540 cellpadding=1 cellspacing=1>
137 <td bgcolor="black" width=200>
138 <table border=0 width=100% cellpadding=2 cellspacing=0>
139 <tr bgcolor="#907030" align=right valign=top><th>
140 <font color="white">Online Users</font>
144 <tr bgcolor="black" valign=top><td colspan=2>
145 <table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
151 for($j = 1; $j <= $servers_num; $j++){
154 <table width=100% cellpadding=0 height=30><tr>
155 <th align=left>$server_name[$j]<br><font color="green">$server_model[$j]</font></th><th align=right><font color="red">$server_loggedin[$j] users connected</font></th><th><font color="green">$server_rem[$j] $config[general_caption_finger_free_lines]</font></th>
158 <div height="$height[$j]" style="height:$height[$j]">
159 <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
160 <tr bgcolor="#d0ddb0">
161 <th>#</th><th>user</th>
163 if ($acct_attrs['uf'][4] != '') echo "<th>" . $acct_attrs[uf][4] . "</th>\n";
164 if ($acct_attrs['uf'][9] != '') echo "<th>" . $acct_attrs[uf][9] . "</th>\n";
166 <th>name</th><th>duration</th>
169 for( $k = 1; $k <= $server_loggedin[$j]; $k++){
170 $user = $finger_info[$j][$k][user];
173 $time = $finger_info[$j][$k][session_time];
174 $ip = $finger_info[$j][$k][ip];
175 $cid = $finger_info[$j][$k][callerid];
176 $inf = $user_info[$user];
179 <td>$k</td><td><a href="user_admin.php3?login=$user" title="Edit User $user">$user</a></td>
181 if ($acct_attrs['uf'][4] != '') echo "<td>$ip</td>\n";
182 if ($acct_attrs['uf'][9] != '') echo "<td>$cid</td>\n";
184 <td>$inf</td><td>$time</td>