close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to add a filtered variable to authentication

Thread began 4/13/2017 2:20 pm by LionsMane | Last modified 10/04/2019 10:51 pm by Ray Borduin | 729 views | 8 replies |

LionsMane

How to add a filtered variable to authentication

Along with their email address, I need to allow users to authenticate (using your mySQLi authentication method) when a column in their record is set to 1. Users in the table where "Status" = 0 would not be able to login. How can I accomplish this?

Sign in to reply to this post

Ray BorduinWebAssist

Just add that as a condition in the server behavior on the "Find Record" tab for that column.

Sign in to reply to this post
Did this help? Tips are appreciated...

LionsMane

Tried that...

PM

Sign in to reply to this post

Ray BorduinWebAssist

You also have to validate the email address and password. Currently you are only validating the Status column, so as long as there is any record with Status=1 it will let you in. You only want to let them in if the email, password, and status fields are verified.

Sign in to reply to this post
Did this help? Tips are appreciated...

LionsMane

OOps

Huh.. how odd. The behavior USED to validate username and email.. I didn't notice that it didn't anymore. I changed that and yes, it's working as I need it to now. Thanks for the lesson.

Sign in to reply to this post

LionsMane

Multiple values?

This issue cropped up again, this time we need to validate against TWO values.. 1 or 4. I've got using $Authenticate->addFilter("Status", "=", "i", "1"); for "1" but how do I modify this for a second value, called "4"?

Sign in to reply to this post

Ray BorduinWebAssist

You would have to have the authentication code chunk repeated since you can't do an "OR" in a filter in authentication. Just leave the failed redirect blank in the first validation and then it would run the second set of code if the first failed.

Another option is to not add the status to the filter and instead add it to the list of saved session variables. Then update your access rule to check for the Status value of 1 or 4.

Sign in to reply to this post
Did this help? Tips are appreciated...

LionsMane

Understood.. but..

Logically I get those.. and was thinking the same things - but I'm unsure how to modify your code to accomplish either of these goals. Can you throw me some examples?

Sign in to reply to this post

Ray BorduinWebAssist

The easiest might be the first one... Just go to code view and copy/paste the code you have so it is repeated twice.

Then open the first one and remove the failed redirect.

Then open the second one and change the status comparison value.

Sign in to reply to this post
Did this help? Tips are appreciated...

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