Skip to Content Skip to Menu

Dynamic redirect with Auto Action based on profile field after first login

  • GUEST
10 years 5 months ago - 10 years 5 months ago #244899 by
Hello,

during registration I pre-fill a hidden profile field with a value and based on the value I want to redirect the URL after the first login. I am using the AutoActions plugin as it is very convenient to attach some code to the events.

My questions:
Is there an event that I can use to run some PHP/JS/HTML code to redirect after first login? I see 'OnBeforeFirstLogin' but I assume redirecting here will cancel the login.

If I have to use 'OnAfterLogin', how do I determine if the was the first login?


Thanks

Carsten
Last edit: 10 years 5 months ago by .

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 5 months ago #244940 by krileon
There's no onAfterFirstLogin, but I've added one for next CB 2.0 release. For now there's only onAfterLogin. Generally the way it's done right now is you have a checkbox field that isn't shown on profile to determine if it's first login or not. You'd check if it's value is equal to 0. If it is then it's first login. You then have a Field action that does the same check and if it is you set its value to 1. This way the checkbox will be set to 1 if first login so the actions won't fire again on next login. It's not a very good way to have to do it, but until next CB 2.0 release there's no onAfterFirstLogin.


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.

  • GUEST
10 years 5 months ago #244941 by
Hi,

Thank you for your answer. Yep, this sounds ugly ;).
Is there an ETA on the next release?

Best regards

Carsten

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
10 years 5 months ago #244948 by krileon

Is there an ETA on the next release?

When it's done. We do not provide release dates, sorry.


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