Fallback to default Poller Group on delete (#11278)

* Fallback to default Poller Group on delete

* rewrite to eloquent

* replace column remove with page reload (refresh everything)

* change access verification check method

* .

* Update PollerGroups.php

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
SourceDoctor
2020-03-20 10:16:49 +01:00
committed by GitHub
parent 0658b56c77
commit 9092988f7b
5 changed files with 42 additions and 44 deletions

View File

@@ -1,35 +0,0 @@
<?php
/*
* LibreNMS
*
* Copyright (c) 2014 Neil Lathwood <https://github.com/laf/ http://www.lathwood.co.uk/fa>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version. Please see LICENSE.txt at the top level of
* the source code distribution for details.
*/
header('Content-type: text/plain');
if (!Auth::user()->hasGlobalAdmin()) {
die('ERROR: You need to be admin');
}
if (!is_numeric($_POST['group_id'])) {
echo 'error with data';
exit;
} else {
if ($_POST['confirm'] == 'yes') {
$delete = dbDelete('poller_groups', '`id` = ?', array($_POST['group_id']));
if ($delete > '0') {
echo 'Poller group has been removed';
exit;
} else {
echo 'An error occurred removing the Poller group';
exit;
}
}
}