You should have received a copy of the GNU General Public License along with Addressing. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ include '../../../inc/includes.php'; if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (isset($_GET["start"])) { $start = $_GET["start"]; } else { $start = 0; } $addressing = new PluginAddressingAddressing(); if (isset($_POST["add"])) { $addressing->check(-1, CREATE, $_POST); if (!empty($_POST["name"]) && !empty($_POST["begin_ip"]) && !empty($_POST["end_ip"])) { $newID = $addressing->add($_POST); } else { Session::addMessageAfterRedirect(__('Problem when adding, required fields are not here', 'addressing'), false, ERROR); } if ($_SESSION['glpibackcreated']) { Html::redirect($addressing->getFormURL() . "?id=" . $newID); } Html::back(); } else { if (isset($_POST["delete"])) { $addressing->check($_POST['id'], DELETE); $addressing->delete($_POST); $addressing->redirectToList(); } else {
You should have received a copy of the GNU General Public License along with Addressing. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ include '../../../inc/includes.php'; if (!isset($_GET["id"])) { $_GET["id"] = ""; } if (isset($_GET["start"])) { $start = $_GET["start"]; } else { $start = 0; } $PluginAddressingAddressing = new PluginAddressingAddressing(); if (isset($_POST["add"])) { $PluginAddressingAddressing->check(-1, 'w', $_POST); if (!empty($_POST["name"]) && !empty($_POST["begin_ip"]) && !empty($_POST["end_ip"])) { $newID = $PluginAddressingAddressing->add($_POST); } else { Session::addMessageAfterRedirect(__('Problem when adding, required fields are not here', 'addressing'), false, ERROR); } Html::back(); } else { if (isset($_POST["delete"])) { $PluginAddressingAddressing->check($_POST['id'], 'w'); $PluginAddressingAddressing->delete($_POST); $PluginAddressingAddressing->redirectToList(); } else { if (isset($_POST["restore"])) { $PluginAddressingAddressing->check($_POST['id'], 'w'); $PluginAddressingAddressing->restore($_POST);