Ejemplo n.º 1
0
 /**
  * Send a new verification email to the user
  */
 public function actionResend()
 {
     $model = new ProfileForm();
     $model->load(Yii::app()->user->id);
     // If we don't have one on file, then someone the user got to a page they shouldn't have gotten to
     // Seamlessly redirect them back
     if ($model->getNewEmail() == NULL) {
         $this->redirect(Yii::app()->user->returnUrl);
     }
     if ($model->sendVerificationEmail()) {
         Yii::app()->user->setFlash('success', Yii::t('ciims.controllers.Profile', 'A new verification email has been resent to {{user}}. Please check your email address.', array('{{user}}' => $model->getNewEmail())));
     } else {
         Yii::app()->user->setFlash('error', Yii::t('ciims.controllers.Profile', 'There was an error resending the verification email. Please try again later.'));
     }
     $this->redirect($this->createUrl('profile/edit'));
 }