Ejemplo n.º 1
0
*/
include '../inc/includes.php';
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
$rssfeed = new RSSFeed();
Session::checkLoginUser();
if (isset($_POST["add"])) {
    $rssfeed->check(-1, CREATE, $_POST);
    $newID = $rssfeed->add($_POST);
    Event::log($newID, "rssfeed", 4, "tools", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $rssfeed->fields["name"]));
    Html::redirect($CFG_GLPI["root_doc"] . "/front/rssfeed.form.php?id=" . $newID);
} else {
    if (isset($_POST["purge"])) {
        $rssfeed->check($_POST["id"], PURGE);
        $rssfeed->delete($_POST, 1);
        Event::log($_POST["id"], "rssfeed", 4, "tools", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
        $rssfeed->redirectToList();
    } else {
        if (isset($_POST["update"])) {
            $rssfeed->check($_POST["id"], UPDATE);
            // Right to update the rssfeed
            $rssfeed->update($_POST);
            Event::log($_POST["id"], "rssfeed", 4, "tools", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
            Html::back();
        } else {
            if (isset($_POST["addvisibility"])) {
                if (isset($_POST["_type"]) && !empty($_POST["_type"]) && isset($_POST["rssfeeds_id"]) && $_POST["rssfeeds_id"]) {
                    $item = NULL;
                    switch ($_POST["_type"]) {
                        case 'User':
Ejemplo n.º 2
0
*/
include '../inc/includes.php';
if (!isset($_GET["id"])) {
    $_GET["id"] = "";
}
$rssfeed = new RSSFeed();
Session::checkLoginUser();
if (isset($_POST["add"])) {
    $rssfeed->check(-1, 'w', $_POST);
    $newID = $rssfeed->add($_POST);
    Event::log($newID, "rssfeed", 4, "tools", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $rssfeed->fields["name"]));
    Html::redirect($CFG_GLPI["root_doc"] . "/front/rssfeed.form.php?id=" . $newID);
} else {
    if (isset($_POST["delete"])) {
        $rssfeed->check($_POST["id"], 'd');
        $rssfeed->delete($_POST);
        Event::log($_POST["id"], "rssfeed", 4, "tools", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
        $rssfeed->redirectToList();
    } else {
        if (isset($_POST["update"])) {
            $rssfeed->check($_POST["id"], 'w');
            // Right to update the rssfeed
            $rssfeed->update($_POST);
            Event::log($_POST["id"], "rssfeed", 4, "tools", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
            Html::back();
        } else {
            if (isset($_POST["addvisibility"])) {
                if (isset($_POST["_type"]) && !empty($_POST["_type"]) && isset($_POST["rssfeeds_id"]) && $_POST["rssfeeds_id"]) {
                    $item = NULL;
                    switch ($_POST["_type"]) {
                        case 'User':