hasGlobalAdmin()) { $reload = false; 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 = $_POST['sysLocation'] ?? null; if ($override_sysLocation) { $device_model->override_sysLocation = false; // allow override (will be set to actual value later) $device_model->setLocation($override_sysLocation_string, true); optional($device_model->location)->save(); } elseif ($device_model->override_sysLocation) { // no longer overridden, clear location $device_model->location()->dissociate(); } $device_model->override_sysLocation = $override_sysLocation; $device_model->display = empty($_POST['display']) ? null : $_POST['display']; $device_model->purpose = $_POST['descr']; $device_model->poller_group = $_POST['poller_group']; $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']; $device_model->overwrite_ip = $_POST['overwrite_ip']; if ($device_model->isDirty('type')) { set_dev_attrib($device, 'override_device_type', true); } if ($device_model->isDirty('display')) { $reload = true; } if ($device_model->isDirty()) { if ($device_model->save()) { flash()->addSuccess(__('Device record updated')); } else { flash()->addError(__('Device record update error')); } } if (isset($_POST['hostname']) && $_POST['hostname'] !== '' && $_POST['hostname'] !== $device['hostname']) { if (Auth::user()->hasGlobalAdmin()) { $result = renamehost($device['device_id'], trim($_POST['hostname']), 'webui'); if ($result == '') { flash()->addSuccess("Hostname updated from {$device['hostname']} to {$_POST['hostname']}"); $reload = true; } else { flash()->addError($result . '. Does your web server have permission to modify the rrd files?'); } } else { flash()->addError('Only administrative users may update the device hostname'); } } $override_sysContact_bool = $_POST['override_sysContact']; if (isset($_POST['sysContact'])) { $override_sysContact_string = $_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); } // some changed data not stateful, just reload the page if ($reload) { echo ''; } } 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'); ?>

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'; } ?> />

' . \LibreNMS\Util\Number::formatBi($sizeondisk, 2, 3) . ' in ' . $numrrds . ' RRD files.'; echo ' | Last polled: ' . $device['last_polled'] . ''; if ($device['last_discovered']) { echo ' | Last discovered: ' . $device['last_discovered'] . ''; } print_optionbar_end(); ?>