- Posts: 93
- Thank you received: 1
ACL - restricting text to only certain plans
- Bill
-
Topic Author
- Offline
- Premium Member
-
Less
More
3 years 5 months ago #151077
by Bill
ACL - restricting text to only certain plans was created by Bill
Hi Tuan,
I have been having a problem with ACL where I want to show text for all plans, except plans 1, 3 or 4. So I have coded the text as follows:
{mprestriction ids="!1,3,4"}Members can access the Annual Financial Statements by logging in and returning to this menu.{/mprestriction}
but it doesn't work.
I have had a look at the code in plugins/content/mprestriction/mprestriction.php and it appears to me (and I could be totally wrong) that line 130:
if (!count(array_intersect($requiredPlanIds, $activePlanIds)))
should be:
if (count(array_intersect($requiredPlanIds, $activePlanIds))==0)
as I don't think the php ! operator works in that situation.
Please let me know. I have made the change and it then does work correctly.
Regards,
Bill
I have been having a problem with ACL where I want to show text for all plans, except plans 1, 3 or 4. So I have coded the text as follows:
{mprestriction ids="!1,3,4"}Members can access the Annual Financial Statements by logging in and returning to this menu.{/mprestriction}
but it doesn't work.
I have had a look at the code in plugins/content/mprestriction/mprestriction.php and it appears to me (and I could be totally wrong) that line 130:
if (!count(array_intersect($requiredPlanIds, $activePlanIds)))
should be:
if (count(array_intersect($requiredPlanIds, $activePlanIds))==0)
as I don't think the php ! operator works in that situation.
Please let me know. I have made the change and it then does work correctly.
Regards,
Bill
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
3 years 5 months ago #151079
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic ACL - restricting text to only certain plans
Hello Bill
I would say that the two commands should work in the same way, although the == operator makes the code a bit more clear
As the code is more clear, and it works. I will make this change to core package. So you don't have to worry about it for future update
Tuan
I would say that the two commands should work in the same way, although the == operator makes the code a bit more clear
As the code is more clear, and it works. I will make this change to core package. So you don't have to worry about it for future update
Tuan
Please Log in or Create an account to join the conversation.
- Bill
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 93
- Thank you received: 1
3 years 5 months ago #151081
by Bill
Replied by Bill on topic ACL - restricting text to only certain plans
Many thanks Tuan.
Regards,
Bill
Regards,
Bill
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
3 years 5 months ago #151082
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic ACL - restricting text to only certain plans
You're welcome
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.