close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How do I display error messages manually?

Thread began 11/17/2011 4:57 am by info4753 | Last modified 12/28/2011 1:08 pm by Jason Byrnes | 2288 views | 16 replies |

info4753

How do I display error messages manually?

When I manually create a login system, how do I get access to standard errors like "username already exists" or "user not active" (WA_Auth_RulePasses("UserActive")). And how do I display them?

Is there an API documentation on all available WA access rule errors?

Sign in to reply to this post

Jason ByrnesWebAssist

use the Show Region behaivor.


Create the error message, select it then go to Webassist -> Security Assist -> Show Region.

to see how those rules are defined, go to WebAssist -> Security Assist -> Manage Site Access -> Access Rules Manager.


no, there is no api documentation.

Sign in to reply to this post

info4753

o.k. .. I see ... gives more work but more flexibility.

Now, I have an access rule on the admin-folder with page protection.

If AccessLevel of Session =! 10 redirect to login page. There I put an error message "You don't have access to this page".

This works if I call "website.com/cms/admin" directly without login, so redirect to login page works and the error message appears on the login page.

But the error message also appears, when I just call the login page.

How do I solve this? Thx for any help in advance.

Sign in to reply to this post

Jason ByrnesWebAssist

this takes a little hand coding to only show the error if the user is logged in.

look at the Logged into user rule, and make note of the users ID session variable name.

then add another if statement just before the error message. SO if the error is:

"Access level restricted"

change it to:

php:
<?php if(isset($_SESSION['SecurityAssist_UserID']) { ?>Access level restricted<?php ?>





where SecurityAssist_UserID is the name of the logged into users session.

Sign in to reply to this post

info4753

Jason, what I'd like to do is:

- If user submits form, check userdata, if username is wrong, show error message
- If user submits form, check userdata, if username does not exist, show error message
- If user submits form, check userdata, if username is not active, show error message
- If user submits form, check userdata, if password is wrong, show password error message

But the error messages show up even if the form has not been submitted. It looks like the access rules are not beeing fired.

Maybe my rules are wrong?


Rule:
---
case "UserDataNotCorrect":
$comparisons[0] = array(FALSE, "".((isset($_POST["Email_Address"]))?$_POST["Email_Address"]:"") ."", 2, "".(ValidatedField("index","Email_Address")) ."");
$comparisons[1] = array(FALSE, "".((isset($_POST["Password"]))?$_POST["Password"]:"") ."", 2, "".(ValidatedField("index","Password")) ."");
break;
---
ShowIF

---
<?php if(WA_Auth_RulePasses("UserDataNotCorrect")){ // Begin Show Region ?>
<span class="ERROR">Die eingegebenen Zugangsdaten sind nicht korrekt.</span>
<?php } // End Show Region ?>
---

Sign in to reply to this post

info4753

I still need help on this...

Thx

Sign in to reply to this post

Jason ByrnesWebAssist

you wont be able to accomplish this with security assist rules.


you will need to create recordsets to accomplish this.

you will need a separate recordset for each check. you can then use the standard dreamweaver show region behaviors to show the errors if the recordsets are empty.


this is not something i can offer extensive support for, if you need assistance creating this, i would suggest signing up for a premiere ticket where we could work with you in a one on one screen sharing session.

Sign in to reply to this post

info4753

Hi Jason. Thanks for your answer.

Francly speaking, without being able to connect error messages to the SA rules, this extension seems to be half useless or half useful whatever you call it. I mean your extension does check within the SA rule if a username from the form field = database record. Doesn't it? Why can't I get access to this response in order to fire an error message?

Sign in to reply to this post

Jason ByrnesWebAssist

the extensions checks the username and password as group.

it creates a recordset to lookup the entered username and password to see if a record exists.

this is not the same as what you are asking to do. you are asking to check the username individually, and then check the password individually. the extensions does not do this, you will need to configure that functionality yourself.

Sign in to reply to this post

info4753

o.k., I see. But how do I set up the correct rule? Do I have to setup both of them together? I'm confused...

But can I connect an individual error message to a SA rule or not? This is the main problem I have, because this seems not to work correctly. The error shows even I haven't submitted the form at all. Here is my (first) problem again:

I have an access rule on the admin-folder with page protection:

"If AccessLevel of Session =! 10 redirect to login page". On the login page, I put an error message "You don't have access to this page" with the corresponding SA rule.

Access protection works: if I call a protected admin page directly - without logging in -, I'm redirected to the login page works and the error message appears on the login page. So good so far.

But the error message also appears, when I just call the login page. Is this a session (cache) problem?

Sign in to reply to this post
loading

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