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->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 (LegacyAuth::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'); } } } else { include 'includes/error-no-perm.inc.php'; } } ?>

Device Settings


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

" . formatStorage($sizeondisk) . " in " . $numrrds . " RRD files."); print_optionbar_end(); ?>