more code cleanups, modify renamehost to also take a source parameter so we can build a renamehost function into the web gui some day

git-svn-id: http://www.observium.org/svn/observer/trunk@1980 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-27 10:21:19 +00:00
parent 7ffefc0d57
commit 340c71b2e7
27 changed files with 110 additions and 107 deletions

View File

@@ -24,9 +24,9 @@ if ($_POST['hostname'] && $_POST['community'])
} else {
echo("<p class='errorbox'><b>Error:</b> You don't have the necessary privileges to add hosts.</p>");
}
} elseif ($_POST['hostname'] && !$_POST['community'] ) {
} elseif ($_POST['hostname'] && !$_POST['community']) {
echo("<p class='errorbox'><b>Error:</b> A community string is required.</p>");
} elseif (!$_POST['hostname'] && $_POST['community'] ) {
} elseif (!$_POST['hostname'] && $_POST['community']) {
echo("<p class='errorbox'><b>Error:</b> A hostname is required.</p>");
}
@@ -35,27 +35,28 @@ if ($_POST['hostname'] && $_POST['community'])
<form name="form1" method="post" action="<?php echo($config['base_url']); ?>/addhost/">
<p>Devices will be checked for Ping and SNMP reachability before being probed. Only devices with recognised OSes will be added.</p>
<div style="padding: 10px; background: #f0f0f0;">
<table cellpadding=2px>
<tr>
<td><strong>Hostname</strong></td>
<td><input type="text" name="hostname" size="32"></td>
</tr>
<td><strong>Community</strong></td>
<td><input type="text" name="community" size="32"></td>
</tr>
<tr>
<td><strong>SNMP Version</strong></td>
<td><select name="snmpver">
<option value="v1">v1</option>
<option value="v2c" selected>v2c</option>
</select>
&nbsp;<strong>Port</strong> <input type="text" name="port" size="16">
</td>
</tr>
<tr>
<td></td><td><input type="submit" class="submit" name="Submit" value="Add Host"></td>
</tr>
</table>
</div>
<div style="padding: 10px; background: #f0f0f0;">
<table cellpadding=2px>
<tr>
<td><strong>Hostname</strong></td>
<td><input type="text" name="hostname" size="32"></td>
</tr>
<td><strong>Community</strong></td>
<td><input type="text" name="community" size="32"></td>
</tr>
<tr>
<td><strong>SNMP Version</strong></td>
<td>
<select name="snmpver">
<option value="v1">v1</option>
<option value="v2c" selected>v2c</option>
</select>
&nbsp;<strong>Port</strong> <input type="text" name="port" size="16">
</td>
</tr>
<tr>
<td></td><td><input type="submit" class="submit" name="Submit" value="Add Host"></td>
</tr>
</table>
</div>
</form>