close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Custom validation messege

Thread began 1/07/2012 5:20 am by steelace396915 | Last modified 1/10/2012 12:22 pm by steelace396915 | 722 views | 5 replies |

steelace396915

Custom validation messege

Hi

I have a column in my database for various accesslevels to my site. I have set this up with 4 levels (admin = 4, student = 3, registered = 2 and visitor = 1). When a user register he is assigned accesslevel 2 in database
On my loginpage built in SA I have set up a rule allowing accesslevel 3-4 to login successfully and also restricted accesslevel 2 since I don't want registered users to access my site until they are approved. When a user who has just signed up through the registration page is transfered back to the login page and tries to login with his registered email and password he won't be able to login since the rule is set to restrict accesslevel 2 users. I solved this by redirecting unsuccessful logins to another page where Ive just set up 2 server behaviours, clear all sessions and server redirect back to the login page. All this works good.
My question is how I can show a messege to a registered user when he's transfered back to the login page after a unsuccessful login attempt, displaying that he can't login to site until his registration has been approved?

Thanks in advance!

/Martin J.

Sign in to reply to this post

Jason ByrnesWebAssist

in the server redirect behavior, set the redirect to the login page to pass a querystring variable, such as:

login.php?notAuthenticated=true


then add an if statement on the login page:

php:
<?php if(isset($_GET['notAuthenticated'] && $_GET['notAuthenticated'] == "true" ) { ?>

you will not be able to login to this site until your registration has been approved.
<?php ?>
Sign in to reply to this post

steelace396915

Thanks Jason! I tried this but I get error messege in code when inserting the block on the login page? Where do I put this code? Ive enclosed screen image from dreamweaver!

Thanks in advance!

/Martin J.

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

Jason ByrnesWebAssist

sorry, this line:

php:
<?php if(isset($_GET['notAuthenticated'] && $_GET['notAuthenticated'] == "true" ) { ?>



should be:

php:
<?php if(isset($_GET['notAuthenticated']) && $_GET['notAuthenticated'] == "true" ) { ?>
Sign in to reply to this post

steelace396915

Thanks Jason! I will try it again!

/Martin J.

Sign in to reply to this post

steelace396915

That worked great Jason! Many thanks!

/Martin J.

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