[#2045] onAfterUserApproval inconsistency

13 years 6 months ago #145413 by jhaines
The API trigger onAfterUserApproval fires when a user is set to approved (green tick) in the CB User Manager, however it appears not to fire when set to unapproved (red X) also from CB User Manager. This seems odd, not least because the API passes a parameter $approved which indicates not-approved, approved or unapproved. Furthermore this behaviour seems to be inconsistent with the operation of onBeforeUserBlocking which fires both on block and unblock also from the CB User Manager and which passes a parameter $actionValue indicating a change to blocked or unblocked.

I wonder whether onAfterUserApproval could be altered to fire whenever approval is changed, rather than just on change to approved? It seems like such a change ought to be backwards compatible, so long as $approved is currently processed correctly by all users of the trigger. Alternatively, is there another way to get a trigger on change from approved to unapproved in the CB User Manager?

Julian

Post edited by: krileon, at: 2010/11/04 19:07

Please Log in to join the conversation.

13 years 6 months ago #145512 by krileon
Replied by krileon on topic Re:onAfterUserApproval inconsistency
Reviewing source this trigger is only fired if the approval status = 1 (approved), but onBefore is fired regardless. Don't agree with this so have added a bug ticket and a propose patch to have resolved. For the time being you can use onBeforeUserApproval which works in the same manner as onBeforeUserBlocking.

#2045


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.

13 years 6 months ago #145547 by jhaines
Replied by jhaines on topic Re:onAfterUserApproval inconsistency
Thanks for the suggestion. onBeforeUserApproval seems to work fine for transitions to approved and disapproved from CB user manager. Good enough for now.

Julian

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.190 seconds

Facebook Twitter LinkedIn