hasGlobalAdmin()) { if (isset($_POST['parent_id'])) { $parents = array_diff((array)$_POST['parent_id'], ['0']); // TODO avoid loops! $device_model->parents()->sync($parents); } $override_sysLocation = (int)isset($_POST['override_sysLocation']); $override_sysLocation_string = isset($_POST['sysLocation']) ? $_POST['sysLocation'] : null; if ($override_sysLocation) { if ($override_sysLocation_string) { $location = Location::firstOrCreate(['location' => $override_sysLocation_string]); $device_model->location()->associate($location); } else { $device_model->location()->dissociate(); } } elseif ($device_model->override_sysLocation) { // no longer overridden, clear location $device_model->location()->dissociate(); } $device_model->override_sysLocation = $override_sysLocation; $device_model->purpose = $_POST['descr']; $device_model->ignore = (int)isset($_POST['ignore']); $device_model->disabled = (int)isset($_POST['disabled']); $device_model->disable_notify = (int)isset($_POST['disable_notify']); $device_model->type = $_POST['type']; if ($device_model->isDirty('type')) { set_dev_attrib($device, 'override_device_type', true); } if ($device_model->isDirty()) { if ($device_model->save()) { Toastr::success(__('Device record updated')); } else { Toastr::error(__('Device record update error')); } } if (isset($_POST['hostname']) && $_POST['hostname'] !== '' && $_POST['hostname'] !== $device['hostname']) { if (Auth::user()->hasGlobalAdmin()) { $result = renamehost($device['device_id'], $_POST['hostname'], 'webui'); if ($result == "") { Toastr::success("Hostname updated from {$device['hostname']} to {$_POST['hostname']}"); echo ' '; } else { Toastr::error($result . ". Does your web server have permission to modify the rrd files?"); } } else { Toastr::error('Only administrative users may update the device hostname'); } } $override_sysContact_bool = mres($_POST['override_sysContact']); if (isset($_POST['sysContact'])) { $override_sysContact_string = mres($_POST['sysContact']); } if ($override_sysContact_bool) { set_dev_attrib($device, 'override_sysContact_bool', '1'); } else { set_dev_attrib($device, 'override_sysContact_bool', '0'); } if (isset($override_sysContact_string)) { set_dev_attrib($device, 'override_sysContact_string', $override_sysContact_string); } } else { include 'includes/html/error-no-perm.inc.php'; } } $override_sysContact_bool = get_dev_attrib($device, 'override_sysContact_bool'); $override_sysContact_string = get_dev_attrib($device, 'override_sysContact_string'); $disable_notify = get_dev_attrib($device, 'disable_notify'); ?>

Device Settings


/>
override_sysLocation) { echo(' checked="1"'); } ?> />
override_sysLocation) { echo(' disabled="1"'); } ?> value="location); ?>" />
/>
value="" />
disabled) { echo("checked=checked"); } ?> />
disable_notify) { echo("checked=checked"); } ?> />
ignore) { echo("checked=checked"); } ?> />

" . formatStorage($sizeondisk) . " in " . $numrrds . " RRD files."); print_optionbar_end(); echo(""); echo("Last polled: " . $device['last_polled'] . ""); if ($device['last_discovered']) { echo("
Last discovered: " . $device['last_discovered'] . ""); } echo("
"); ?>