Exemple #1
0
    $_SESSION["pageErrors"] = $pageErrors;
    header("Location: ../shared/loginform.php");
    exit;
}
#****************************************************************************
#*  Redirect to suspended message if suspended
#****************************************************************************
if ($staff->isSuspended()) {
    header("Location: ../shared/suspended.php");
    exit;
}
#**************************************************************************
#*  Insert new session row with random token
#**************************************************************************
$sessionQ = new SessionQuery();
$sessionQ->connect();
if ($sessionQ->errorOccurred()) {
    $sessionQ->close();
    displayErrorPage($sessionQ);
}
$token = $sessionQ->getToken($staff->getUserid());
if ($token == false) {
    $sessionQ->close();
    displayErrorPage($sessionQ);
}
$sessionQ->close();
#**************************************************************************
#*  Destroy form values and errors and reset signon variables
#**************************************************************************
unset($_SESSION["postVars"]);
unset($_SESSION["pageErrors"]);
Exemple #2
0
 #****************************************************************************
 #*  Checking to see if session variables exist
 #****************************************************************************
 if (!isset($_SESSION["userid"]) or $_SESSION["userid"] == "") {
     header("Location: ../shared/loginform.php");
     exit;
 }
 if (!isset($_SESSION["token"]) or $_SESSION["token"] == "") {
     header("Location: ../shared/loginform.php");
     exit;
 }
 #****************************************************************************
 #*  Checking session table to see if session_id has timed out
 #****************************************************************************
 $sessQ = new SessionQuery();
 $sessQ->connect();
 if ($sessQ->errorOccurred()) {
     displayErrorPage($sessQ);
 }
 if (!$sessQ->validToken($_SESSION["userid"], $_SESSION["token"])) {
     if ($sessQ->errorOccurred()) {
         displayErrorPage($sessQ);
     }
     $sessQ->close();
     header("Location: ../shared/loginform.php?RET=" . U($returnPage));
     exit;
 }
 $sessQ->close();
 #****************************************************************************
 #*  Checking authorization for this tab
 #*  The session authorization flags were set at login in login.php