public function actionForgot() { $model = new ForgotForm(); if (isset($_POST['ForgotForm'])) { $model->attributes = $_POST['ForgotForm']; if ($model->validate() && $model->forgot()) { $this->render('forgotok', array('model' => $model)); exit; } } $this->_pageTitle = '找回密码' . API::lchart(); $this->render('forgot', array('model' => $model)); }
/** * Handles resetting a users password should they forgot it */ public function actionForgot() { $this->layout = '//layouts/main'; $this->setPageTitle(Yii::t('ciims.controllers.Site', '{{app_name}} | {{label}}', array('{{app_name}}' => Cii::getConfig('name', Yii::app()->name), '{{label}}' => Yii::t('ciims.controllers.Site', 'Forgot Your Password?')))); $model = new ForgotForm(); if (Cii::get($_POST, 'ForgotForm', false)) { $model->attributes = $_POST['ForgotForm']; if ($model->initPasswordResetProcess()) { Yii::app()->user->setFlash('success', Yii::t('ciims.controllers.Site', 'A password reset link has been sent to your email address')); $this->redirect($this->createUrl('site/login')); } } $this->render('forgot', array('model' => $model)); }
public function actionForgot() { $sended = null; $model = new ForgotForm(); if (isset($_POST['ForgotForm'])) { $model->setAttributes($_POST['ForgotForm']); if ($model->validate()) { Mailer::sendForgotMail($model->email); $sended = true; } else { $sended = false; } } $this->render('forgot', array('sended' => $sended, 'model' => $model)); }
public function actionForgot() { $form = new ForgotForm(); if (isset($_POST['ForgotForm'])) { $form->attributes = $_POST['ForgotForm']; if ($form->save()) { $this->render('forgot_success'); Yii::app()->end(); } } $this->render('forgot', array('forgotform' => $form)); }
public function actionForgot() { $model = new ForgotForm(); if (isset($_POST['ForgotForm'])) { $model->attributes = $_POST['ForgotForm']; if ($model->validate() && $model->forgot()) { $this->redirect(array('admin/category/iroot')); } } $this->render('forgot', array('model' => $model)); }