Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[#5461] Cb Auto Action to Logout and Login users automatically

  • ricco1
  • ricco1
  • OFFLINE
  • Posts: 310
  • Thanks: 8
  • Karma: -7
9 years 2 months ago - 9 years 2 months ago #269353 by ricco1
Hi,

As I still have some session problems, on every State Change or on every User Group change I'd like to logout and then login the users automatically without them noticing it.

Could you tell us if this is possible, and how, if yes, please?

Thank you,
Regards,
ricco
Last edit: 9 years 2 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
9 years 2 months ago #269365 by krileon
You can use whatever action you want on CBSubs subscription state change using the below.

Plan Active
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To A

Plan Expired
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To X

CB Auto Actions has a login/logout action. No idea if chaining the two one after another will work, but you could try.

Changing usergroups using the above usage with CB Auto Actions should work perfectly fine without needing a logout though as it does up the users session when done from frontend. It only updates their session though if they are the one that triggered the state change.


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: ricco1

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

  • ricco1
  • ricco1
  • OFFLINE
  • Posts: 310
  • Thanks: 8
  • Karma: -7
9 years 2 months ago - 9 years 2 months ago #269372 by ricco1
Thank you Kyle. If the problem persists I will try your suggestions.

For now after 2 days of hard digging I've just found a way to resolve the session issue with the User Group changes:

in libraries/joomla/user/user.php on line 444 I've REPLACED:

public function getAuthorisedViewLevels()
{
if ($this->_authLevels === null)
{
$this->_authLevels = array();
}

if (empty($this->_authLevels))
{
$this->_authLevels = JAccess::getAuthorisedViewLevels($this->id);
}

return $this->_authLevels;
}

WITH:

public function getAuthorisedViewLevels()
{
if ($this->_authLevels === null)
{
$this->_authLevels = array();
}

if (empty($this->_authLevels) || $this->_authLevels != JAccess::getAuthorisedViewLevels($this->id))
{
$this->_authLevels = JAccess::getAuthorisedViewLevels($this->id);
}

return $this->_authLevels;
}

Best regards,
ricco
Last edit: 9 years 2 months ago by ricco1.
The following user(s) said Thank You: krileon

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
9 years 2 months ago #269373 by krileon
Ok, it looks like when CB changes a users usergroups we need to run clearAccessRights to reset those caches. This needs to be implemented directly into CB though when gids is stored. Have added a bug ticket to fix for a later release.

forge.joomlapolis.com/issues/5461


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.

  • ricco1
  • ricco1
  • OFFLINE
  • Posts: 310
  • Thanks: 8
  • Karma: -7
9 years 2 months ago #269380 by ricco1
I thank that we live on the same planet with you, Kyle, I thank whenever I can, and I’m thanking you even now when you have to thank me. Is it so hard to thank? You’ve made a button for it. But who cares, just continue, life goes on, not for long, unfortunately.

Specially for you:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
9 years 2 months ago #269381 by krileon
Not really sure how to respond to that. Of course I'm grateful for everyone's feedback. I replied, immediately went back to investigating the issue further, added more notes to the ticket, went to eat lunch, then went back to working on GJ. I apologize for forgetting to give proper thanks.


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.

Moderators: beatnantkrileon
Powered by Kunena Forum