Location: PHPKode > projects > Basic Announce > Basic Announce Version 4.0/inc/checkUserPagePermissions.php
<?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'] == "user" || $_SESSION['adm_status'] == "privileged user")){
        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: ../index.php");
        exit;
    }        
?>
Return current item: Basic Announce