mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
git-svn-id: http://www.observium.org/svn/observer/trunk@1223 61d68cd4-352d-0410-923a-c4978735b2b8
31 lines
1002 B
PHP
31 lines
1002 B
PHP
<?php
|
|
|
|
$descr = mres($_POST['descr']);
|
|
$ignore = mres($_POST['ignore']);
|
|
$type = mres($_POST['type']);
|
|
$disabled = mres($_POST['disabled']);
|
|
$community = mres($_POST['community']);
|
|
$snmpver = mres($_POST['snmpver']);
|
|
$port = mres($_POST['port']);
|
|
|
|
#FIXME needs more sanity checking! and better feedback
|
|
|
|
$sql = "UPDATE `devices` SET `purpose` = '" . $descr . "', `community` = '" . $community . "', `type` = '$type'";
|
|
$sql .= ", `snmpver` = '" . $snmpver . "', `ignore` = '$ignore', `disabled` = '$disabled', `port` = '$port' WHERE `device_id` = '".$device['device_id']."'";
|
|
$query = mysql_query($sql);
|
|
|
|
$rows_updated = mysql_affected_rows();
|
|
|
|
if($rows_updated > 0) {
|
|
$update_message = mysql_affected_rows() . " Device record updated.";
|
|
$updated = 1;
|
|
} elseif ($rows_updated = '-1') {
|
|
$update_message = "Device record unchanged. No update necessary.";
|
|
$updated = -1;
|
|
} else {
|
|
$update_message = "Device record update error.";
|
|
$updated = 0;
|
|
}
|
|
|
|
?>
|