<?php
// check if there is outside access attempt
$http_referer = isset($_SERVER['HTTP_REFERER']) ? ($_SERVER['HTTP_REFERER']) : "";
$http_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : "";
if($http_referer != "" && !preg_match("/".$http_host."/i", $http_referer)){
echo "Nice Try!";
exit;
}
$objSession = new SecureSession();
$objSession_Analysis = false;
if(!isset($_SESSION)) session_start();
if(isset($_SESSION['adm_logged']) && ($_SESSION['adm_status'] == "admin" || $_SESSION['adm_status'] == "main admin")){
if($objSession->AnalyseFingerPrint($objSession_Analysis) === true) {
// echo "Fingerprints verified - You're logged in";
}else{ // $Session->AnalyseFingerPrint() returned false, so kill the session and optionally throw error
$objSession->Destroy(); // This method resets the $_SESSION array, removes the session cookies and destroys the session
// Possible return values of $objSession_Analysis pass by reference var:
// true - Fingerprint match OK, no problems.
// false - A fingerprint was stored in the session, but doesnt match a new request
// null - No fingerprint variable was stored in the user's session to check
// Example of using $objSession_Analysis var to serve up different errors, redirects etc
//echo "We kicked you out the site because you're an ";
//echo ($objSession_Analysis === false) ? "Imposter - Your fingerprints don't match" : "Infiltrator - You have no finger prints";
}
}else{
header("location: ../login.php");
exit;
}
?>