close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Page Access Not Working

Thread began 5/09/2011 8:50 am by A Sound Design | Last modified 5/09/2011 10:51 am by Jason Byrnes | 865 views | 1 replies |

A Sound Design

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);
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

From the code snippet you posted of the authenticate user server behavior, I see you are using password encryption.

Is the registration page storing the encrypted password as well?

An SHA1 encrypted string is 40 characters long, the Password database column needs to be set to except 40 characters or the string will be truncated. Double check that the password column is set as varchar(40)

Sign in to reply to this post

JDJandCompany

redirect url build does not work appropriately

I keep getting the redirect page as so below.

windmillpointemhc.com/login2.php?accesscheck=%2FPhotos_result.php%3F

I login correctly but the other pages that I have tried to make secure using Security Assist come up the same way for some reason I have to login again on each page and when complete the URL build comes back as I have shown above. The Photos_result.php of course is the page I was on at the time and it should of gone there but this is what happens.

Help please.

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the Photos_result.php page, the login page and the webassist/security_assist/helergrouprules.php files in a zip archive please.

Sign in to reply to this post

JDJandCompany

Thanks again

I havn't done much editing but the changes I have made have not been to the wa_security programming

Attached Files
New Compressed (zipped) Folder.zip
Sign in to reply to this post

Jason ByrnesWebAssist

in the webassist/security_assist/helergrouprules.php file, there are 2 rules defined for "Login Success":
case "Log in success":
$comparisons[0] = array(TRUE, "".((isset($_GET['loggedIn']))?$_GET['loggedIn']:"") ."", 2, "");
break;
case "Log in success":
$comparisons[0] = array(TRUE, "".((isset($_SESSION['SecurityAssist_UserID']))?$_SESSION['SecurityAssist_UserID']:"") ."", 1, "".$row_SecurityAssistusers['UserID'] ."");
break;


the second one should not be there.

also there is no rule defined for "Logged Into users"


define a new rule named "Logged Into users". set it to:
Allow If
Value: Click the lightning bolt and select the SecurityAssist_UserID session
Criteria: <>
Comparison: Leave this setting blank

on the Photos_result.php page use the "Logged Into users" rule as the access restriction.

Sign in to reply to this post

JDJandCompany

Thanks

Thanks again you guys are a huge help

Sign in to reply to this post

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...