librenms-librenms/includes/html/forms/delete-customoid.inc.php
louis-oui 934260cc75 Feature: Custom OID polling and graphing (#10945)
* merge

* fix db migration

* fix new auth

* fix new auth

* fix new auth

* fix new auth

* fix db schema tests

* fix polling customoid

* fix polling customoid

* fix graph

* fix graph

* fix graph

* fix CI

* fix CI

* always update prev value

* typo
2019-12-18 18:17:21 -06:00

26 lines
568 B
PHP

<?php
header('Content-type: text/plain');
if (!Auth::user()->hasGlobalAdmin()) {
$response = array(
'status' => 'error',
'message' => 'Need to be admin',
);
echo _json_encode($response);
exit;
}
if (!is_numeric($_POST['customoid_id'])) {
echo 'ERROR: No alert selected';
exit;
} else {
if (dbDelete('customoids', '`customoid_id` = ?', array($_POST['customoid_id']))) {
echo 'Custom OID has been deleted.';
exit;
} else {
echo 'ERROR: Custom OID has not been deleted.';
exit;
}
}