1 | <?php |
||
2 | |||
3 | header('Content-type: text/plain'); |
||
4 | |||
5 | if (! Auth::user()->hasGlobalAdmin()) { |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
6 | $response = [ |
||
7 | 'status' => 'error', |
||
8 | 'message' => 'Need to be admin', |
||
9 | ]; |
||
10 | echo json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); |
||
11 | exit; |
||
12 | } |
||
13 | |||
14 | if (! is_numeric($_POST['customoid_id'])) { |
||
15 | echo 'ERROR: No alert selected'; |
||
16 | exit; |
||
17 | } else { |
||
18 | if (dbDelete('customoids', '`customoid_id` = ?', [$_POST['customoid_id']])) { |
||
19 | echo 'Custom OID has been deleted.'; |
||
20 | exit; |
||
21 | } else { |
||
22 | echo 'ERROR: Custom OID has not been deleted.'; |
||
23 | exit; |
||
24 | } |
||
25 | } |
||
26 |