You should have received a copy of the GNU General Public License along with GLPI. If not, see <http://www.gnu.org/licenses/>. -------------------------------------------------------------------------- */ /** @file * @brief */ include '../inc/includes.php'; $nn = new NetworkName(); if (isset($_POST["add"])) { $nn->check(-1, CREATE, $_POST); if ($newID = $nn->add($_POST)) { Event::log($newID, "networkname", 5, "inventory", sprintf(__('%s adds an item'), $_SESSION["glpiname"])); if ($_SESSION['glpibackcreated']) { Html::redirect($nn->getFormURL() . "?id=" . $newID); } } Html::back(); } else { if (isset($_POST["purge"])) { $nn->check($_POST['id'], PURGE); $nn->delete($_POST, 1); Event::log($_POST["id"], "networkname", 5, "inventory", sprintf(__('%s purges an item'), $_SESSION["glpiname"])); if ($node = getItemForItemtype($nn->fields["itemtype"])) { if ($node->can($nn->fields["items_id"], READ)) { Html::redirect($node->getLinkURL()); } } $nn->redirectToList(); } else {