Ray,
I have tried doing this several ways. While using the "NOT Administrator" rule, I get an error from my Fire Fox browser saying "Redirect Loop Error".
So I created a new rule called "Redirect" and set it to compare the "AdminLogin" session to the globals.php info, but this time I used "<>". And then applied the "Redirect" rule to redirect to the new page if the admin login equals the session. In other words, the rule is that the admin username should not equal the session "AdminLogin". If it does, redirect to the newpage.php.
This works after I login but only if I refresh the page. So how do I trigger this rule to apply after a login and not on the page loading?
Here is my rules code from the HelperGroupsRulesPHP.php file.
<?php
function WA_Auth_GetComparisonsForRule($ruleName){
$comparisons = array();
switch ($ruleName){
case "Administrator":
$comparisons[0] = array(TRUE, "".((isset($_SESSION['AdminLogin']))?$_SESSION['AdminLogin']:"") ."", 1, "".$GLOBALS['WAGLOBAL_Admin_Password'] ."");
break;
case "Redirect":
$comparisons[0] = array(TRUE, "".((isset($_SESSION['AdminLogin']))?$_SESSION['AdminLogin']:"") ."", 2, "".$GLOBALS['WAGLOBAL_Admin_Password'] ."");
break;
}
return $comparisons;
}
function WA_Auth_GetGroup($groupName){
$group = Array();
switch ($groupName){
}
return $group;
}
?>
A little more information here: This is a login page that compares the login to the globals.php page. Not a database. I copied lines 3-13 from a users_login.php page generated by the Security Assist wizard as per instructions from support on an earlier issue. So I am not sure if there may be a conflict now. Here is that part of the code, for easy reference.
<?php
if (!session_id()) session_start();
if((((isset($_POST["userName"]) && $_POST["userName"]==$WAGLOBAL_Admin_UserName)?$_POST["userName"]:"") != "")) {
$_SESSION["AdminLogin"] = "".((isset($_POST["Password"]))?$_POST["Password"]:"") ."";
}
?>
<?php
if((((isset($_POST["userName"]) && $_POST["userName"]==$WAGLOBAL_Admin_UserName)?$_POST["userName"]:"") != "")) {
header("location : index.php");
}
?>
Thanks,
Troy