[- use DBI; -] [- use POSIX; -] [- use Socket -] [- $req = shift; -] [# Lets look for UNIX Metacharacters in the query string from the browser #] [$ if $ENV{'QUERY_STRING'} =~ /([;\*\/'\$!#\(\)\[\]\{\}:'"])/ $] [- Execute ('error.html') -] [- exit -] [$ endif $] [- $LanChoice = $fdat{LanChoice}; -] [- chomp $LanChoice; -] [- $HostChoice = $fdat{HostChoice} -] [- chomp $HostChoice; -] [- $Event = $fdat{Event} -] [- chomp $Event; -] [$ if $Event eq "Inbnd" $] [- $TableName = "InBnd" -] [$ elsif $Event eq "Outbnd" $] [- $TableName = "OutBnd" -] [$ endif $] [- ($dsn) = "DBI:mysql:FireWatch"; -] [- $dsn .= ";mysql_read_default_file=./sql.epl"; -] [- $dbh = DBI->connect($dsn); -]

[+ $LanChoice +] [+ $Event +] Events blocked from [+ $req->{Time30} +] to [+ $req->{TimeNow} +] on [+ $HostChoice +]

[- $sth = $dbh -> prepare ( "select DateStamp,TimeStamp,SRC_IP,SRC_Port,DST_Port,Protocol from `${HostChoice}_${TableName}_Week$req->{weeknum}` where DateTimeStamp <= '$req->{TimeNow}' and DateTimeStamp >= '$req->{Time30}' and Lan = '$LanChoice' and Event like '$Event%' order by TimeStamp desc"); -] [- $sth -> execute; -] [$ while @row = $sth -> fetchrow_array $] [$ endwhile $]
Date Stamp Time Stamp Source IP Source Port DST Port Protocol
[+ @row[0] +] [+ @row[1] +] [+ inet_ntoa(pack"N", hex(@row[2])) +] [+ @row[3] +] [+ @row[4] +] [+ @row[5] +]
[- $dbh->disconnect -]

Reload Page