Skip to Content Skip to Menu

[#6458] auto action condition first login

  • carin
  • carin
  • OFFLINE
  • Posts: 417
  • Thanks: 18
  • Karma: 0
7 years 7 months ago - 7 years 7 months ago #292332 by carin
Replied by carin on topic auto action condition first login
I am on 2.1.2+build.2017.02.08.01.14.28.ec3d63d1f but the [lastvisitdate] condition does not work. Still overriding the first login redirect. But to get back to the starting point of that: I need that only because the user does get redirected to the home page after login. I think it should be the default behavior that the user stays on the same page after login (just like it is done by the Joomla core).

The [lastvisitdate] condition [lastvisitdate] Not Equal To 0000-00-00 00:00:00 does not work in fields as well since the [lastvisitdate] get set before the condition is tested.

CB 2.0
Last edit: 7 years 7 months ago by carin.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48482
  • Thanks: 8283
  • Karma: 1443
7 years 7 months ago #292336 by krileon
Replied by krileon on topic auto action condition first login
Please read the ticket details carefully to understand what was implemented. Nothing in regards to lastvisitdate was changed. What was changed is the variables available to the login triggers as noted in the ticket.

forge.joomlapolis.com/issues/6458#note-2

Specifically you could use onAfterLogin and condition that [var3] is equal to true to determine if it's first login attempt.

The [lastvisitdate] condition [lastvisitdate] Not Equal To 0000-00-00 00:00:00 does not work in fields as well since the [lastvisitdate] get set before the condition is tested.

The last visit date is updated during the login process and believe it also gets set on logout. That's simply how it functions. Please keep this in mind when trying to do any behavior on it.


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.

  • carin
  • carin
  • OFFLINE
  • Posts: 417
  • Thanks: 18
  • Karma: 0
7 years 7 months ago - 7 years 7 months ago #292346 by carin
Replied by carin on topic auto action condition first login
Thanks but "[var3] is equal to false" fires on first login. So I still cant prevent an auto action to fire on first login.

And again: Why is CB not behaving like Joomla, meaning redirecting the user after login to the page he was on when he logged in? I would not have to deal with that whole thing at all.

CB 2.0
Last edit: 7 years 7 months ago by carin.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48482
  • Thanks: 8283
  • Karma: 1443
7 years 7 months ago #292347 by krileon
Replied by krileon on topic auto action condition first login

Thanks but "[var3] is equal to false" fires on first login. So I still cant prevent an auto action to fire on first login.

Try conditioning against 1 or 0 instead of true or false.

And again: Why is CB not behaving like Joomla, meaning redirecting the user after login to the page he was on when he logged in? I would not have to deal with that whole thing at all.

CB does. Leave the login redirect URLs completely blank. If a return URL is available CB will use it. If one isn't sent with the URL (as &return=BASE64_ENCODED_URL) then it can't return them as it has no idea where to return them to. If this is not working edit "Community Builder System plugin" within Extensions > Plugins and ensure under Parse URLs you have the following configuration.

Redirect URLs: Enabled
Rewrite URLs: Enabled
Pass Return URLs: Enabled

Below is your original post in this topic and is all that bug ticket is aiming to address.

carin wrote: I have an "onAfterLogin" redirect action. How do I prevent that action from executing on first login after registration so it does not override the "First Login Redirect"-value in the cb configuration?


Sorry, I don't understand anymore what you're trying to do. Are you wanting a login redirect for first login only, but not regular logins? Are you wanting to return them on first login, but redirect them on subsequent logins? Please provide exactly what you're trying to do and how it's behaving so I have steps to reproduce and test your issue.


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.

  • carin
  • carin
  • OFFLINE
  • Posts: 417
  • Thanks: 18
  • Karma: 0
7 years 7 months ago #292364 by carin
Replied by carin on topic auto action condition first login
Thank you, 1 instead of true works.

I followed your hints and the CB login works like Joomla now. But when I put the login form in a modal it redirects to the homepage. That is why I needed the redirect action I explained in the first post.

Now I still have the problem with that other field that should only show up on the first login. How would I achieve that since the [lastvisitdate] is no option?

CB 2.0

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48482
  • Thanks: 8283
  • Karma: 1443
7 years 7 months ago #292375 by krileon
Replied by krileon on topic auto action condition first login

Now I still have the problem with that other field that should only show up on the first login. How would I achieve that since the [lastvisitdate] is no option?

I suppose you could have a checkbox field that you toggle to checked after a login that isn't their first login then condition against that checkbox field. Another option maybe 2 auto actions 1 that adds a usergroup if it's their first login then another that removes it if it's not their first login. Then you'd condition against that usergroup or a view access level that includes that usergroup. This would avoid needing a field for it and allows ACL usage throughout your site for first visit.


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