<?php
  //return current page name
  function curPageName() 
  {
        return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
  }

/*  function pageAccessCheck($pageName,$allowedPageArray)
  {
    if(in_array($pageName,$allowedPageArray))
        return true;
    else
        return false;
  }  */


//if(session_id()=="") //session does not exist
if(!$session->logged_in)
{
  echo accessDeniedMsg;
  exit;
}
/*if(!isset($_SESSION['userperm']) || !pageAccessCheck(curPageName(),$_SESSION['userperm']))
{
  echo accessDeniedMsg;
  exit;
}*/
?>
