[SOLVED] CB AutoActions

2 months 2 weeks ago #304090 by sclarke
Hi Kyle,

I don't think you understand what this auto action is supposed to do.

When 'someone' goes to view somebody else's profile, it needs to determine if the profile user has an active subscription or not. If they don't have an active subscription then they are redirected to the inactive page rather than displaying the profile. This needs to happen whether the user is logged in or not. That is all currently working. But now we want to change it, so if the 'someone' is an Administrator or Super User, they don't get redirected to the inactive page for a profile that doesn't have a subscription.

This is the trigger being used: onBeforeUserProfileDisplay
Type: Redirect
User: Automatic
Conditions: [cb_activesubscriptions] <= 1, [cb:userdata field="user_id" user="#me" /] != [user_id]

It doesn't have anything to do with when a user logs in.

Thanks.
2 months 2 weeks ago - 2 months 2 weeks ago #304093 by krileon
Ok, then based off your trigger you're checking against the profile owner and not the viewing user. That's why the Access doesn't work as Access is checked against the user of the action. You'll have to use a condition with an IF substitution against a usergroup or view access level to do what you're wanting. Examples as follows.

View Access Level:
[cb:if user="#me" viewaccesslevel includes "VIEWACCESSLEVEL_ID_HERE"]ACCESS[/cb:if] Equal To ACCESS

Replace VIEWACCESSLEVEL_ID_HERE as needed.

Usergroup:
[cb:if user="#me" usergroup includes "USERGROUP_ID_HERE"]ACCESS[/cb:if] Equal To ACCESS

Replace USERGROUP_ID_HERE as needed.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
2 months 2 weeks ago #304107 by sclarke
Hi Kyle,

Thank you I finally have something that is working. But I had to use the condition:

[cb:if user="#me" usergroup includes "8"]ACCESS[/cb:if] Not Equal to ACCESS (8 is Super User).
The following user(s) said Thank You: krileon
Moderators: beatnantkrileon
Time to create page: 0.153 seconds
Facebook Twitter Google LinkedIn