2012-06-20 Hirofumi Kosaka <kosaka@rworks.jp>

* extensions/net_tools.php: Fixed bug: cannot find traceroute
	other than /usr/sbin/traceroute.
	Merged from 4.0.2


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6605 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
hkosaka 2012-06-20 07:27:56 +00:00
parent 0690e32063
commit 331820371e
2 changed files with 33 additions and 15 deletions

View File

@ -1,3 +1,9 @@
2012-06-20 Hirofumi Kosaka <kosaka@rworks.jp>
* extensions/net_tools.php: Fixed bug: cannot find traceroute
other than /usr/sbin/traceroute.
Merged from 4.0.2
2012-06-20 Hirofumi Kosaka <kosaka@rworks.jp>
* include/functions.php: Changed ambiguous time representation

View File

@ -53,16 +53,28 @@ function main_net_tools () {
switch($operation) {
case 1:
if (!file_exists('/usr/sbin/traceroute')) {
ui_print_error_message(__('Traceroute executable does not exist.'));
ob_start();
system('whereis traceroute');
$output = ob_get_clean();
$result = explode(':', $output);
$result = trim($result[1]);
if (! empty($result)) {
echo "<h3>".__("Traceroute to "). $ip. "</h3>";
echo "<pre>";
echo system ("traceroute $ip");
echo "</pre>";
}
else {
elseif (file_exists('/usr/sbin/traceroute')) {
echo "<h3>".__("Traceroute to "). $ip. "</h3>";
echo "<pre>";
echo system ("/usr/sbin/traceroute $ip");
echo "</pre>";
}
else {
ui_print_error_message(__('Traceroute executable does not exist.'));
}
break;
case 2:
ob_start();
system('whereis ping');