<?php

$cms_root_path = "../../../";
require_once($cms_root_path."includes/compatibility_includer.php");

if (empty($_GET['page_id']) || !is_numeric($_GET['page_id'])) {
    header("HTTP/1.0 400 Bad Request");
    $error_message = "page_id missing from ping request.";
    ContentManagerPanel::addMessage($error_message);
    die($error_message);
}

$page = ContentManagerPanel::loadPage($_GET['page_id'], false);
if (empty($page->id)) {
    header("HTTP/1.0 409 Conflict");
    $error_message = "The page you are on was not found.";
    ContentManagerPanel::addMessage($error_message);
    die($error_message);
}

$page->save();
