Build a logout and redirect link

4 years 3 months ago #316219 by activha
Build a logout and redirect link was created by activha
Hello

We would like to build a standard link which when clicked would allow the user to be automatically logged out and redirected to the registration page.

Can we do it with CB ?

Would you have an idea ?

Please Log in to join the conversation.

4 years 3 months ago #316220 by krileon
Replied by krileon on topic Build a logout and redirect link
You'd have to format the &return parameter for the logout URL or use a Login / Logout auto action in CB Auto Actions. Below for example should work.

Global
Triggers: None
Type: Login / Logout
User: Automatic
Access: All Registered Users
Action
Mode: Logout
Redirect: [cb:url location="registers" /]

If you don't want to use an auto action you'll need to add the &return to the logout URL yourself. To format the &return you'll need to take the URL you want to redirect them to and base64 encode it then prefix it with B: then add that to the &return in your logout URL.


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.

4 years 3 months ago - 4 years 3 months ago #316221 by activha
Replied by activha on topic Build a logout and redirect link
Thanks a lot !

I'd rather use the auto action but I have one more question.

On the page where the user is we would like to get a cb field to pass to the register url.

I tried to add ?atid=[cb_codeatid] to [cb:url location="registers" /] but of course as there is no longer an user object on the registration page opened, the field is empty.

Do you have a suggestion to cleanly pass this field to the redirection before the log out ?

It seems also that a message/alert is not displayed on the registration page (though it works well on other CB pages when we try)

Please Log in to join the conversation.

4 years 3 months ago #316232 by krileon
Replied by krileon on topic Build a logout and redirect link

Do you have a suggestion to cleanly pass this field to the redirection before the log out ?

You don't have to use the URL substitution. You can supply the URL yourself beginning with index.php like the following.

index.php?option=com_comprofiler&view=registers&Itemid=MENU_ID&atid=[cb_codeatid]

Be sure to replace MENU_ID with the menu id for your registration menu item or the URL likely won't SEF nicely if using SEF.

It seems also that a message/alert is not displayed on the registration page (though it works well on other CB pages when we try)

That's a known issue with no fix at this time. Joomla wipes the session where messages are queued so it can't display anything unless the message is queued after the session has been regenerated as a guest session on the next page load, but by then it's too late.


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

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.248 seconds

Facebook Twitter LinkedIn