Feature proposal #4237
closedImplement additional triggers
Added by krileon about 11 years ago. Updated about 10 years ago.
Description
All access denied pages throw an error and go to a blank page. There should be a trigger fired before this happens so CB Auto Actions, plugins, etc.. can intercept the denied access and send to or display whatever they like. As is you have to make core modifications to change the redirect.
Updated by krileon about 11 years ago
Add trigger to authentication API just inside of if ( $resultError ) {
as "onFailedLogin" so failed login messages can be intercepted or failed logins can be redirected, etc..
Updated by krileon about 11 years ago
onLoginFailed
Fired during authentication when login process has $loggedIn as false. Provides $resultError and $returnURL by reference.
Updated by krileon about 11 years ago
onUserModerator
Fired when isModerator is used (executes get_user_moderator) to check user moderator access. Provides $user_id for the user being checked and provides $isModerator by reference so moderator access can be overridden.
Updated by krileon about 11 years ago
onUserPermissionTask
Fires when a user permission for a task is checked (profile edit for example). Provides $user_id for the user being checked and $action for the action checked. Provides $ret so the permission can be overridden (set to null for access).
Updated by krileon about 11 years ago
onUsersPermission
Fires when a list of users permissions are being checked. Provides $user_ids, $action, and $allow_myself. Provides $msg by reference to override permission success (set to null to allow).
Updated by krileon about 11 years ago
onUserSuperAdmin
Fired when amIaSuperAdmin is used to check user super admin access. Provides $userId for the user being checked and provides $isSuperAdmin by reference so super admin access can be overridden.
Updated by krileon about 11 years ago
onBeforeUserProfileEditRequest
Fired when attempting to edit a users profile. Provides $uid (user id) for the user being edited. Provides $msg by reference to override profile edit access errors (set to null for access). Variable 3 holds $ui as trigger fires on frontend and backend. Use variable 3 to determine which location you want to target.
Updated by krileon about 11 years ago
onBeforeUserProfileSaveRequest
Fired when attempt to save a users profile. Provides $uid (user id) for the user being saved. Provides $msg by reference to override profile save access errors (set to null for access). Variable 3 holds $ui as trigger fires on frontend and backend. Use variable 3 to determine which location you want to target.
Updated by krileon about 11 years ago
onAfterUserProfileSaved
Fired when profile edit is successfully saved. This is different from the profile update triggers because this specifically and only fires when profile edit it self is used. So API calls to save a profile do not fire this. This is very useful for redirecting after a profile edit only. Provides $userComplete for the user saved and provides $ui for the location the save occurred (1 for frontend and 2 for backend).
Updated by krileon about 11 years ago
onAfterUserProfileSaveFailed
Fired when profile edit save fails due to an error. This is different from the other profile update triggers as it only fires when profile edit directly fails. Provides $userComplete for the user that failed to save, $regErrorMSG by reference which contains the error returned, and $ui for the location (1 for frontend and 2 for backend).
Updated by krileon about 11 years ago
onBeforeUserProfileAccess
Fired much earlier in access check of a users profile. We can't use onBeforeUserProfileRequest as it's already used. This trigger is fired before a profile access error check is output so you can replace the error message, force profile access, or add a custom redirect for example. Provides $uid (user id), $msg by reference which contains the error message if any (set to null to allow access), and $ui for location (always 1 for frontend).
Updated by krileon about 11 years ago
onAfterPasswordReminder
Fired after a successful or failed password reminder usage. Provides $user_id of the founder user, $newpass for the new password for the user, and $res by reference if the reminder failed or was successful.
Updated by krileon about 11 years ago
onAfterUserRegistrationSaveFailed
Fired when a registration attempt fails directly after saving. This is different from the normal registration trigger as it fires right before profile form is re-displayed and applies only to physical registrations (so not fired by api calls). Provides $userComplete by reference of the user being registered, $regErrorMSG by reference of any error output, and $ui for the location (1 for frontend and 2 for backend).
Updated by krileon about 11 years ago
onAfterSaveUserRegistration
Fired right before registration success message is displayed. This is different from the normal after registration trigger as it only fires for physical registrations and only after the entire registration process is done. This can be used to redirect to a custom success page, auto login, etc.. Provides $userComplete by reference of the user registered, $messagesToUser by reference of the messages array to display, and $ui for location (1 for frontend and 2 for backend).
Updated by krileon about 11 years ago
onAfterUserLoginFailed
Fired directly after a physical frontend login failed. This is useful to affect frontend login form/module usage without having to affect API usage (like from CB Connect). Provides $username, $password, $return by reference, $alertmessages by reference, $messagesToUser by reference, and $resultError by reference.
Updated by krileon about 11 years ago
onAfterUserLoginSuccess
Fired directly after a physical frontend login was successful. This is useful to affect frontend login form/module usage without having to affect API usage (like from CB Connect). Provides $username, $password, $return by reference, $alertmessages by reference, $messagesToUser by reference, and $resultError by reference.
Updated by krileon about 11 years ago
onAfterUserLogoutSuccess
Fired directly after successful physical logout. This will not fire for API logouts, but only for login form logouts. This is useful for redirecting or altering logout messages directly after a physical logout. Provides $return by reference (url to redirect the user to), $message by reference (true/false to display a message or not), $messageToUser by reference as the message to display.
Updated by krileon about 11 years ago
onAfterUserLogoutFailed
Fired directly after a physical logout failed. This is only fired if logout from login form fails. Provides $resultError by reference containing the logout error message.
Updated by krileon about 11 years ago
onAfterUserConfirmation
Fired directly after a users confirms on frontend just before the message is echoed. This allows a redirect to be added, the message to be altered, etc.. Provides $user by reference, $confirmcode, $confirmed, $class by reference as the message html class, and $messagesToUser by reference as the message array to display.
Updated by krileon about 11 years ago
onBeforeReportUserForm
Fired directly before the report user form is rendered. Provides $form, $uid, $reportedByUser, and $reportedUser.
Updated by krileon about 11 years ago
onBeforeReportUserFormDisplay
Fired directly before the report form is actually displayed. Contains $uid, $reportedByUser, and $reportedUser.
Updated by krileon about 11 years ago
onStartSaveReportUser
Fired directly before a report user request is saved. Contains &$row, $reportedByUser, and $reportedUser.
Updated by krileon about 11 years ago
onAfterSaveReportUser
Fired after a report user request is saved, but before success message is displayed. Contains &$row, $reportedByUser, and $reportedUser.
Updated by krileon about 11 years ago
onBeforeSaveReportUser
Fired directly before a report user request is saved. Contains &$row, &$reportedByUser, and &$reportedUser.
Updated by krileon about 11 years ago
onBeforeBanUserForm
Fired before moderator ban form is displayed. Contains $uid, &$bannedByUser, and &$bannedUser.
Updated by krileon about 11 years ago
onBeforeBanUserFormDisplay
Fired directly before the moderator ban form is actually displayed. Contains $uid, &$orgBannedReason, &$bannedByUser, and &$bannedUser.
Updated by krileon about 11 years ago
onBeforeUserBan
Fired directly before a user ban state is saved. Contains &$this, &$state, &$by, and &$reason.
Updated by krileon about 11 years ago
onAfterUserBan
Fired directly after a user ban state is saved. Contains &$this, &$state, &$by, and &$reason.
Updated by krileon about 11 years ago
onBeforeManageConnectionsFormDisplay
Fired before the manage connections form is actually rendered. Contains &$connections, &$actions, &$total, &$connMgmtTabs, &$pagingParams, &$perpage, and &$connecteds.
Updated by krileon about 11 years ago
onBeforeModerateImagesFormDisplay
Fired directly before the moderator image approval form is actually rendered. Does not contain any variables.
Updated by krileon about 11 years ago
onBeforePendingApprovalUsersFormDisplay
Fired directly before the pending users approval form is actually rendered. Contains &$users.
Updated by krileon about 11 years ago
Fired directly after toolbar html is created and directly before toolbar html ends. Contains $_CB_Backend_task and $_CB_Backend_Menu.
onBeforeToolbar
onAfterToolbar
Updated by krileon about 11 years ago
onBeforeModerateReportsFormDisplay
Fired directly before the moderator user reports form is actually rendered. Does not contain any variables.
Updated by krileon about 11 years ago
onBeforeViewReportsFormDisplay
Fired directly before the view user reports form is actually rendered. Contains $uid and $act.
Updated by krileon almost 11 years ago
onBeforeModerateBansFormDisplay
Fired directly before the bans form is actually rendered. Contains $uid and $act.
Updated by krileon almost 11 years ago
onConfigurationDisplay
Fires during CB configuration display. This allows extending CB configuration with new parameters using CB plugins. This plugin expects an array response to divide it into multiple sections. The sections are: tab (helps add a new config tab), general, registration, userlist, userprofile, images, moderation, connections, integration. Contains &$ueConfig, &$lists, $tabs.
Updated by krileon almost 11 years ago
onAfterRegisterFormDisplay
Fires directly after the registration form has been displayed. Contains $user and $tabcontent. Behaves same as after profile edit display trigger except for registration.
Updated by krileon almost 11 years ago
onBeforeSendEmailMSG
Fires directly before a notification API email is sent. Contains $this, &$to, &$from, &$sub, &$msg, &$addPrefix, &$mode, &$cc, &$bcc, &$attachment.
Updated by krileon almost 11 years ago
onAfterSendEmailMSG
Fired directly after a notification API email is sent. Contains $result, $this, $to, $from, $sub, $msg, $addPrefix, $mode, $cc, $bcc, $attachment.
Updated by krileon almost 11 years ago
onBeforeRegisterFormRequest
Fired directly before the frontend registration form is requested. Contains &$msg, $emailpass, &$regErrorMSG. If $msg has a value then form access will be denied.
Updated by krileon almost 11 years ago
onBeforeSaveUserRegistrationRequest
Fired directly before frontend registration save is requested. Contains &$msg. If $msg has a value then save access will be denied.
Updated by krileon almost 11 years ago
onBeforeUserConfirmationRequest
Fired directly before confirmation request is processed. It contains no variables.
Updated by krileon almost 11 years ago
onBeforeReportUserRequest
Fired directly before a report user request (could be form or save). Contains $uid, &$msg, $form. If $msg has a value then access will be denied.
Updated by krileon almost 11 years ago
onBeforeBanUserRequest
Fired directly before user ban request (could be form or save). Contains $uid, &$msg, $form, $act. If $msg has a value then access will be denied.
Updated by krileon almost 11 years ago
onBeforeAddConnectionRequest
Fired before a frontend connection request is made. Contains $userid, $connectionid, &$msg, &$umsg, $act. If $msg has a value then access will be denied.
Updated by krileon almost 11 years ago
onBeforeRemoveConnectionRequest
Fired directly before a frontend remove connection request is made. Contains $userid, $connectionid, &$msg, $act. If $msg has a value then access will be denied.
Updated by krileon almost 11 years ago
onBeforeDenyConnection
Fired directly before a frontend deny connection request is made. Contains $userid, $connectionid, &$msg, $act. If $msg has a value then access will be denied.
Updated by krileon almost 11 years ago
onBeforeAcceptConnection
Fired directly before a frontend accept connection request is made. Contains $userid, $connectionid, &$msg, $act. If $msg has a value then access will be denied.
Updated by krileon almost 11 years ago
onBeforeManageConnectionsRequest
Fired directly before a frontend manage connections request is made. Contains $userid and &$msg. If $msg has a value then access will be denied.
Updated by krileon almost 11 years ago
onBeforeSaveConnectionsRequest
Fired directly before a frontend save connections request is made. Contains $connectionids and &$msg. If $msg has a value then access will be denied.
Updated by krileon almost 11 years ago
onBeforeProcessConnectionsRequest
Fired directly before a frontend process connections request is made. Contains $connectionids and &$msg. If $msg has a value then access will be denied.
Updated by krileon over 10 years ago
onBeforeCreateMailer
Fired directly before a CB mailer object is populated with data. Contains &$mail, &$from, &$fromname, &$subject, &$body.
Updated by krileon over 10 years ago
onAfterCreateMailer
Fired directly after a mailer object is created and populated with data. Contains &$mail, $from, $fromname, $subject, $body.
Updated by krileon over 10 years ago
onBeforeSendMail
Fired before a mail is sent by CB. Contains &$mail, &$from, &$fromname, &$recipient, &$subject, &$body, &$mode, &$cc, &$bcc, &$attachment, &$replyto, &$replytoname, &$properties, &$error.
Updated by krileon over 10 years ago
onAfterSendMail
Fired after an email is sent by CB. Contains $mailsSent, $mail, $from, $fromname, $recipient, $subject, $body, $mode, $cc, $bcc, $attachment, $replyto, &$replytoname, $properties, $error.
Updated by krileon over 10 years ago
onAfterFirstLogin
Fired directly before onAfterLogin and behaves exactly the same except is only fired on first login. Contains &$row, $loggedIn.
Updated by krileon about 10 years ago
- Status changed from Assigned to Resolved
- % Done changed from 0 to 100