Skip to Content Skip to Menu

[#3390] Auto Action to allocate a user to a specific group

  • rnomis
  • rnomis
  • OFFLINE
  • Posts: 17
  • Thanks: 0
  • Karma: 0
12 years 7 months ago - 12 years 6 months ago #194249 by rnomis
I want to allocate a user to a specific group according to a key/Code they are sent

I have created a dblookupfield that asks the user to enter a code to register.
I would like to use different codes to allocate each user to a specific Group with access to specific resources.
I have created 3 Groups for these users each with different access priveleges.
The site Admin will send emails from outside Joomla to invite people to join and they will be given a code to enter during this process. For example: entering CODE1 would put them in the Registered users, CODE2 would put them in a new Group called Staff and CODE3 would put them the new Finance Group.

The site admin will only have access to the Joomla front end for aproving users so I need to find a way of either using the dblookupfield to add the user to the correct group or use an Autoaction as the site admin will not be able to change this after without back-end access.

I have tried the example in: Assigning usergroup based on CB field value but it puts all users into the Registered Group. The onAfterUserRegistration trigger doesn't appear in the dropdown so I entered it manually.
Last edit: 12 years 6 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 7 months ago #194266 by krileon
Please test your action without conditions to see if it even assigns the user to a usergroup. Please provide a screenshot of your action so may review the configuration.

The onAfterUserRegistration trigger doesn't appear in the dropdown so I entered it manually.

It's there as after registration, it doesn't display the full trigger name as the full trigger name is confusing to most.


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.

  • rnomis
  • rnomis
  • OFFLINE
  • Posts: 17
  • Thanks: 0
  • Karma: 0
12 years 7 months ago #194279 by rnomis
Tried it both with and without conditions. It registered the user but only as Registered and not as 'Internal Operations'
I attach the screenshot
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 7 months ago #194284 by krileon
Your trigger is set to the backend trigger, so it won't work for frontend (review drop-down for frontend trigger). Next issue is your condition isn't correct; it uses normal CB substitution formats. So for example "[fieldname]" is valid, but "fieldname" is not.


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.

  • rnomis
  • rnomis
  • OFFLINE
  • Posts: 17
  • Thanks: 0
  • Karma: 0
12 years 7 months ago #194335 by rnomis
OK, so it is working better. However, it now adds the user into the Registered and Parent/Carer Group regardless of the radio button seleced.
I have 6 AutoActions as per the example tutorial: Assigning usergroup based on CB field value.

The other problem is that the new user is not approved or Confirmed (see screenshot) in CB User Management despite Require Admin Aproval being set to No in config.

I attach the screenshots for the Auto Action I created to put the user into the Internal Operations group and the Field to show the settings. What am I doing wrong?

Ultimately, I want to use just a code supplied to the user. This code (as in my previous post below) will automatically allocate the user into the correct group without them having to select a button.
Unfortunately, I have no idea how to do this although I assume I need another AutoAction to check the code and allocate accordingly? It would be great if you could explain what I need to do.
I am sure this is a function that could be useful to many. I would be happy to document both of these proceedures (with screenshots) and share them with the community.
Attachments:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 7 months ago - 12 years 7 months ago #194351 by krileon
It's working as intended. It's set to "Add Usergroups", which adds to their existing usergroups; it does not replace them. I however have implemented a "Replace Usergroups" feature, but can't recall if I've already released that or not. Please ensure you're using latest and select "Replace Usergroups" as the "Mode". If not there then you'll need to wait for next release.


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.
Last edit: 12 years 7 months ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum