Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

[SOLVED] User evaluation in autoaction

  • fribse2011
  • fribse2011
  • OFFLINE
  • Posts: 921
  • Thanks: 79
  • Karma: 8
12 years 1 month ago - 12 years 1 month ago #216223 by fribse2011
[SOLVED] User evaluation in autoaction was created by fribse2011
When the year changes, we're going to have some users that are no longer members of our diving club, I was thinking that I should make some sort of auto-action, that evaluates if they have paid, and if not, they should be removed from the member section.
If I use the trigger 'During login', will that auto-action take effect after the credentials, but before the system registers them as logged in?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.
Last edit: 12 years 1 month ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
12 years 1 month ago #216247 by krileon
Replied by krileon on topic Re: User evaluation in autoaction

If I use the trigger 'During login', will that auto-action take effect after the credentials, but before the system registers them as logged in?

Yes, the login occurs right after "onDoLoginNow" and right before "onAfterLogin". "onDuringLogin" occurs earlier in the login process. "onDoLoginNow" is probably the best solution as it passes $loggedIn by reference, which you can change to false and have it stop the login instantly; however you need to utilize it in a new plugin as CB Auto Actions doesn't pass it by reference.


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.

  • fribse2011
  • fribse2011
  • OFFLINE
  • Posts: 921
  • Thanks: 79
  • Karma: 8
12 years 1 month ago #216271 by fribse2011
Replied by fribse2011 on topic Re: User evaluation in autoaction
I don't want to stop the login, just demote them to normal 'registered' users.

Can I get the current year somehow?
I have a multiselect field that contains the years paid (2012,2013,2014 etc.).
I want to make an autoaction that looks like this:

Type: Usergroup
Trigger: OnDoLoginNow
Access: Member
Conditional: {month} is equal to 'February'
and [cb_betalt] does not contain {year}
Action: Replace Usergroups: Registered

That way they will be demoted to regular members if their payment is not registered by february.
But what can I write to get current year and month?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
12 years 1 month ago #216299 by krileon
Replied by krileon on topic Re: User evaluation in autoaction

I don't want to stop the login, just demote them to normal 'registered' users.

I see, becomes much easier to do then, lol.

Can I get the current year somehow?

Yes, using the below substitution.

[cb:date format="Y" /]

But what can I write to get current year and month?

Based off your dropdown you only need/want Year, but you can get whatever you like using the below.

[cb:date format="PHP_DATE()_FORMAT" /]

See the below for formatting.

us3.php.net/manual/en/function.date.php


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.

  • fribse2011
  • fribse2011
  • OFFLINE
  • Posts: 921
  • Thanks: 79
  • Karma: 8
12 years 1 month ago #216340 by fribse2011
Replied by fribse2011 on topic Re: User evaluation in autoaction
Yes, but I want to make sure that the rule doesn't fire until february, and give people a chance to be a bit late in payment :-)
Thankyou, I'll try out a rule.

Btw. I have some rules firing on 'OnAfterUserUpdate' and 'OnAfterUpdateUser', will they be triggered by me modyfying a field in the profile with an autoaction?

Best regards
Fribse

Frømandsklubben Nikon, www.nikondyk.dk
We're a volunteer driven diving club in Ishøj, Denmark.
Har du brug for en dykkerklub der rummer alle, så kom ned til os.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
12 years 1 month ago #216354 by krileon
Replied by krileon on topic Re: User evaluation in autoaction

will they be triggered by me modyfying a field in the profile with an autoaction?

Nope.


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