Assign to Group-Expired User [SOLVED]

14 years 8 months ago #107780 by krileon
This is very doable with some advanced SQL:
[code:1]
UPDATE `jos_core_acl_groups_aro_map` SET `group_id` = 18 WHERE `aro_id` = ( SELECT `id` FROM `jos_core_acl_aro` WHERE `value` = [user_id] )
[/code:1]

Get the group_id (ID) from jos_core_acl_aro_groups table.


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.

14 years 8 months ago #107803 by BoSchafers
Replied by BoSchafers on topic Re:Assign to Specific Group-Expired Subscription
:lol: :lol: Hooray! It works...

Very powerful stuff. In conjunction with additional usergroups created via noixacl we can now manage our fairly complicated membership online. For those seeking to replicate this and change a subscriber's group membership on expiry the 2 SQL actions needed are:

UPDATE `jos_core_acl_groups_aro_map` SET `group_id` = 59 WHERE `aro_id` = ( SELECT `id` FROM `jos_core_acl_aro` WHERE `value` = [user_id] )

and

UPDATE `#__users` SET `usertype` = 'New Group', `gid` = '59' WHERE `id` = [user_id];

(just modify the group id to fit your core table)

Special thanks to krileon!

Bo

Please Log in to join the conversation.

14 years 8 months ago #107813 by krileon
Glad it works, was a bit surprised my self and learned a little bit more about queries. B)


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.243 seconds

Facebook Twitter LinkedIn