The module triggers a few Yii Events that allow advanced programming and custom code to be injected. The following events are available via the comyii\user\Module class:
Module::EVENT_BEFORE_ACTIONorbeforeActionModule::EVENT_REGISTER_BEGINorbeforeRegisterModule::EVENT_REGISTER_COMPLETEorregisterCompleteModule::EVENT_LOGIN_BEGINorloginBeginModule::EVENT_LOGIN_COMPLETEorloginCompleteModule::EVENT_LOGOUTorlogoutModule::EVENT_PASSWORD_BEGINorpasswordBeginModule::EVENT_PASSWORD_COMPLETEorpasswordCompleteModule::EVENT_RECOVERY_BEGINorrecoveryBeginModule::EVENT_RECOVERY_COMPLETEorrecoveryCompleteModule::EVENT_RESET_BEGINorresetBeginModule::EVENT_RESET_COMPLETEorresetCompleteModule::EVENT_ACTIVATE_BEGINoractivateBeginModule::EVENT_ACTIVATE_COMPLETEoractivateCompleteModule::EVENT_AUTH_BEGINorauthBeginModule::EVENT_AUTH_COMPLETEorauthCompleteModule::EVENT_NEWEMAIL_BEGINornewemailBeginModule::EVENT_NEWEMAIL_COMPLETEornewemailCompleteModule::EVENT_EXCEPTIONorexception
Namespace: comyii\user\events\RegistrationEvent
The RegistrationEvent allows you to programmatically control your application workflow before and after an user account registration.
Module::EVENT_REGISTER_BEGINModule::EVENT_REGISTER_COMPLETE
- Data Type: yii\db\ActiveRecord
- Default Value:
NULL
The current user active record.
- Data Type:
string|array - Default Value:
Yii::$app->user->returnUrl
The URL to be redirected to - will default automatically to the returnUrl. See comyii\controllers\BaseController::safeRedirect method.
- Data Type: string
- Default Value:
Module::viewSettings[Module::VIEW_REGISTER]
The main view file to be displayed. If this is NULL or not set the default view file (views/account/register) will be used for display as set in Module::viewSettings[Module::VIEW_REGISTER].
- Data Type: boolean
- Default Value:
false
The current status for the controller. This is necessary for event handlers to communicate to the controller whether to not abort the registration process. If set to true, the registration will fail.
- Data Type: string
- Default Value:
NULL
The session flash message type as used by Yii::$app->session->setFlash.
- Data Type: string
- Default Value:
NULL
The session flash message for the controller passed via Yii::$app->session->setFlash. This is used so that event handlers can update the success messages for scenarios like user registration.
- Data Type: string
- Default Value:
NULL
The user type for registration. This is used if there are multiple registration types (i.e. different user types).
- Data Type: boolean
- Default Value:
false
Whether or not to activate the user account.
- Data Type: boolean
- Default Value:
false
The current user activation status.
Namespace: comyii\user\events\LoginEvent
The LoginEvent allows you to programmatically control your application workflow before and after an user account login.
Module::EVENT_LOGIN_BEGINModule::EVENT_LOGIN_COMPLETE
- Data Type: yii\db\ActiveRecord
- Default Value:
NULL
The current user active record (if logged in) or the login model (before login).
- Data Type:
string|array - Default Value:
Yii::$app->user->returnUrl
The URL to be redirected to - will default automatically to the returnUrl. See comyii\controllers\BaseController::safeRedirect method.
- Data Type: string
- Default Value:
Module::viewSettings[Module::VIEW_LOGIN]
The main view file to be displayed. If this is NULL or not set the default view file (views/account/login) will be used for display as set in Module::viewSettings[Module::VIEW_LOGIN].
- Data Type: boolean
- Default Value:
false
The current status for the controller. This is necessary for event handlers to communicate to the controller whether to not abort the login process.
- Data Type: string
- Default Value:
NULL
The session flash message type as used by Yii::$app->session->setFlash.
- Data Type: string
- Default Value:
NULL
The session flash message for the controller passed via Yii::$app->session->setFlash. This is used so that event handlers can update the success messages for scenarios like user registration.
- Data Type: boolean
- Default Value:
Module::socialSettings['enabled']
Whether social authentication is enabled. If not set, this defaults to the Module::socialSettings setting.
- Data Type: string|array
- Default Value:
false
The social authentication action. If not set, defaults to Module::ACTION_SOCIAL_AUTH set within Module::actionSettings.
- Data Type: boolean
- Default Value:
false
Whether an account unlock attempt after expiry. Defaults to false.
- Data Type: boolean
- Default Value:
false
Whether a new password has been set after expiry. Defaults to false.
- Data Type: integer
- Default Value:
NULL
The account status at login. Should be one of the Module::STATUS constants.
- Data Type: string
- Default Value:
NULL
The login section title.
- Data Type: string
- Default Value:
NULL
The social auth login section title.
- Data Type: integer
- Default Value:
NULL
The result of the login attempt. Should be one of the values below:
LoginEvent::RESULT_SUCCESSor1LoginEvent::RESULT_FAILor2LoginEvent::RESULT_LOCKEDor3LoginEvent::RESULT_ALREADY_AUTHor4LoginEvent::RESULT_EXPIREDor5