// Global init ob_start(); session_start(); // Make sure all the data we recieve is UTF-8, // from now on there is only one charset in the world for me: UTF-8 header('Content-Type: text/html; charset=utf-8'); require_once "include/bootstrap.php"; load("core"); $process_start = timer(); // Use this wherever you want, can be useful for debugging load("configuration"); load("text"); load("database_connect"); load("smarty_glue"); load("login_bootstrap"); $smarty = new smarty_glue(); // Getting ready for the real deal: including our pages $arguments = array_keys($_GET); $action = addslashes($arguments[1]); if (isset($arguments[0]) && !eregi("^[a-z0-9_-]+\$", $arguments[0])) { redirect("./"); } // Just for fun $load = exec('uptime'); $load = split('load averages: ', $load); $smarty->assign("server_load", $load[1]); // Giving control to page/*.php if (isset($arguments)) { if (file_exists("page/" . $arguments[0] . ".php") && is_readable("page/" . $arguments[0] . ".php")) { require_once "page/" . strtolower($arguments[0]) . ".php"; } elseif (empty($arguments[0]) || !empty($_GET[$arguments[0]])) {
// from now on there is only one charset in the world for me: UTF-8 header('Content-Type: text/html; charset=utf-8'); require_once "../include/bootstrap.php"; load("core"); $process_start = timer(); // Use this wherever you want, can be useful for debugging load("configuration"); load("text"); load("database_connect"); load("smarty_glue"); load("login_bootstrap"); // We don't want regular users to sniff around in here if (!$_SESSION['login'] || $_SESSION['user_level'] == !1) { redirect("../"); die; } $smarty = new smarty_glue(); $smarty->set_template("admin"); // Getting ready for the real deal: including our pages $arguments = array_keys($_GET); $action = $arguments[1]; if (isset($arguments) && file_exists("page/" . $arguments[0] . ".php") && is_readable("page/" . $arguments[0] . ".php") && eregi("^[a-z0-9_-]+\$", $arguments[0])) { $include = strtolower($arguments[0]); } elseif (empty($arguments[0]) || !empty($_GET[$arguments[0]])) { // if arguments for specific page like ./?page=1 $include = "main"; } else { redirect("./"); } require_once "page/" . $include . ".php"; ob_end_flush();