[- use DBI; -]
[- 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 $]
[- $HostChoice = $fdat{HostChoice} -]
[- chomp $HostChoice; -]
[- $LanChoice = $fdat{LanChoice} -]
[- chomp $LanChoice; -]
[- $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); -]
[- $sth = $dbh -> prepare ("select distinct HostName from Hosts order by HostName"); -]
[- $sth -> execute; -]
Lookup IP's for [+ $HostChoice +] [+ $LanChoice +] [+ $Event +]
[$ if $fdat{IP_List} ne "" $]
[- $host = (`dig +short -x $fdat{IP_List}`); -]
[- chomp $host; -]
[$ if $host ne "" $]
The HostName is [+ $host +]
[$ else $]
[+ $fdat{IP_List} +] Did not Resolve !!!
[$ endif $]
[$ endif $]