[#3622] Add to K2 user group with CBsubs

11 years 10 months ago - 11 years 9 months ago #203061 by activha
Hello

I would like to add and remove new and old users to K2user groups depending on the plan subscribed with CBsubs

I did not see any integration with K2, is there any mean to achieve this easily ?

Thanks in advance

Please Log in to join the conversation.

11 years 10 months ago #203106 by krileon
Replied by krileon on topic Re: Add to K2 user group with CBsubs
I believe a user can only have 1 group and that group id is added to the "group" column in _k2_users. You could use CBSubs SQL Actions to query this table and change that group.


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.

11 years 9 months ago #206497 by activha
Replied by activha on topic Re: Add to K2 user group with CBsubs
Thanks
I have some problem with the sql query.

I try to use this one
IF (userID > 0 ) THEN
UPDATE yq0g1_k2_users SET userName = [USERNAME], group = '3' WHERE userID =  [user_id]
ELSE
INSERT INTO yq0g1_k2_users(id,userID,userName,group) VALUE(id+1,[user_id],[USERNAME],'3')
END IF

but it does not work.
Could you help me on this ?

thanks

Please Log in to join the conversation.

11 years 9 months ago #206572 by krileon
Replied by krileon on topic Re: Add to K2 user group with CBsubs
It's malformed, you've no quotes. Please review the below MYSQL documentation for formatting help.

dev.mysql.com/doc/refman/5.6/en/index.html

You can also review the below SQL tutorials for further information.

www.w3schools.com/sql/default.asp


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.

11 years 9 months ago #206611 by activha
Replied by activha on topic Re: Add to K2 user group with CBsubs
Thanks Kyle but I am not a developper, just trying to make something as you don't have proper integration with K2 and it is impossible to add a user to K2 group when using CB !

Please could you help me on this one and correct my awrful try ?? ;-)

Please Log in to join the conversation.

11 years 9 months ago #206662 by krileon
Replied by krileon on topic Re: Add to K2 user group with CBsubs

Thanks Kyle but I am not a developper, just trying to make something as you don't have proper integration with K2 and it is impossible to add a user to K2 group when using CB !

With CB integration enabled in K2 and CB Articles installed to CB and set to K2 you don't need K2s users table, it won't be used for display anywhere. The integration is "proper" and complete, we've communicated well with the K2 team to ensure it was.

K2 groups aren't needed to establish permissions to K2 tasks, see K2 > Parameters > Permissions and you can assign permissions to Joomla usergroups. K2 groups are basically there as before J2.5 such feature wasn't available.

Please could you help me on this one and correct my awrful try ??

Below should do the trick.
INSERT INTO `#__k2_users` ( `userID`, `userName`, `group` ) VALUES ( '[user_id]', '[USERNAME]', 3 )
ON DUPLICATE KEY UPDATE `userName` = '[USERNAME]', `group` = 3;


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

Facebook Twitter LinkedIn