public function actionSignup() { Yii::info('User is entering the signup page', __CLASS__); if (!$this->module->allowRegistration) { throw new NotFoundHttpException(Yii::t(Module::I18N_CATEGORY, 'Registration disabled!')); } $model = Yii::createObject(Yii::$app->user->registerForm); $event = Event::createModelEvent($model); $this->trigger(self::EVENT_BEFORE_SIGNUP, $event); if ($model->load(Yii::$app->request->post()) && $model->signup()) { $this->trigger(self::EVENT_AFTER_SIGNUP, $event); if (Yii::$app->user->enableConfirmation) { return $this->renderContent(Yii::t(Module::I18N_CATEGORY, 'Confirmation mail has been sent to {0}.', [$model->email])); } return $this->goHome(); } return $this->render($this->module->registerView, ['model' => $model]); }
public function actionChangePassword() { Yii::info("User is entering the change password page", __CLASS__); $model = Yii::createObject(Yii::$app->user->changePasswordForm); $model->scenario(); $event = Event::createModelEvent($model); $this->trigger(self::EVENT_BEFORE_CHANGE_PASSWORD, $event); if ($model->load(Yii::$app->request->post()) && $model->changePassword()) { $this->trigger(self::EVENT_AFTER_CHANGE_PASSWORD, $event); return $this->goBack(); } return $this->render($this->module->changePasswordView, ['model' => $model]); }