[SOLVED] Redirect after login based on Group

11 years 8 months ago - 11 years 6 months ago #207879 by flocktree
Hi,

Is there anyway to redirect a user to a different page or display different modules on login based on their group?

Many thanks,

Mark Akers.

Please Log in to join the conversation.

11 years 8 months ago #207927 by krileon
Replied by krileon on topic Re: Redirect after login based on Group
Sure, use CB Query Field to grab what groups they belong to using a database query. Then use CB Auto Actions with a redirect query after login trigger and have a condition to check that query field.


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.
The following user(s) said Thank You: flocktree

Please Log in to join the conversation.

11 years 6 months ago #211907 by nopersonalive
Replied by nopersonalive on topic Re: Redirect after login based on Group
I really, REALLY tried to come up with the query.

Please Kyle, help me with an example to display the current groups using the cbQuery plugin!

I cant think of a way to select the current group based on the user id.

Do you have any ideas?

Please Log in to join the conversation.

11 years 6 months ago #211918 by krileon
Replied by krileon on topic Re: Redirect after login based on Group
Below should give you a comma separated list of group ids that the user belongs to.
SELECT GROUP_CONCAT( DISTINCT `group` ) FROM `#__groupjive_users` WHERE `user_id` = '[user_id]' GROUP BY `user_id`

It's designed for CB Query Fieldtype plugin. So simply copy, paste, and save. Then use however you need and wherever you need.


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.
The following user(s) said Thank You: nopersonalive

Please Log in to join the conversation.

11 years 6 months ago #211933 by nopersonalive
Replied by nopersonalive on topic Re: Redirect after login based on Group
Great! Thank you!

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.228 seconds

Facebook Twitter LinkedIn