mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Apply fixes from StyleCI (#12120)
This commit is contained in:
@@ -22,32 +22,31 @@
|
||||
* @copyright 2017 Tony Murray
|
||||
* @author Tony Murray <[email protected]>
|
||||
*/
|
||||
|
||||
if (!Auth::user()->hasGlobalAdmin()) {
|
||||
$status = array('status' => 1, 'message' => 'You need to be admin');
|
||||
if (! Auth::user()->hasGlobalAdmin()) {
|
||||
$status = ['status' => 1, 'message' => 'You need to be admin'];
|
||||
} else {
|
||||
$device_id = $_POST['device_id'];
|
||||
$app = $_POST['application'];
|
||||
|
||||
if (!isset($app) && validate_device_id($device_id) === false) {
|
||||
$status = array('status' => 1, 'message' => 'Error with data');
|
||||
if (! isset($app) && validate_device_id($device_id) === false) {
|
||||
$status = ['status' => 1, 'message' => 'Error with data'];
|
||||
} else {
|
||||
$status = array('status' => 1, 'message' => 'Database update failed');
|
||||
$status = ['status' => 1, 'message' => 'Database update failed'];
|
||||
if ($_POST['state'] == 'true') {
|
||||
$update = array(
|
||||
$update = [
|
||||
'device_id' => $device_id,
|
||||
'app_type' => $app,
|
||||
'app_status' => '',
|
||||
'app_instance' => ''
|
||||
);
|
||||
'app_instance' => '',
|
||||
];
|
||||
if (dbInsert($update, 'applications')) {
|
||||
log_event("Application enabled by user: $app", $device_id, 'application', 1);
|
||||
$status = array('status' => 0, 'message' => 'Application enabled');
|
||||
$status = ['status' => 0, 'message' => 'Application enabled'];
|
||||
}
|
||||
} else {
|
||||
if (dbDelete('applications', '`device_id`=? AND `app_type`=?', array($device_id, $app))) {
|
||||
if (dbDelete('applications', '`device_id`=? AND `app_type`=?', [$device_id, $app])) {
|
||||
log_event("Application disabled by user: $app", $device_id, 'application', 3);
|
||||
$status = array('status' => 0, 'message' => 'Application disabled');
|
||||
$status = ['status' => 0, 'message' => 'Application disabled'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user