Files
librenms-librenms/includes/html/forms/delete-customoid.inc.php

26 lines
628 B
PHP
Raw Normal View History

<?php
header('Content-type: text/plain');
2020-09-21 15:40:17 +02:00
if (! Auth::user()->hasGlobalAdmin()) {
$response = [
'status' => 'error',
'message' => 'Need to be admin',
2020-09-21 15:40:17 +02:00
];
echo json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
exit;
}
2020-09-21 15:40:17 +02:00
if (! is_numeric($_POST['customoid_id'])) {
echo 'ERROR: No alert selected';
exit;
} else {
2020-09-21 15:40:17 +02:00
if (dbDelete('customoids', '`customoid_id` = ?', [$_POST['customoid_id']])) {
echo 'Custom OID has been deleted.';
exit;
} else {
echo 'ERROR: Custom OID has not been deleted.';
exit;
}
}