public function actionResetPassword($token) { if ($model = SetPass::findByPasswordResetToken($token)) { if ($model->load(Yii::$app->request->post()) && $model->save()) { Yii::$app->session->setFlash("notification", Yii::t("app", "Your have recovered your password. Now you can login")); return $this->goHome(); } return $this->render("setpassword", ["model" => $model]); } else { Yii::$app->session->setFlash("Home-error", Yii::t("app", "Password Recovery Toekn expired!")); return $this->goHome(); } }
public function actionSetpassword($id) { if (($model = SetPass::findOne($id)) !== null) { } else { throw new NotFoundHttpException('The requested page does not exist.'); } if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->Id]); } else { return $this->render('setPass', ['model' => $model]); } }