Assign to Group-Expired User [SOLVED]

14 years 7 months ago #107377 by BoSchafers
Replied by BoSchafers on topic Re:Assign to Specific Group-Expired Subscription
Hi krileon,

you wrote:

Your usertype isn't an official Joomla usertype.


Based on your advice I have have removed noixacl and tried to get the sql action to work on a standard Joomla usertypes. Unsuccessfully...

1. Set the usertype to Publisher on activation. Result: this behaves as expected. The user is added to the Publisher group when the subscription is activated

2. Implemented the following deactivation sql actions in Fields 1 and 2:

UPDATE `#__users` SET `usertype` = 'Registered', `gid` = '18' WHERE `id` = [user_id];

UPDATE `#__core_acl_groups_aro_map` SET `group_id` = '18' WHERE `aro_id` = [user_id];

When fired on deactivation this does put/show that user in the Registered group (when you browse his profile properties), however in the User Management list he is still showing as Publisher.

What am I doing wrong????? :S
:S :S

Bo

Please Log in to join the conversation.

14 years 7 months ago #107438 by krileon
If you're using standard Joomla usertypes you don't need the SQL Actions plugin to do this.

Edit Plan -> Access -> Subscribers User access level settings -> User Group:

Now just select the usergroup you want the user to be when they subscribe.


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 7 months ago #107606 by BoSchafers
Replied by BoSchafers on topic Re:Assign to Specific Group-Expired Subscription

krileon wrote:
Now just select the usergroup you want the user to be when they subscribe.

It's group membership on expiration/deactivation that I'm wanting to control. The sql action you provided is excellent, it allows me to do exactly that. It just doesn't update the expired group name in the 'User Management' listing. My client will be using that listing as their main member management tool, so it is vital that it displays correctly. Is there any way I can get the expired group to display?

This may of use: If I go into a user's properties and save him, the group will display correctly straight away. It therefore seems to me like we need a third sql statement to update the user somehow.

Bo

Post edited by: BoSchafers, at: 2009/08/11 09:43

Please Log in to join the conversation.

14 years 7 months ago #107625 by krileon
BoSchafers wrote:

It's group membership on expiration/deactivation that I'm wanting to control. The sql action you provided is excellent, it allows me to do exactly that. It just doesn't update the expired group name in the 'User Management' listing. My client will be using that listing as their main member management tool, so it is vital that it displays correctly. Is there any way I can get the expired group to display?

This may of use: If I go into a user's properties and save him, the group will display correctly straight away. It therefore seems to me like we need a third sql statement to update the user somehow.

Bo

Post edited by: BoSchafers, at: 2009/08/11 09:43


Not sure what else needs to be updated, as this is dealing with ACL groups there is no telling what else needs to be changed. You'll just have to dig through your database to check that everything is updated correctly.

The name should show properly as `usertype` = 'Registered' changes the ACL name of the user.


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 7 months ago #107744 by BoSchafers
Replied by BoSchafers on topic Re:Assign to Specific Group-Expired Subscription
Thanks for your continued patient support :)

Should have seen this earlier, but I now know why there is no updated display in the user management list. The second query:

UPDATE `#__core_acl_groups_aro_map` SET `group_id` = 'xx' WHERE `aro_id` = [user_id];

somehow does not update the core_acl_groups_aro_map table. I have observed the table just keeps the same group_id value after the subscription expires.

How can I make the second action kick in? I'm out of my depth with this...

Bo

Please Log in to join the conversation.

14 years 7 months ago #107750 by BoSchafers
Replied by BoSchafers on topic Re:Assign to Specific Group-Expired Subscription
The reason why the query does not update is because aro_id and id actually do not correspond

Example of a subscribed user:

jos_users---> id=121
jos_core_acl_groups_aro_map---> aro_id=69

So when the query outputs: UPDATE `#__core_acl_groups_aro_map` SET `group_id` = '23' WHERE `aro_id` = 121;
it cannot find aro_id=121 (it's only 69 it would find) and thus takes no action. This suggests to me that we need a different query to make this work.

The aro_id numbers seem to be stored in the id field of the jos_core_acl_aro table (the 'value' field holds the actual id field from jos_users). So if there was a query that could pull out *that* info and then apply it to the update core maps thing, we'd be in business.

I just wouldn't know how to construct this kind of query. Can you help?

Bo

Post edited by: BoSchafers, at: 2009/08/12 07:08

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.211 seconds

Facebook Twitter LinkedIn