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

Access rules

Thread began 10/12/2012 9:40 pm by 3dmikec442988 | Last modified 10/18/2012 12:24 pm by 3dmikec442988 | 899 views | 6 replies |

3dmikec442988

Access rules

How do I create a "user logged in" rule in the Access Rules Manager? I'm trying to create a dynamic button that reads "Login OR Register" if the user is logged out and if the user is logged in the button reads "Logout OR Account".

Sign in to reply to this post

Jason ByrnesWebAssist

after running the security assist, the Access rules manager will create a rule named "logged into <your user table>" (where <your user table> is the name of your user table. this rule is used to determine if the user is logged in.


you can use the Security assist show region to show the Login or Register button if the "logged into <your user table>" rule is false, or the LOgout and account link if it is true.

Sign in to reply to this post

3dmikec442988

Ok so I ran security assist and it made the rules and I applied these to my button which I incorporated into my template. But I'm running into some problems.

First, when I complete the registration form, it takes me to the log in page and says "REGISTRATION COMPLETED SUCCESSFULLY, PLEASE LOG IN TO ACCESS THE SITE". However, my buttons already read "LOGOUT" and "ACCOUNT". It seems completing the registration logs the user in automatically.

Second, when I hit my "LOGOUT" button, it takes me to the log out page and says I was successfully logged out, but my buttons still read "LOGOUT" and "ACCOUNT" unless I either hit the log out button again or go to another page.

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, the registration sets the logged in session variable.

if you would rather not have that happen, edit the insert record behavior on the registration page, in the Save inserted ID in session section, change the name of the session that will be created.

Send a copy of the logout page so i can look into why the messages are displaying incorrectly.

Sign in to reply to this post

3dmikec442988

Thanks for the help. I zipped the .php file. I hope this is the proper procedure.

Attached Files
logout.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the problem is that the code to clear the sessions and log the use out is at lines 61 - 78

php:
<?php 

@session_start();
if (
"" == ""){
  
// WA_ClearSession
    
$clearAll TRUE;
    
$clearThese explode(",","");
    if(
$clearAll){
        foreach (
$_SESSION as $key => $value){
            unset(
$_SESSION[$key]);
        }
    }
    else{
        foreach(
$clearThese as $value){
            unset(
$_SESSION[$value]);
        }
    }
}
?>




move that code to line 1.

Sign in to reply to this post

3dmikec442988

That makes sense. Thank you.

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