public static function configurePage(Template $t, $title, $bodyContent = null, $jsExtra = null) { $t->insertSlot("TITLE", $title); $currentPage = DocumentHelper::getCurrentPageName(); if ($bodyContent !== null) { $t->insertSlot("BODY_CONTENT", $bodyContent); } if ($jsExtra !== null) { $t->insertBlock("JS_EXTRA", $jsExtra); } if (SessionHelper::isAdmin()) { // logged in as admin $t->insertSlot("LOGIN_TEXT", "LOG OUT " . SessionHelper::getName()); $t->insertSlot("LOGIN_LINK", "logout.php"); } else { $t->insertBlock("LOGIN", ""); } // menu - highlight current page $t->insertSlot("CLASS_ABOUT", $currentPage == "about.php" ? "current" : ""); $t->insertSlot("CLASS_BOOKINGS", $currentPage == "bookings.php" ? "current" : ""); $t->insertSlot("CLASS_VALET_PARKING", $currentPage == "valet_parking.php" ? "current" : ""); $t->insertSlot("CLASS_VEHICLE_STORAGE", $currentPage == "vehicle_storage.php" ? "current" : ""); $t->insertSlot("CLASS_POOL_CAR", $currentPage == "pool_car.php" ? "current" : ""); $t->insertSlot("CLASS_RATES", $currentPage == "rates.php" ? "current" : ""); $t->insertSlot("CLASS_VIDEO", $currentPage == "video.php" ? "current" : ""); }
<?php session_start(); $pageName = basename($_SERVER["PHP_SELF"]); require_once "classes/sessionhelper.class.php"; if (!(SessionHelper::isLoggedIn() && SessionHelper::isAdmin()) && $pageName != "login.php") { require_once "classes/documenthelper.class.php"; // echo "NOT LOGGED IN "; // exit; header("Location: login.php?from=" . $pageName . DocumentHelper::getQueryString(true, true)); exit; } header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
session_destroy(); session_start(); // $sessionid = session_id(); SessionHelper::setSession($row); CookieHelper::setLoginUser($_POST["email"]); CookieHelper::setLoginPass(md5($_POST["password"])); } } // if ($success) { // they logged in using the form, send redirect headers // echo "SUCCESS " . print_r($_POST); exit; if ($from) { header("Location: " . $from); } else { if (SessionHelper::isAdmin()) { header("Location: report_time.php"); } else { header("Location: ."); } } exit; } } header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past require_once "classes/template.class.php"; require_once "classes/templatehelper.class.php"; require_once "classes/formwriter.class.php";