本文整理汇总了PHP中frontend\models\PasswordResetRequestForm::load方法的典型用法代码示例。如果您正苦于以下问题:PHP PasswordResetRequestForm::load方法的具体用法?PHP PasswordResetRequestForm::load怎么用?PHP PasswordResetRequestForm::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类frontend\models\PasswordResetRequestForm
的用法示例。
在下文中一共展示了PasswordResetRequestForm::load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionLogin
public function actionLogin()
{
if (!\Yii::$app->user->isGuest) {
return $this->goHome();
}
$this->layout = 'login';
$model = new LoginForm();
$passResetModel = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post()) && $model->login()) {
return $this->goBack();
} else {
if ($passResetModel->load(Yii::$app->request->post()) && $passResetModel->validate()) {
/*Yii::$app->mailer->compose()
->setFrom('test@gmail.com')
->setTo('trantor.php@gmail.com')
->setSubject('Email sent from Yii2-Swiftmailer')
->setTextBody('asdfasdasd')
->send();*/
if ($passResetModel->sendEmail()) {
Yii::$app->getSession()->setFlash('success', 'Check your email for further instructions.');
return $this->goHome();
} else {
Yii::$app->getSession()->setFlash('error', 'Sorry, we are unable to reset password for email provided.');
return $this->goBack();
}
} else {
return $this->render('login', ['model' => $model, 'passResetModel' => $passResetModel]);
}
}
}
示例2: actionRequestPasswordReset
public function actionRequestPasswordReset()
{
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail()) {
Yii::$app->getSession()->setFlash('success', 'Check your email for further instructions.');
return $this->goHome();
} else {
Yii::$app->getSession()->setFlash('error', 'Sorry, we are unable to reset password for email provided.');
}
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例3: actionRequestPasswordReset
/**
* Requests password reset.
*
* @return mixed
*/
public function actionRequestPasswordReset()
{
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail()) {
Yii::$app->session->setFlash('success', 'Данные для восстановления отправлены на Ваш E-mail');
return $this->goHome();
} else {
Yii::$app->session->setFlash('error', 'К сожалению, такой адрес не существует');
}
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例4: actionRequestPasswordReset
public function actionRequestPasswordReset()
{
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail()) {
Yii::$app->getSession()->setFlash('resultSentMail', 'Проверьте ваш Email для дальнейших инструкций.');
return $this->redirect(Yii::$app->request->referrer);
//return $this->goHome();
} else {
Yii::$app->getSession()->setFlash('resultSentMail', 'Мы не смогли обновить пароль для вашего Email.');
}
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例5: actionRequestPasswordReset
public function actionRequestPasswordReset()
{
$this->title = '找回密码' . ' - ' . Yii::$app->name;
$this->description = '';
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail()) {
Yii::$app->getSession()->setFlash('success', '邮件发送成功!请检查您的电子邮箱以获得进一步操作说明。');
return $this->goHome();
} else {
Yii::$app->getSession()->setFlash('error', '很抱歉,我们无法提供密码重置邮件。');
}
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例6: actionRequestpassword
/**
* Requests password reset.
*
* @return mixed
*/
public function actionRequestpassword()
{
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post())) {
if (User::findByUsername($model->email)) {
$model->email = User::findByUsername($model->email)->email;
}
if ($model->validate()) {
if ($model->sendEmail()) {
Yii::$app->session->setFlash('success', 'Check your email for further instructions.');
echo 1;
// return $this->goHome();
} else {
Yii::$app->session->setFlash('error', 'Sorry, we are unable to reset password for email provided.');
echo 2;
}
} else {
return false;
}
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例7: actionRequestPasswordReset
/**
* Requests password reset.
*
* @return mixed
*/
public function actionRequestPasswordReset()
{
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail()) {
Yii::$app->session->addFlash('success', Yii::t('frontend', 'Check your email for further instructions.'));
return $this->goHome();
} else {
Yii::$app->session->addFlash('error', Yii::t('frontend', 'Sorry, we are unable to send reset password email. Please contact site administrator for more details.'));
}
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例8: actionRequestPasswordReset
/**
* Requests password reset.
*
* @return mixed
*/
public function actionRequestPasswordReset()
{
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail()) {
Yii::$app->session->setFlash('success', Yii::t('app', 'RESET_PASSWORD_CHECK_MAIL_INSTRUCTIONS'));
return $this->goHome();
} else {
Yii::$app->session->setFlash('error', Yii::t('app', 'ERROR_SEND_EMAIL'));
}
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例9: actionRequestPasswordReset
/**
* Requests password reset.
*
* @return mixed
*/
public function actionRequestPasswordReset()
{
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post())) {
if ($model->sendEmail()) {
Yii::$app->session->setFlash('success', I18n::t('Your password reset request submitted successfully'));
return $this->goHome();
} else {
Yii::$app->session->setFlash('error', I18n::t('Unable to reset password for email provided') . '. ' . I18n::t('Please try again'));
}
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例10: actionRequestPasswordReset
public function actionRequestPasswordReset()
{
$this->layout = 'login';
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail()) {
Yii::$app->getSession()->setFlash('success', Yii::t('app', 'Проверьте вашу электронную почту для получения дальнейших инструкций.'));
return $this->goHome();
} else {
Yii::$app->getSession()->setFlash('error', Yii::t('app', 'К сожалению, мы не в состоянии сбросить пароль. Пожалуйста попробуйте позже... Если проблема будет повторятся, обратитесь в службу поддержки.'));
}
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例11: actionRequestPasswordReset
/**
* Requests password reset.
*
* @return mixed
*/
public function actionRequestPasswordReset()
{
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail()) {
// Yii::$app->session->setFlash('success', 'Check your email for further instructions.');
// return $this->goHome();
$info = "<div class='card'>我们给你的邮箱 <strong>" . $model->email . "</strong> 发送一封,请查收邮件,按邮件提示修改密码</div>";
} else {
$info = "<div class='card'>我们给你的邮箱 <strong>" . $model->email . "</strong> 发送修改密码的邮件失败,请检查邮箱是否正确,或者换一个邮箱</div>";
// Yii::$app->session->setFlash('error', 'Sorry, we are unable to reset password for email provided.');
}
return $this->renderContent($info);
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例12: actionRequestPasswordReset
public function actionRequestPasswordReset()
{
if (!Yii::$app->request->isAjax) {
return $this->goHome();
}
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post())) {
if (Yii::$app->request->isAjax) {
Yii::$app->response->format = Response::FORMAT_JSON;
$erros = ActiveForm::validate($model);
if (!empty($erros)) {
return $erros;
}
if (!Yii::$app->request->post('send')) {
return $erros;
}
if (!$model->sendEmail()) {
$erros = [Html::getInputId($model, 'email') => [0 => "Не удалось отправить письмо."]];
return $erros;
} else {
Yii::$app->response->statusText = 'send=' . Url::toRoute(['site/request-password-reset-notify']);
Yii::$app->response->send();
}
}
}
return $this->renderAjax('requestPasswordResetToken', ['model' => $model]);
}
示例13: actionRequestPasswordReset
/**
* Requests password reset.
*
* @return mixed
*/
public function actionRequestPasswordReset()
{
$this->view->registerCssFile('/css/shortPage.css');
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail()) {
Yii::$app->session->setFlash('success', 'Проверьте почиовый ящик и следуйте инструкциям.');
return $this->goHome();
} else {
Yii::$app->session->setFlash('error', 'Извините, мы не смогли отправить Вам письмо с новым паролем.');
}
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例14: actionRequestPasswordReset
/**
* Requests password reset.
*
* @return mixed
*/
public function actionRequestPasswordReset()
{
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail()) {
Yii::$app->session->setFlash('success', Lang::t('page/siteLogin', 'reset1Success'));
return $this->goHome();
} else {
Yii::$app->session->setFlash('error', Lang::t('page/siteLogin', 'reset1Error'));
}
}
return $this->render('requestPasswordResetToken', ['model' => $model]);
}
示例15: actionRequestPasswordReset
public function actionRequestPasswordReset()
{
$model = new PasswordResetRequestForm();
if ($model->load(Yii::$app->request->post())) {
if ($model->success == 'true') {
Yii::$app->getSession()->setFlash('success', ['type' => 'success', 'duration' => 5000, 'icon' => 'glyphicon glyphicon-envelope', 'message' => $model->message, 'title' => 'Reestablecer contraseña', 'positonY' => 'top', 'positonX' => 'center']);
return $this->goHome();
} else {
Yii::$app->getSession()->setFlash('danger', ['type' => 'danger', 'duration' => 5000, 'icon' => 'glyphicon glyphicon-exclamation-sign', 'message' => $model->message, 'title' => 'Reestablecer contraseña', 'positonY' => 'top', 'positonX' => 'center']);
return $this->goHome();
}
}
return $this->renderAjax('requestPasswordResetToken', ['model' => $model]);
}