close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

SA: Login Page UserActive validation

Thread began 11/14/2011 9:36 am by dan361748 | Last modified 11/18/2011 9:02 am by Jason Byrnes | 1962 views | 7 replies |

dan361748

SA: Login Page UserActive validation

Hi - I am using the SA login page created by the wizard.

Everything seems to work fine, except that my 'Sorry your account is not active' validation seems to always want to show the error message.

Here is my helper rule:

case "UserActive":
$comparisons[0] = array(FALSE, "".((isset($_SESSION['SecurityAssist_UserActive']))?$_SESSION['SecurityAssist_UserActive']:"") ."", 2, "1");
break;

And here is my show region on the page:

<?php if(!WA_Auth_RulePasses("UserActive")){ // Begin Show Region ?>
<p style="color:#F60;">Sorry - your account is not active. Please email us for more information.</p>
<?php } // End Show Region ?>

The login works as expected - if the user active state is 0 the login does not proceed. If it is 1 it passes. The problem I am having is that the error message seems to show on first load of the page whether or not the user enters their details to log in.

Any help would be appreciated.
Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

your rule is checking to make sure that the $_SESSION['SecurityAssist_UserActive'] is NOT EQUAL to 1.


before the user has logged in, the session does not have a value so is not equal to one, you rule evaluates to true.

the only time your rule will evaluate to false is if the user has logged in and the $_SESSION['SecurityAssist_UserActive'] session equals 1


add the logged into <your user table name> rule around this rule so it will only show if logged in:

<?php if(WA_Auth_RulePasses("Logged into <your users table>")){ // Begin Show Region ?>
<?php if(!WA_Auth_RulePasses("UserActive")){ // Begin Show Region ?>
<p style="color:#F60;">Sorry - your account is not active. Please email us for more information.</p>
<?php } // End Show Region ?>
<?php } // End Show Region ?>

Sign in to reply to this post

dan361748

Thanks Jason

I have changed my rule so that it restricts if <?php echo $_SESSION['SecurityAssist_UserActive']; ?> <> 1

On the login page:

<?php if(WA_Auth_RulePasses("Validated form")){ // Begin Show Region ?>
<p>Invalid username or password. <a href="/forgotpassword.php">Did you forget your password</a>?</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Log in success")){ // Begin Show Region ?>
<p>You have been logged in</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Failed log in")){ // Begin Show Region ?>
<p>Invalid username or password. <a href="/forgotpassword.php">Did you forget your password</a>?</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Emailed password")){ // Begin Show Region ?>
<p style="color:#F60;">Password information emailed, please check your inbox</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Successful update")){ // Begin Show Region ?>
<p>Registration completed successfully, please log in to access the site</p>
<?php } // End Show Region ?>
<?php if(WA_Auth_RulePasses("Logged into users")){ // Begin Show Region ?>
<?php if(!WA_Auth_RulePasses("UserActive")){ // Begin Show Region ?>
<p style="color:#F60;">Sorry - your account is not active. Please email us for more information.</p>
<?php } // End Show Region ?>
<?php } // End Show Region ?>

The rules works - if the users UserActive is not 1 the login does not proceed.

However the error message does not appear?

I've had this working before - I can't figure out what I have done wrong!

Dan

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the login page so i can see the entire code in context.

Sign in to reply to this post

dan361748

Thanks Jason for your help on this. Attached is the login page.

Attached Files
login-bak.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

If anyone else is experiencing this same issue, please append to this thread.

Sign in to reply to this post

info4753

Got a similar problem (also mentioned on another thread with a different rule).

If user is active (=1) rule works: access granted

If user is not active (=0) rule works: access denied, redirect to login-page, error message shows up on login-page

If I call the login page without submitting the login form, the error message shows up

I've installed version 2.0.4

Sign in to reply to this post

Jason ByrnesWebAssist

see my reply to the other thread you asked this question in:
showthread.php?p=114088&posted=1#post114088

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