diff options
author | N0YB <Al_Stu@Frontier.com> | 2013-03-16 17:19:46 -0700 |
---|---|---|
committer | N0YB <Al_Stu@Frontier.com> | 2013-03-16 17:19:46 -0700 |
commit | fe74228f2a8a9abc45a580a01559518043ca8d0b (patch) | |
tree | a02fce8c029171fa899fcc1085b99ec7691373a2 /usr | |
parent | ba6b2811a11e1ddf355a93cecbf72ccee71d9b85 (diff) | |
download | pfsense-fe74228f2a8a9abc45a580a01559518043ca8d0b.zip pfsense-fe74228f2a8a9abc45a580a01559518043ca8d0b.tar.gz |
Diag DNS Lookup Dialog Output
Display DNS lookup results in a dialog box rather than browsing away from the current page (Dashboard Firewall Widget or Status: System logs: Firewall) to the diag DNS page.
Especially useful when filtering so that filter does not have to be reposted to return to the current page.
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/diag_dns.php | 17 | ||||
-rwxr-xr-x | usr/local/www/diag_logs_filter.php | 4 | ||||
-rw-r--r-- | usr/local/www/widgets/widgets/log.widget.php | 8 |
3 files changed, 27 insertions, 2 deletions
diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index 931a885..511f333 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -144,6 +144,23 @@ if ($_POST) { } } +if( ($_POST['host']) && ($_POST['dialog_output']) ) { + display_host_results ($host,$resolved,$dns_speeds); + exit; +} + +function display_host_results ($address,$hostname,$dns_speeds) { + echo gettext("IP Address") . ": {$address} \n"; + echo gettext("Host Name") . ": {$hostname} \n"; + echo "\n"; + echo gettext("Server") . "\t" . gettext("Query Time") . "\n"; + if(is_array($dns_speeds)) + foreach($dns_speeds as $qt){ + echo trim($qt['dns_server']) . "\t" . trim($qt['query_time']); + echo "\n"; + } +} + include("head.inc"); ?> <body link="#000000" vlink="#000000" alink="#000000"> <?php include("fbegin.inc"); ?> diff --git a/usr/local/www/diag_logs_filter.php b/usr/local/www/diag_logs_filter.php index 64ffcbb..edb43ca 100755 --- a/usr/local/www/diag_logs_filter.php +++ b/usr/local/www/diag_logs_filter.php @@ -344,6 +344,8 @@ include("head.inc"); $dststr = $filterent['dstip'] . get_port_with_service($filterent['dstport'], $proto); ?> <td class="listMRr" nowrap="nowrap"> + <a href="#" onclick="javascript:getURL('diag_dns.php?host=<?php echo "{$filterent['srcip']}"; ?>&dialog_output=true', outputrule);" title="<?=gettext("Reverse Resolve with DNS");?>"> + <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log_d.gif" alt="Icon Reverse Resolve with DNS"/></a> <a href="diag_dns.php?host=<?php echo $filterent['srcip']; ?>" title="<?=gettext("Reverse Resolve with DNS");?>"> <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS"/></a> <a href="easyrule.php?<?php echo "action=block&int={$int}&src={$filterent['srcip']}&ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Add to Block List");?>" onclick="return confirm('<?=gettext("Do you really want to add this BLOCK rule?")."\n\n".gettext("Easy Rule is still experimental.")."\n".gettext("Continue at risk of your own peril.")."\n".gettext("Backups are also nice.")?>')"> @@ -351,6 +353,8 @@ include("head.inc"); <?php echo $srcstr;?> </td> <td class="listMRr" nowrap="nowrap"> + <a href="#" onclick="javascript:getURL('diag_dns.php?host=<?php echo "{$filterent['dstip']}"; ?>&dialog_output=true', outputrule);" title="<?=gettext("Reverse Resolve with DNS");?>"> + <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log_d.gif" alt="Icon Reverse Resolve with DNS" /></a> <a href="diag_dns.php?host=<?php echo $filterent['dstip']; ?>" title="<?=gettext("Reverse Resolve with DNS");?>"> <img border="0" src="/themes/<?= $g['theme']; ?>/images/icons/icon_log.gif" alt="Icon Reverse Resolve with DNS" /></a> <a href="easyrule.php?<?php echo "action=pass&int={$int}&proto={$proto}&src={$filterent['srcip']}&dst={$filterent['dstip']}&dstport={$filterent['dstport']}&ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Pass this traffic");?>" onclick="return confirm('<?=gettext("Do you really want to add this PASS rule?")."\n\n".gettext("Easy Rule is still experimental.")."\n".gettext("Continue at risk of your own peril.")."\n".gettext("Backups are also nice.");?>')"> diff --git a/usr/local/www/widgets/widgets/log.widget.php b/usr/local/www/widgets/widgets/log.widget.php index 15d32f3..bb38d8d 100644 --- a/usr/local/www/widgets/widgets/log.widget.php +++ b/usr/local/www/widgets/widgets/log.widget.php @@ -185,8 +185,12 @@ function format_log_line(row) { </a> </td> <td class="listMRr ellipsis nowrap" title="<?php echo htmlspecialchars($filterent['interface']);?>"><?php echo htmlspecialchars($filterent['interface']);?></td> - <td class="listMRr ellipsis nowrap" title="<?php echo htmlspecialchars($filterent['src']);?>"><?php echo htmlspecialchars($filterent['src']);?></td> - <td class="listMRr ellipsis nowrap" title="<?php echo htmlspecialchars($filterent['dst']);?>"><?php echo htmlspecialchars($filterent['dst']);?></td> + <td class="listMRr ellipsis nowrap" title="<?php echo htmlspecialchars($filterent['src']);?>"> + <a href="#" onclick="javascript:getURL('diag_dns.php?host=<?php echo "{$filterent['srcip']}"; ?>&dialog_output=true', outputrule);" title="<?=gettext("Reverse Resolve with DNS");?>"> + <?php echo htmlspecialchars($filterent['srcip']);?></a><?php echo ":" . htmlspecialchars($filterent['srcport']);?></td> + <td class="listMRr ellipsis nowrap" title="<?php echo htmlspecialchars($filterent['dst']);?>"> + <a href="#" onclick="javascript:getURL('diag_dns.php?host=<?php echo "{$filterent['dstip']}"; ?>&dialog_output=true', outputrule);" title="<?=gettext("Reverse Resolve with DNS");?>"> + <?php echo htmlspecialchars($filterent['dstip']);?></a><?php echo ":" . htmlspecialchars($filterent['dstport']);?></td> <?php if ($filterent['proto'] == "TCP") $filterent['proto'] .= ":{$filterent['tcpflags']}"; |