/** * Change Current Password * */ public function actionChangeEmail() { if (!Yii::$app->user->canChangeEmail()) { throw new HttpException(500, 'Change E-Mail is not allowed'); } $model = new \humhub\modules\user\models\forms\AccountChangeEmail(); if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->sendChangeEmail()) { return $this->render('changeEmail_success', array('model' => $model)); } return $this->render('changeEmail', array('model' => $model)); }
/** * Change Current Password * */ public function actionChangeEmail() { $user = Yii::$app->user->getIdentity(); if ($user->auth_mode != User::AUTH_MODE_LOCAL) { throw new CHttpException(500, Yii::t('UserModule.controllers_AccountController', 'You cannot change your e-mail address here.')); } $model = new \humhub\modules\user\models\forms\AccountChangeEmail(); if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->sendChangeEmail()) { return $this->render('changeEmail_success', array('model' => $model)); } return $this->render('changeEmail', array('model' => $model)); }