$admin = new BigTreeAdmin(); } // Load the default layout. $bigtree["layout"] = "default"; $bigtree["subnav_extras"] = array(); // If we're not logged in and we're not trying to login or access an embedded form, redirect to the login page. if (!isset($admin->ID) && $bigtree["path"][1] != "login") { if (implode(array_slice($bigtree["path"], 1), "/") != "ajax/auto-modules/embeddable-form") { $_SESSION["bigtree_login_redirect"] = DOMAIN . $_SERVER["REQUEST_URI"]; BigTree::redirect(ADMIN_ROOT . "login/"); } } // Developer Mode On? if (isset($admin->ID) && !empty($bigtree["config"]["developer_mode"]) && $admin->Level < 2) { include BigTree::path("admin/pages/developer-mode.php"); $admin->stop(); } // Redirect to dashboard by default if we're not requesting anything. if (!$bigtree["path"][1]) { BigTree::redirect(ADMIN_ROOT . "dashboard/"); } // See if we're requesting something in /ajax/ if ($bigtree["path"][1] == "ajax") { $module = false; if ($bigtree["path"][2] != "auto-modules") { // If the current user isn't allowed in the module for the ajax, stop them. $module = $admin->getModuleByRoute($bigtree["path"][2]); if ($module && !$admin->checkAccess($module["id"])) { die("Permission denied to module: " . $module["name"]); } elseif (!$admin->ID) { die("Please login.");