/** * Checks the session var * @static checkAuthorisation() * @access public * @author Sam West aka Nimmit - osc@kangaroopartners.com * @param $sessionVar string session variable name * @return void */ function checkAuthorisation($sessionVar) { if (!amSessionIsRegistered($sessionVar)) { exit("Session not registered - You cant access this page directly"); } if ($GLOBALS[$sessionVar] != stopDirectAccess::makeSessionId()) { exit("Session ids don't match - You cant access this page directly"); } }
/** * Sets the global session variable * @static authorise() * @access public * @author Sam West aka Nimmit - osc@kangaroopartners.com * @param $sessionVar string session variable name * @return void */ function authorise($sessionVar) { amSessionRegister($sessionVar); $GLOBALS[$sessionVar] = stopDirectAccess::makeSessionId(); }