Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Changing an ACL after a membership expires

9 years 9 months ago #257056 by MarylandShallIssue
Changing an ACL after a membership expires was created by MarylandShallIssue
I have members who are manually made part of various groups. These groups have analogous Access Levels. These access levels are used to give viewing access to specific Kunena forum categories.

Here's an example:

I have a paid member that becomes part of the Member group when they pay for a subscription via CBSubs. If a members is vetted by our board of directors and officers, they may be invited to the Executive Member (EM) group at which point they are assigned the Joomla Executive Member group manually. They are expected to be fully paid members to gain access to the EM section of the Kunena forums. If they let their membership expire, I would like the expiration to remove their EM group level permissions. These Executive Members could also be Committee Members who would loose this access upon expiration of their membership.

It's not clear to me how CBSubs can do this. I've just downloaded and installed Auto Actions hoping I could find a trigger to do this as well but could not find an Action to change the ACL level.

Thoughts?

CB 2.0.4
CBSubs 4.0.0rc-1

Please Log in or Create an account to join the conversation.

9 years 9 months ago #257058 by MarylandShallIssue
Replied by MarylandShallIssue on topic Changing an ACL after a membership expires
OK, so after re-watching the tutorials on Auto Actions, I'm seeing where the use of Conditions on a field might be useful. I'm looking for a built in CBSubs attribute that I can access of either the subscription status, expiration date, or something else that will indicate that the state has changed, even if you're passing me the previous state and new state.

Am I on the right track here?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
9 years 9 months ago #257080 by krileon
Replied by krileon on topic Changing an ACL after a membership expires
It can be done using CB Auto Actions and by acting on the subscription state change. You can then use whatever action type you want. In your case you'd use the Usergroup action.

Plan Active
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To A

Plan Expired
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To X

Replace PLAN_ID_HERE with the ID of the plan you want the action to act on. On plan active you'd give the usegroups and on plan expire you'd remove them.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

9 years 9 months ago #257095 by MarylandShallIssue
Replied by MarylandShallIssue on topic Changing an ACL after a membership expires
Awesome! Thanks.

So is [var3] and [var2] the exact variable names to test against?

Where is this documented? I looked but couldn't find anything. I even browsed the Joomla MySQL tables to see if they were in there.

Also, I love how you documented CBSubs. The only documentation I'm seeing on Auto Actions is the tutorials. Is there something else I haven't found yet?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
9 years 9 months ago #257174 by krileon
Replied by krileon on topic Changing an ACL after a membership expires

So is [var3] and [var2] the exact variable names to test against?

They're substitutions for that triggers 3rd and second variables. In this case the plan id and the subscription status. Do not change them as they are literally [var3] and [var2].

Where is this documented? I looked but couldn't find anything. I even browsed the Joomla MySQL tables to see if they were in there.

CB Auto Actions is a more advanced plugin. Beyond basic setup the documentation would be infinite as its possibilities are limitless. Nick has been working on a few tutorials for CB Auto Actions and every input has a help icon describing what it does, but beyond that there is no further documentation at this time.

www.joomlapolis.com/news/18482-23-action-types-in-cb-auto-actions-6-for-cb-20


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

9 years 9 months ago #257193 by MarylandShallIssue
Replied by MarylandShallIssue on topic Changing an ACL after a membership expires
So how would I have known about the trigger variables? Is that explained in the tutorials? I understand the unlimited nature of Auto Actions, but how about explaining how I'd use the variables to the triggers and for each module used (e.g. CBSubs) what each value would mean? For example, for CBSubs and the Change State event, [var3] = Plan ID, and [var2] = state before change.

Otherwise I'm going to need to use the support forums to get this information.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum