Page Access Not Working
I have used Form Builder to create registration and login pages, ie. am not using the SA wizard. I have used the page access server behaviour to protect an admin homepage using
<?php require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if (!WA_Auth_RulePasses("Administrator")){
WA_Auth_RestrictAccess("login_failed.php");
}
?>
at the top of the page.
The login page should redirect to the admin homepage on successful login.
The registration page works well but when I try to login I continually get redirected to my 'login denied' page. I have checked the actual username and password to make sure they are correct so it is not the wrong details.
The page access is based upon username, password and user level. In the MySQL table it has UserLevel as Int(11).
The SA Authenticate User behaviours code is:
<?php
if(isset($_POST["Securelogin_submit"])){
$WA_Auth_Parameter = array(
"connection" => $connDB,
"database" => $database_connDB,
"tableName" => "users",
"columns" => explode($WA_Auth_Separator,"username".$WA_Auth_Separator."password"),
"columnValues" => explode($WA_Auth_Separator,"".((isset($_POST["Username"]))?$_POST["Username"]:"") ."".$WA_Auth_Separator."".WA_SHA1Encryption(((isset($_POST["Password"]))?$_POST["Password"]:"")) .""),
"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
"sessionColumns" => explode($WA_Auth_Separator,"memberID"),
"sessionNames" => explode($WA_Auth_Separator,"memberID"),
"successRedirect" => "admin_homepage.php",
"failRedirect" => "login_failed.php",
"gotoPreviousURL" => FALSE,
"keepQueryString" => FALSE
);
WA_AuthenticateUser($WA_Auth_Parameter);
}
?>