Auto Actions onBeforeFirstLogin

7 years 1 month ago #291520 by poml
Auto Actions onBeforeFirstLogin was created by poml
Hi, I have a question.

I want to automatically add a user to a usergroup depending on existing usergroups.
A new user signs up, his data are saved and he will be put in the usergroup "Registered" (ID=2).
During the first login I want to add the user to another usergroup.

So I have made myself an autoaction:
Trigger is "onBeforeFirstLogin".
Condition is "[var1_gids] equal to "2".
Action is something.

My question now is: Is the [var1_gids] the correct way to determine if the user is only in usergroup 2, i.e. Registered?

Thanks!

Please Log in to join the conversation.

7 years 1 month ago #291543 by krileon
Replied by krileon on topic Auto Actions onBeforeFirstLogin
You don't need a condition. Instead under Global set Access to the usergroup you want to specifically match.


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 to join the conversation.

7 years 1 month ago #291795 by poml
Replied by poml on topic Auto Actions onBeforeFirstLogin
Thanks for support.
However, I think that your method is different from my method:
My method: The AA fires only if the user is assigned to only this usergroup and not to any others.
Your method: The AA fires if the user is a member of that user group regardless if he is member of any other usergroups or not.
Is that correct?
For my purpose I would like to verify that the user is only in that specific user group.
This seems to work with [var1_gids] equal to "2".
Is that the correct way, to use the [var1_gids]?

Please Log in to join the conversation.

7 years 1 month ago #291805 by krileon
Replied by krileon on topic Auto Actions onBeforeFirstLogin

For my purpose I would like to verify that the user is only in that specific user group.

That's exactly what the Access parameter will do. What you're currently doing is executing the action on every user that logs in then conditioning them. That's unnecessary as you can already condition them down to the specific usergroup using the Access parameter. The action for sure would only execute on the selected usergroups. You can add additional conditions from there as necessary.

Is that the correct way, to use the [var1_gids]?

No, you need to use an IF substitution condition to properly check against usergroup or viewaccesslevel inline. See the bottom of the substitutions tutorial below.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


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 to join the conversation.

7 years 3 weeks ago #292093 by poml
Replied by poml on topic Auto Actions onBeforeFirstLogin
I did some tests and
[var1_gids] equal to "2" does exactly what it says: Only if the user has exactly one usergroup (2) the auto action will fire. If he is member of multiple user groups including 2 then the AA will not fire.
Using the user group access parameter he AA fires if the user is a member of that user group regardless if he is member of any other usergroups or not.
So I need the condition [var1_gids] equal to "2".
However, I can do a pre filtering using the user access parameter as you suggest, that is true. Maybe I'll do that.
So I will need to set both, the user access parameter and my condition.

Please Log in to join the conversation.

7 years 2 weeks ago #292098 by krileon
Replied by krileon on topic Auto Actions onBeforeFirstLogin
You need it to fire if they have only that usergroup or simply have that usergroup? If you mean only that usergroup then yes a your condition will be fire, but as you've seen it will not fire if they've any other usergroups where the Access parameter will as it's just checking that they have the selected usergroup.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.218 seconds

Facebook Twitter LinkedIn