/** * Recover Password Action * * @todo check local auth_mode */ public function actionRecoverPassword() { $model = new AccountRecoverPasswordForm(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['AccountRecoverPasswordForm'])) { $_POST['AccountRecoverPasswordForm'] = Yii::app()->input->stripClean($_POST['AccountRecoverPasswordForm']); $model->attributes = $_POST['AccountRecoverPasswordForm']; if ($model->validate()) { // Force new Captcha Code Yii::app()->getController()->createAction('captcha')->getVerifyCode(true); $model->recoverPassword(); $this->render('recoverPassword_success', array('model' => $model)); return; } } $this->render('recoverPassword', array('model' => $model)); }
/** * Recover Password Action * Generates an password reset token and sends an e-mail to the user. */ public function actionRecoverPassword() { $model = new AccountRecoverPasswordForm(); if (isset($_POST['AccountRecoverPasswordForm'])) { $model->attributes = $_POST['AccountRecoverPasswordForm']; if ($model->validate()) { // Force new Captcha Code Yii::app()->getController()->createAction('captcha')->getVerifyCode(true); $model->recoverPassword(); if (Yii::app()->request->isAjaxRequest) { $this->renderPartial('recoverPassword_modal_success', array('model' => $model), false, true); } else { $this->render('recoverPassword_success', array('model' => $model)); } return; } } if (Yii::app()->request->isAjaxRequest) { $this->renderPartial('recoverPassword_modal', array('model' => $model), false, true); } else { $this->render('recoverPassword', array('model' => $model)); } }