예제 #1
0
 GLPI is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 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());
예제 #2
0
 GLPI is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 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, 'w', $_POST);
    $newID = $nn->add($_POST);
    Event::log($newID, "networkname", 5, "inventory", sprintf(__('%s adds an item'), $_SESSION["glpiname"]));
    Html::back();
} else {
    if (isset($_POST["delete"])) {
        $nn->check($_POST['id'], 'd');
        $nn->delete($_POST);
        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"], 'r')) {
                Html::redirect($node->getLinkURL());
            }
        }
        $nn->redirectToList();
    } else {