verifyCSRFToken(); $bigtree["layout"] = "front-end"; $page = $_POST["page"]; if ($page[0] == "p") { $change_id = substr($page,1); $f = $admin->getPendingChange($change_id); $pdata = $f["changes"]; $r = $admin->getPageAccessLevel($pdata["parent"]); } else { $r = $admin->getPageAccessLevel($page); // Get pending page data with resources decoded and tags. $pdata = $cms->getPendingPage($page,true,true); } // Work out the permissions if ($r == "p") { $publisher = true; } elseif ($r == "e") { $publisher = false; } else { ?>

Error

You do not have access to this page.

stop(); } $resources = array(); $bigtree["crops"] = array(); $bigtree["errors"] = array(); // Initiate the Storage class for backwards compat. $upload_service = new BigTreeStorage; // Save the template since we're not passing in the full update data. $_POST["template"] = $pdata["template"]; // Parse resources include BigTree::path("admin/modules/pages/_resource-parse.php"); // Un-htmlspecialchar everything since createPage / updatePage is going to re-do it. foreach ($pdata as $key => $val) { if (!is_array($val)) { $pdata[$key] = htmlspecialchars_decode($val); } } $pdata["resources"] = $_POST["resources"]; if ($publisher && $_POST["ptype"] == "Save & Publish") { // Let's make it happen. if ($page[0] == "p") { // It's a pending page, so let's create one. $page = $admin->createPage($pdata); $admin->deletePendingChange($change_id); } else { // It's an existing page. $admin->updatePage($page,$pdata); } $refresh_link = $cms->getLink($page); } else { if (!$_POST["parent"]) { $_POST["parent"] = $pdata["parent"]; } $admin->submitPageChange($page,$pdata); $refresh_link = $cms->getPreviewLink($page); } $admin->unlock("bigtree_pages",$page); if (count($bigtree["crops"])) { $_SESSION["bigtree_admin"]["form_data"]["crop_key"] = $cms->cacheUnique("org.bigtreecms.crops", $bigtree["crops"]); include BigTree::path("admin/modules/pages/_front-end-crop.php"); } elseif (count($bigtree["errors"])) { include BigTree::path("admin/modules/pages/_front-end-error.php"); } else { ?>