Location: PHPKode > projects > IPTables log analyzer > iptablelog/reports/modules/users.php
<?
#require_once("config.php");
#require_once "../lib/db.php";
#db_connect($db_host,$db_name,$db_user,$db_password);
$query = "SELECT host,ip,inet_ntoa(ip) FROM host_cache WHERE host LIKE '%.$reports_user_localdomain.' ORDER BY host";
$result = db_query($query);
echo "<table width='100%'><tr bgcolor='#DDDDDD'><td colspan=7><b>User report:</b>";
if ($reports_user_localdomain == "mydomain.com") {
	echo " The local domain is currently unset, making this report pretty much useless." .
			"  Please edit repots/conf/config.php.";
	}
echo "</td></tr>\n";
echo "<tr bgcolor='#DDDDDD'><td><table cellspacing=1 cellpadding=1 width='100%'>\n<tr><td>Host</td><td align=center>IP Address</td><td align=center>Action</td><td>&nbsp;</td>\n";
echo "<td>Host</td><td align=center>IP Address</td><td>Action</td></tr>\n";

while($row = db_nextrow($result)) {
	#echo "$row[0] $row[1] ($row[2]) <br>";
	echo "<tr bgcolor='#FFFFFF'><td>$row[0]</td><td align=center>$row[2]</td><td align=center><a href=''>show</a> &nbsp; &nbsp; <a href='index.php?action=summary&ip=$row[1]'>summary</a></td><td>&nbsp;</td>\n";
         if ($row = db_nextrow($result)) {
                 echo "<td>$row[0]</td><td align=center>$row[2]</td><td align=center><a href=''>show</a> &nbsp; &nbsp; <a href='index.php?action=summary&ip=$row[1]'>summary</a></td></tr>\n";
         } else {
                 echo "<td colspan=3>&nbsp;</td></tr>\n";
         }
}
echo "</table></td></tr></table><p>&nbsp;</p>";

#db_disconnect();
Return current item: IPTables log analyzer