fixes from mrobbert

git-svn-id: http://www.observium.org/svn/observer/trunk@2429 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-09-08 05:02:14 +00:00
parent 3b2446d3cb
commit e8d37edaf9
3 changed files with 7 additions and 11 deletions
+1 -1
View File
@@ -372,7 +372,7 @@ function humanspeed($speed)
function print_error($text)
{
echo('<div class="errorbox"><img src="/images/15/exclamation.png" align="absmiddle"> '.$text.'</div>');
echo('<div class="errorbox"><img src="/images/16/exclamation.png" align="absmiddle"> '.$text.'</div>');
}
function print_message($text)
+2 -6
View File
@@ -8,12 +8,12 @@ if ($_SESSION['userlevel'] < 10)
echo("<h2>Add Device</h2>");
if ($_POST['hostname'] && $_POST['community'])
if ($_POST['hostname'])
{
if ($_SESSION['userlevel'] > '5')
{
$hostname = mres($_POST['hostname']);
$community = mres($_POST['community']);
if ($_POST['community']) { $community = mres($_POST['community']); } else { $community = $config['snmp']['community']; }
$snmpver = mres($_POST['snmpver']);
if ($_POST['port']) { $port = mres($_POST['port']); } else { $port = "161"; }
print_message("Adding host $hostname community $community port $port");
@@ -21,10 +21,6 @@ if ($_POST['hostname'] && $_POST['community'])
} else {
print_error("You don't have the necessary privileges to add hosts.");
}
} elseif ($_POST['hostname'] && !$_POST['community']) {
print_error("A community string is required.");
} elseif (!$_POST['hostname'] && $_POST['community']) {
print_error("A hostname is required.");
}
?>