コード例 #1
0
<?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
コード例 #2
0
ファイル: startloggedin.inc.php プロジェクト: janizol/APS
<?php

session_start();
$pageName = basename($_SERVER["PHP_SELF"]);
require_once "classes/sessionhelper.class.php";
if (!SessionHelper::isLoggedIn() && $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
コード例 #3
0
ファイル: login.php プロジェクト: janizol/APS
<?php

session_start();
$pageName = basename($_SERVER["PHP_SELF"]);
require_once "classes/sessionhelper.class.php";
require_once "classes/formfieldtexts.class.php";
require_once "classes/userhelper.class.php";
require_once "classes/template.class.php";
require_once "classes/cookiehelper.class.php";
require_once "classes/jswriter.class.php";
require_once "classes/db.class.php";
$db = new Db();
if (SessionHelper::isLoggedIn()) {
    //	echo "IS LOGGED IN"; exit;
    if (SessionHelper::isAdmin()) {
        header("Location: report_time.php");
    } else {
        header("Location: index.php");
    }
    exit;
}
$showForm = true;
$message = "Please provide us with your login information.";
// specify $_GET["from"] to get a redirect on login. this is written in $_POST["from"] which overrides
$from = $_POST && $_POST["from"] ? $_POST["from"] : ($_GET && $_GET["from"] ? $_GET["from"] : "");
// specify $_GET["email"] to get a prefill for email
$cookieLoginUser = CookieHelper::getLoginUser();
$cookieLoginPass = CookieHelper::getLoginPass();
if ($cookieLoginUser && $cookieLoginPass) {
    $row = UserHelper::getUserRow($db, $cookieLoginUser, $cookieLoginPass);
    if ($row !== false) {