mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
PSR2 Cleanup: /html edition
Travis tests for code conformance. Ignore warnings for now. Fixed all errors, left most warnings.
This commit is contained in:
@@ -38,26 +38,25 @@ if ($_GET['query'] && $_GET['cmd']) {
|
||||
$host = $_GET['query'];
|
||||
if (Net_IPv6::checkIPv6($host) || Net_IPv4::validateip($host) || filter_var('http://'.$host, FILTER_VALIDATE_URL)) {
|
||||
switch ($_GET['cmd']) {
|
||||
case 'whois':
|
||||
$cmd = $config['whois']." $host | grep -v \%";
|
||||
break;
|
||||
case 'whois':
|
||||
$cmd = $config['whois']." $host | grep -v \%";
|
||||
break;
|
||||
|
||||
case 'ping':
|
||||
$cmd = $config['ping']." -c 5 $host";
|
||||
break;
|
||||
case 'ping':
|
||||
$cmd = $config['ping']." -c 5 $host";
|
||||
break;
|
||||
|
||||
case 'tracert':
|
||||
$cmd = $config['mtr']." -r -c 5 $host";
|
||||
break;
|
||||
case 'tracert':
|
||||
$cmd = $config['mtr']." -r -c 5 $host";
|
||||
break;
|
||||
|
||||
case 'nmap':
|
||||
if ($_SESSION['userlevel'] != '10') {
|
||||
echo 'insufficient privileges';
|
||||
}
|
||||
else {
|
||||
$cmd = $config['nmap']." $host";
|
||||
}
|
||||
break;
|
||||
case 'nmap':
|
||||
if ($_SESSION['userlevel'] != '10') {
|
||||
echo 'insufficient privileges';
|
||||
} else {
|
||||
$cmd = $config['nmap']." $host";
|
||||
}
|
||||
break;
|
||||
}//end switch
|
||||
|
||||
if (!empty($cmd)) {
|
||||
|
||||
Reference in New Issue
Block a user