Cannot access page even though logged in
I am using SA 2 and have created login, registration pages etc. using the wizard.
I can successfully register and login but when I try to access a page that is protected using the Access Pages Manager I am continually redirected to the Access Denied page I have created. In the MySQL table I have set a field UserLevel as Int (11). I manually assign a user access level to each registered user, where administrators are level 3. In the SA Secure Page settings for each page I have it as in the attached screenshot. I cannot see why this does not work based upon this rule setting.
The code at the top of the page is
<?php require_once( "../webassist/security_assist/helper_php.php" ); ?>
<?php
if (!WA_Auth_RulePasses("Administrator")){
WA_Auth_RestrictAccess("access_denied.php");
}
?>
<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
}
// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);
$logoutGoTo = "logout.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
Thanks in advance. I'm now way behind on schedule for this project so any help appreciated.