Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed information on resend password and recovery, related #856 #942

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 14 additions & 6 deletions models/RecoveryForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,22 @@ public function sendRecoveryMessage()
if (!$this->mailer->sendRecoveryMessage($user, $token)) {
return false;
}
}

\Yii::$app->session->setFlash(
'info',
\Yii::t('user', 'An email has been sent with instructions for resetting your password')
);
\Yii::$app->session->setFlash(
'info',
\Yii::t('user', 'An email has been sent with instructions for resetting your password')
);

return true;
} else {
\Yii::$app->session->setFlash(
'warning',
\Yii::t('user', 'Email could not been sent.')
);

return false;
}

return true;
}

/**
Expand Down
24 changes: 17 additions & 7 deletions models/ResendForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,25 @@ public function resend()
]);
$token->save(false);
$this->mailer->sendConfirmationMessage($user, $token);

\Yii::$app->session->setFlash(
'info',
\Yii::t(
'user',
'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.'
)
);
} else {
\Yii::$app->session->setFlash(
'warning',
\Yii::t(
'user',
'Could not send message to the given email address. Please register or resend password.'
)
);

}

\Yii::$app->session->setFlash(
'info',
\Yii::t(
'user',
'A message has been sent to your email address. It contains a confirmation link that you must click to complete registration.'
)
);

return true;
}
Expand Down