mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Use Laravel for authentication Support legacy auth methods Always create DB entry for users (segregate by auth method) Port api auth to Laravel restrict poller errors to devices the user has access to Run checks on every page load. But set a 5 minute (configurable) timer. Only run some checks if the user is an admin Move toastr down a few pixels so it isn't as annoying. Fix menu not loaded on laravel pages when twofactor is enabled for the system, but disabled for the user. Add two missing menu entries in the laravel menu Rewrite 2FA code Simplify some and verify code before applying Get http-auth working Handle legacy $_SESSION differently. Allows Auth::once(), etc to work. * Fix tests and mysqli extension check * remove duplicate Toastr messages * Fix new items * Rename 266.sql to 267.sql
76 lines
2.6 KiB
PHP
76 lines
2.6 KiB
PHP
<?php
|
|
|
|
use LibreNMS\Authentication\LegacyAuth;
|
|
|
|
if ($_POST['editing']) {
|
|
if (LegacyAuth::user()->hasGlobalAdmin()) {
|
|
$ipmi_hostname = mres($_POST['ipmi_hostname']);
|
|
$ipmi_username = mres($_POST['ipmi_username']);
|
|
$ipmi_password = mres($_POST['ipmi_password']);
|
|
|
|
if ($ipmi_hostname != '') {
|
|
set_dev_attrib($device, 'ipmi_hostname', $ipmi_hostname);
|
|
} else {
|
|
del_dev_attrib($device, 'ipmi_hostname');
|
|
}
|
|
|
|
if ($ipmi_username != '') {
|
|
set_dev_attrib($device, 'ipmi_username', $ipmi_username);
|
|
} else {
|
|
del_dev_attrib($device, 'ipmi_username');
|
|
}
|
|
|
|
if ($ipmi_password != '') {
|
|
set_dev_attrib($device, 'ipmi_password', $ipmi_password);
|
|
} else {
|
|
del_dev_attrib($device, 'ipmi_password');
|
|
}
|
|
|
|
$update_message = 'Device IPMI data updated.';
|
|
$updated = 1;
|
|
} else {
|
|
include 'includes/error-no-perm.inc.php';
|
|
}//end if
|
|
}//end if
|
|
|
|
if ($updated && $update_message) {
|
|
print_message($update_message);
|
|
} elseif ($update_message) {
|
|
print_error($update_message);
|
|
}
|
|
|
|
?>
|
|
|
|
<h3>IPMI settings</h3>
|
|
|
|
<form id="edit" name="edit" method="post" action="" role="form" class="form-horizontal">
|
|
<input type="hidden" name="editing" value="yes">
|
|
<div class="form-group">
|
|
<label for="ipmi_hostname" class="col-sm-2 control-label">IPMI/BMC Hostname</label>
|
|
<div class="col-sm-6">
|
|
<input id="ipmi_hostname" name="ipmi_hostname" class="form-control" value="<?php echo get_dev_attrib($device, 'ipmi_hostname'); ?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="ipmi_username" class="col-sm-2 control-label">IPMI/BMC Username</label>
|
|
<div class="col-sm-6">
|
|
<input id="ipmi_username" name="ipmi_username" class="form-control" value="<?php echo get_dev_attrib($device, 'ipmi_username'); ?>" />
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="impi_password" class="col-sm-2 control-label">IPMI/BMC Password</label>
|
|
<div class="col-sm-6">
|
|
<input id="ipmi_password" name="ipmi_password" type="password" class="form-control" value="<?php echo get_dev_attrib($device, 'ipmi_password'); ?>" />
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-1 col-md-offset-2">
|
|
<button type="submit" name="Submit" class="btn btn-default"><i class="fa fa-check"></i> Save</button>
|
|
</div>
|
|
</div>
|
|
<br><br>
|
|
<div class="alert alert-info" role="alert">
|
|
<p>To disable IPMI polling, please clear the setting fields and click <b>Save</b>.</p>
|
|
</div>
|
|
</form>
|