From b8cc74edfbf22799fa359a3c904eb8672609e392 Mon Sep 17 00:00:00 2001 From: sullrich Date: Sat, 5 Dec 2009 21:47:56 -0500 Subject: Allow GET calling of diag_ping and diag_traceroute so other areas of the GUI can easily link to them. Add links from DNS page for ping and traceroute. --- usr/local/www/diag_dns.php | 5 ++++- usr/local/www/diag_ping.php | 13 +++++++------ usr/local/www/diag_traceroute.php | 16 ++++++++-------- 3 files changed, 19 insertions(+), 15 deletions(-) (limited to 'usr') diff --git a/usr/local/www/diag_dns.php b/usr/local/www/diag_dns.php index df6bbeb..fe0c888 100644 --- a/usr/local/www/diag_dns.php +++ b/usr/local/www/diag_dns.php @@ -150,7 +150,10 @@ include("head.inc"); ?> More Information: - NOTE: These links are to external services, so their reliability cannot be guaranteed.

+ Ping
+ Traceroute +

+ NOTE: The following links are to external services, so their reliability cannot be guaranteed.

IP WHOIS @ DNS Stuff
IP Info @ DNS Stuff diff --git a/usr/local/www/diag_ping.php b/usr/local/www/diag_ping.php index 0ce85e3..4d82e06 100755 --- a/usr/local/www/diag_ping.php +++ b/usr/local/www/diag_ping.php @@ -46,24 +46,24 @@ require("guiconfig.inc"); define('MAX_COUNT', 10); define('DEFAULT_COUNT', 3); -if ($_POST) { +if ($_POST || $_REQUEST['host']) { unset($input_errors); unset($do_ping); /* input validation */ $reqdfields = explode(" ", "host count"); $reqdfieldsn = explode(",", "Host,Count"); - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + do_input_validation($_REQUEST, $reqdfields, $reqdfieldsn, &$input_errors); - if (($_POST['count'] < 1) || ($_POST['count'] > MAX_COUNT)) { + if (($_REQUEST['count'] < 1) || ($_REQUEST['count'] > MAX_COUNT)) { $input_errors[] = "Count must be between 1 and {MAX_COUNT}"; } if (!$input_errors) { $do_ping = true; - $host = $_POST['host']; - $interface = $_POST['interface']; - $count = $_POST['count']; + $host = $_REQUEST['host']; + $interface = $_REQUEST['interface']; + $count = $_REQUEST['count']; } } if (!isset($do_ping)) { @@ -145,3 +145,4 @@ include("head.inc"); ?> + diff --git a/usr/local/www/diag_traceroute.php b/usr/local/www/diag_traceroute.php index 3530c60..ec18da0 100755 --- a/usr/local/www/diag_traceroute.php +++ b/usr/local/www/diag_traceroute.php @@ -53,23 +53,23 @@ include("head.inc"); define('MAX_TTL', 64); define('DEFAULT_TTL', 18); -if ($_POST) { +if ($_POST || $_REQUEST['host']) { unset($input_errors); unset($do_traceroute); /* input validation */ $reqdfields = explode(" ", "host ttl"); $reqdfieldsn = explode(",", "Host,ttl"); - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); + do_input_validation($_REQUEST, $reqdfields, $reqdfieldsn, &$input_errors); - if (($_POST['ttl'] < 1) || ($_POST['ttl'] > MAX_TTL)) { + if (($_REQUEST['ttl'] < 1) || ($_REQUEST['ttl'] > MAX_TTL)) { $input_errors[] = "Maximum number of hops must be between 1 and {MAX_TTL}"; } if (!$input_errors) { $do_traceroute = true; - $host = $_POST['host']; - $ttl = $_POST['ttl']; + $host = $_REQUEST['host']; + $ttl = $_REQUEST['ttl']; } } @@ -80,7 +80,7 @@ if (!isset($do_traceroute)) { } ?> -

+ @@ -103,7 +103,7 @@ if (!isset($do_traceroute)) { @@ -120,7 +120,7 @@ if (!isset($do_traceroute)) { echo("
Traceroute output:
"); echo('
');
 					ob_end_flush();
-					if($_POST['useicmp'])
+					if($_REQUEST['useicmp'])
 						$useicmp = "-I";
 					else
 						$useicmp = "";
-- 
cgit v1.1

Traceroute
Use ICMP - > + >