close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Access rules trouble. Need to only allow access if both rules are true

Thread began 2/08/2011 3:19 am by lightwalkercreations361768 | Last modified 2/22/2011 12:53 pm by Jason Byrnes | 1503 views | 6 replies |

lightwalkercreations361768Beta Tester

Access rules trouble. Need to only allow access if both rules are true

Dear WebAssist,

I have been reading on the forums to try and find a solution. I thought my problem may have been that I had an extra line by accident in the groups manger, but I don't, I then checked to make sure that my sessions were be created correctly which they are. My problem is that I need to only allow access if both rules are true.

such as MemberProductID IN group 'All_IC'
AND ProgramPartID = 1

if either of these conditions are false I need access denied, but if they are both true then access is granted.

How would I be able to do this? I have included my HelpersGroupsRulesPHP.php file.

Many thanks as always for your help

Attached Files
HelperGroupsRulesPHP.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

you will need to create a separate rule for each condition, then merge them by hand when you apply the access restriction to the page, for example:
<?php
if ((WA_Auth_RulePasses("Rule 1")) && (WA_Auth_RulePasses("Rule 2"))){
WA_Auth_RestrictAccess("login.php");
}
?>

Sign in to reply to this post

lightwalkercreations361768Beta Tester

Thank you Jason,

I can do the same with SA show region as well.

Many thanks

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, you can.

Sign in to reply to this post

lightwalkercreations361768Beta Tester

Many thanks again, that's great

Sign in to reply to this post

lightwalkercreations361768Beta Tester

Dear Jason,

I am not getting restricted using the example code you gave me and I am not sure why:

<?php
if ((WA_Auth_RulePasses("Feast")) && (WA_Auth_RulePasses("JourneyAll"))){
WA_Auth_RestrictAccess("http://curalarge/login.php");
}
?>

If I use the code example with my access rules names I get no login needed, the page load even if I do not login. If I change it to this

<?php
if ((!WA_Auth_RulePasses("Feast")) && (!WA_Auth_RulePasses("JourneyAll"))){
WA_Auth_RestrictAccess("http://curalarge/login.php");
}
?>

I get a redirect to login, but when I log and it takes me to the page it allows access because the first rule is true but the second is not.

The "Feast" rule allow access for ProgramPartID = 2 or 99
The "JourneyAll" rule allows access for ProgramID = 3 or 4

When I login my ProgramPartID session is 99 and my ProgramID = 2 which should not allow me access.

I have included my rules page. Many thanks again for your help.

Attached Files
HelperGroupsRulesPHP.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

try using this instead:
if ((!WA_Auth_RulePasses("Feast")) || (!WA_Auth_RulePasses("JourneyAll"))){

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