Example #1
0
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
* @since version 0.84
*/
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"]));
Example #2
0
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
* @since version 0.84
*/
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"]));