2 require('../conf/config.php3');
7 if (is_file("../lib/sql/drivers/$config[sql_type]/functions.php3"))
8 include_once("../lib/sql/drivers/$config[sql_type]/functions.php3");
11 <title>Failed logins</title>
12 <link rel="stylesheet" href="style.css">
14 <body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
16 <b>Could not include SQL library functions. Aborting</b>
25 $last = ($config[general_most_recent_fl]) ? $config[general_most_recent_fl] : 5;
26 $start = $now - ($last*60);
27 $now_str = date($config[sql_full_date_format],$now);
28 $prev_str = date($config[sql_full_date_format],$start);
29 $pagesize = ($pagesize) ? $pagesize : 10;
30 $limit = ($pagesize == 'all') ? '' : "LIMIT $pagesize";
31 $selected[$pagesize] = 'selected';
32 $order = ($order != '') ? $order : $config[general_accounting_info_order];
33 if ($order != 'desc' && $order != 'asc')
35 $selected[$order] = 'selected';
37 $callerid_str = "AND CallingStationId = '$callerid'";
38 if ($server != '' && $server != 'all')
39 $server_str = "AND NASIPAddress = '$server'";
44 <title>Failed Logins</title>
45 <link rel="stylesheet" href="style.css">
47 <body bgcolor="#80a040" background="images/greenlines1.gif" link="black" alink="black">
49 <table border=0 width=550 cellpadding=0 cellspacing=0>
51 <td align=center><img src="images/title2.gif"></td>
54 <table border=0 width=400 cellpadding=0 cellspacing=2>
57 <table border=0 width=840 cellpadding=1 cellspacing=1>
60 <td bgcolor="black" width=35%>
61 <table border=0 width=100% cellpadding=2 cellspacing=0>
62 <tr bgcolor="#907030" align=right valign=top><th>
63 <font color="white">Failed Logins</font>
67 <tr bgcolor="black" valign=top><td colspan=2>
68 <table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor="#ffffd0" valign=top>
72 <b>$prev_str</b> up to <b>$now_str</b>
77 <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
78 <tr bgcolor="#d0ddb0">
79 <th>#</th><th>login</th><th>time</th><th>server</th><th>terminate cause</th><th>callerid</th>
83 $link = @da_sql_pconnect($config);
85 $search = @da_sql_query($link,$config,
86 "SELECT AcctStopTime,UserName,NASIPAddress,NASPortId,AcctTerminateCause,CallingStationId
87 FROM $config[sql_accounting_table]
88 WHERE AcctStopTime <= '$now_str' AND AcctStopTime >= '$prev_str'
89 AND (AcctTerminateCause LIKE 'Login-Incorrect%' OR
90 AcctTerminateCause LIKE 'Invalid-User%' OR
91 AcctTerminateCause LIKE 'Multiple-Logins%') $callerid_str $server_str
92 ORDER BY AcctStopTime $order $limit;");
94 while( $row = @da_sql_fetch_array($search,$config) ){
96 $acct_login = $row[UserName];
97 if ($acct_login == '')
100 $acct_login = "<a href=\"user_admin.php3?login=$acct_login\" title=\"Edit user $acct_login\">$acct_login</a>";
101 $acct_time = $row[AcctStopTime];
102 $acct_server = $row[NASIPAddress];
103 if ($acct_server != ''){
104 $acct_server = $da_name_cache[$acct_server];
105 if (!isset($acct_server)){
106 $acct_server = $row[NASIPAddress];
107 $acct_server = gethostbyaddr($acct_server);
108 if (!isset($da_name_cache) && $config[general_use_session] == 'yes'){
109 $da_name_cache[$row[NASIPAddress]] = $acct_server;
110 session_register('da_name_cache');
113 $da_name_cache[$row[NASIPAddress]] = $acct_server;
118 $acct_server = "$acct_server:$row[NASPortId]";
119 $acct_terminate_cause = "$row[AcctTerminateCause]";
120 if ($acct_terminate_cause == '')
121 $acct_terminate_cause = '-';
122 $acct_callerid = "$row[CallingStationId]";
123 if ($acct_callerid == '')
124 $acct_callerid = '-';
126 <tr align=center bgcolor="white">
130 <td>$acct_server</td>
131 <td>$acct_terminate_cause</td>
132 <td>$acct_callerid</td>
142 <tr><td align="left">
143 <form action="failed_logins.php3" method="get" name="master">
146 <td><small><b>time back (mins)</td><td><small><b>pagesize</td><td><small><b>caller id</td><td><b>order</td>
147 <tr valign="middle"><td>
148 <input type="text" name="last" size="11" value="$last"></td>
149 <td><select name="pagesize">
150 <option $selected[5] value="5" >05
151 <option $selected[10] value="10">10
152 <option $selected[15] value="15">15
153 <option $selected[20] value="20">20
154 <option $selected[40] value="40">40
155 <option $selected[80] value="80">80
156 <option $selected[all] value="all">all
160 <input type="text" name="callerid" size="11" value="$callerid"></td>
161 <td><select name="order">
162 <option $selected[asc] value="asc">older first
163 <option $selected[desc] value="desc">recent first
169 <td><input type="submit" class=button value="show"></td></tr>
171 <b>On Access Server:</b>
173 <select name="server">
177 $name = 'nas' . $i . '_name';
178 if ($config[$name] == ''){
182 $name_ip = 'nas' . $i . '_ip';
183 if ($server == $config[$name_ip])
184 echo "<option selected value=\"$config[$name_ip]\">$config[$name]\n";
186 echo "<option value=\"$config[$name_ip]\">$config[$name]\n";
188 if ($server == '' || $server == 'all')
189 echo "<option selected value=\"all\">all\n";
193 </table></td></tr></form>