Skip to Content Skip to Menu

Registration Form triggers for CB Auto Actions

  • mlilge
  • mlilge
  • OFFLINE
  • Posts: 13
  • Thanks: 0
  • Karma: 0
3 years 7 months ago #324175 by mlilge
Hi,

I need to execute a DB query before a Registration From is displayed and right after the registration request is submitted. New users get invited with help of CB Invites.

I wonder which are the right CB Auto Action triggers for these two scenarios as there are many options.

The triggers shall be unrestricted, i.e. always firing the DB query.

Any help would be appreciated!

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

  • mlilge
  • mlilge
  • OFFLINE
  • Posts: 13
  • Thanks: 0
  • Karma: 0
3 years 7 months ago #324180 by mlilge
Found the trigger for the first AA myself or at least one that makes sense to me:

'onBeforeRegisterFormDisplay' seems to fire just before the Registration Form is rendered. 'onBeforeRegisterForm' works as well, however, differences between these triggers are not clear to me.

Still struggling to find the second trigger (if there is any) just when the user hits the button of this form to complete his registration. Any ideas anybody?

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 7 months ago #324187 by krileon
The following should be used for non-blocking behavior during registrations and user updates. For example if you need to modify the value of a users field after they register or update their profile. Another example being you need to push information to an external service or database.

onAfterUserRegistration = frontend registration
onAfterNewUser = backend registration
onAfterUserUpdate = frontend edit
onAfterUpdateUser = backend edit

As for directly before the rendering and display of the registration form and after it use the following.

onBeforeRegisterFormDisplay = before frontend registration form
onAfterRegisterFormDisplay = after frontend registration form

Those 2 triggers directly wrap around the form. Other registration form triggers are earlier in the process. For example onBeforeRegisterFormRequest or onBeforeRegisterForm would be used to block access to registration entirely


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.

  • mlilge
  • mlilge
  • OFFLINE
  • Posts: 13
  • Thanks: 0
  • Karma: 0
3 years 7 months ago #324189 by mlilge
Thanks Kyle!

Do I understand correctly, there is no trigger to e.g. implement a final check on the entered data right after the user clicked the button but before user data are actually stored?

Or would that be the 'onBeforeUserRegistration' trigger? If so, would it be possible to reject the registration process with a meaningful message or error code?

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 7 months ago #324192 by krileon
There's triggers for that as well. They are as follows.

onBeforeUserRegistration = frontend registration
onBeforeNewUser = backend registration
onBeforeUserUpdate = frontend edit
onBeforeUpdateUser = backend edit

The way to interrupt registration is to either raise an error to the $_PLUGIN global or set one on the user object using ->setError( 'ERROR MSG HERE' ). I can't really suggest anything further without knowing more about what you're trying to do exactly.


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.

  • mlilge
  • mlilge
  • OFFLINE
  • Posts: 13
  • Thanks: 0
  • Karma: 0
3 years 7 months ago #324195 by mlilge
Ok, this makes sense.

The feature is to check the validity of a registration code that either may be already expired when starting the registration process or when the user has submitting his data.

A code's individual expiry date is stored in a db table and a first AA Query shall just delete expired registration codes that will cause an error notification on that field of the form (onBeforeRegisterFormDisplay). That's already implemented and works just fine.

If the user is very slow a code may still be valid in the beginning of the registration processs but may have expired at submission time. The system is very picky, hence I like reject such attempts, too. So, I would need a second AA that does more or less the same check (and deletion) but most likely has to display an error message to the user (onBeforeUserRegistration).

From your explanation I'm not sure whether this would be an AA Query with an additional Output - echo php coded message (if that is supported by this trigger) or a AA Code?

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

Moderators: beatnantkrileon
Powered by Kunena Forum