close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Redirect Problem when Authenticating

Thread began 7/22/2009 12:06 pm by anonymous | Last modified 8/01/2009 8:27 pm by anonymous | 7103 views | 12 replies

troyd

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

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...