trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } header('Content-type: application/json'); include 'functions.php'; // ================= // ! Get the page id // ================= $page_id = $val->sanitizePost('page_id', 'numeric'); if (!$page_id) { $ajax = array('message' => $backend->lang()->translate('You sent an invalid value.'), 'success' => false); print json_encode($ajax); exit; } // check perms and page dir backend_pages_prechecks('pages_settings'); // get form data $options = backend_pages_getoptions(); // check titles if (CAT_Helper_Page::sanitizeTitles($options) === false) { $ajax = array('message' => $backend->lang()->translate('Please enter a menu title'), 'success' => false); print json_encode($ajax); exit; } // ======================== // ! Get existing page data // ======================== $page = CAT_Helper_Page::getPage($page_id); $old_parent = $page['parent']; $old_link = $page['link']; $old_position = $page['position'];
$root = "../"; $level = 1; while ($level < 10 && !file_exists($root . '/framework/class.secure.php')) { $root .= "../"; $level += 1; } if (file_exists($root . '/framework/class.secure.php')) { include $root . '/framework/class.secure.php'; } else { trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } header('Content-type: application/json'); include 'functions.php'; // check perms and page dir backend_pages_prechecks('pages_delete'); // Get page id $page_id = $val->sanitizePost('page_id', 'numeric'); if (!$page_id) { $ajax = array('message' => $backend->lang()->translate('You sent an invalid value'), 'success' => false); print json_encode($ajax); exit; } if (!CAT_Helper_Page::getPagePermission($page_id, 'admin')) { $ajax = array('message' => $backend->lang()->translate('You do not have the permission to delete this page.'), 'success' => false); print json_encode($ajax); exit; } // Find out more about the page $page = CAT_Helper_Page::properties($page_id); if (!$page) {
$root = "../"; $level = 1; while ($level < 10 && !file_exists($root . '/framework/class.secure.php')) { $root .= "../"; $level += 1; } if (file_exists($root . '/framework/class.secure.php')) { include $root . '/framework/class.secure.php'; } else { trigger_error(sprintf("[ <b>%s</b> ] Can't include class.secure.php!", $_SERVER['SCRIPT_NAME']), E_USER_ERROR); } } header('Content-type: application/json'); include 'functions.php'; // check perms and page dir backend_pages_prechecks('pages_add'); // get form data $options = backend_pages_getoptions(); // ============================================================= // ! Check if user has permission to add a page at this position // ============================================================= if ($options['parent'] != 0) { if (!CAT_Helper_Page::getPagePermission($options['parent'], 'admin')) { $ajax = array('message' => $backend->lang()->translate('You do not have the permission add a page here.'), 'success' => false); print json_encode($ajax); exit; } } elseif (!$users->checkPermission('pages', 'pages_add_l0', false) == true) { $ajax = array('message' => $backend->lang()->translate('You do not have the permission add a page here.'), 'success' => false); print json_encode($ajax); exit;