diff --git a/controllers/RecoveryController.php b/controllers/RecoveryController.php index e102dfd7a..b3f2abc77 100644 --- a/controllers/RecoveryController.php +++ b/controllers/RecoveryController.php @@ -120,10 +120,7 @@ public function actionRequest() if ($model->load(\Yii::$app->request->post()) && $model->sendRecoveryMessage()) { $this->trigger(self::EVENT_AFTER_REQUEST, $event); - return $this->render('/message', [ - 'title' => \Yii::t('user', 'Recovery message sent'), - 'module' => $this->module, - ]); + return $this->render('request_sent'); } return $this->render('request', [ @@ -153,15 +150,12 @@ public function actionReset($id, $code) $this->trigger(self::EVENT_BEFORE_TOKEN_VALIDATE, $event); if ($token === null || $token->isExpired || $token->user === null) { - $this->trigger(self::EVENT_AFTER_TOKEN_VALIDATE, $event); - \Yii::$app->session->setFlash( - 'danger', - \Yii::t('user', 'Recovery link is invalid or expired. Please try requesting a new one.') - ); - return $this->render('/message', [ - 'title' => \Yii::t('user', 'Invalid or expired link'), - 'module' => $this->module, - ]); + $this->trigger(self::EVENT_AFTER_TOKEN_VALIDATE, $event); + \Yii::$app->session->setFlash( + 'danger', + \Yii::t('user', 'Recovery link is invalid or expired. Please try requesting a new one.') + ); + return $this->render('link_invalid'); } /** @var RecoveryForm $model */ @@ -176,10 +170,7 @@ public function actionReset($id, $code) if ($model->load(\Yii::$app->getRequest()->post()) && $model->resetPassword($token)) { $this->trigger(self::EVENT_AFTER_RESET, $event); - return $this->render('/message', [ - 'title' => \Yii::t('user', 'Password has been changed'), - 'module' => $this->module, - ]); + return $this->render('password_change_success'); } return $this->render('reset', [ diff --git a/controllers/RegistrationController.php b/controllers/RegistrationController.php index 898c635b5..f70b690dc 100644 --- a/controllers/RegistrationController.php +++ b/controllers/RegistrationController.php @@ -136,10 +136,7 @@ public function actionRegister() if ($model->load(\Yii::$app->request->post()) && $model->register()) { $this->trigger(self::EVENT_AFTER_REGISTER, $event); - return $this->render('/message', [ - 'title' => \Yii::t('user', 'Your account has been created'), - 'module' => $this->module, - ]); + return $this->render('register_success'); } return $this->render('register', [ diff --git a/messages/de/user.php b/messages/de/user.php index 8875e24d2..cd8b0675c 100644 --- a/messages/de/user.php +++ b/messages/de/user.php @@ -30,13 +30,15 @@ 'Account details' => 'Kontodetails', 'Account details have been updated' => 'Kontodetails wurden gespeichert', 'Account settings' => 'Kontoeinstellungen', - 'An email has been sent with instructions for resetting your password' => 'Eine E-Mail mit weiteren Instruktionen, um Ihr Passwort zurück zu setzen, wurde gesendet.', + 'An email has been sent with instructions for resetting your password' => 'Wir haben Ihnen eine E-Mail geschickt, um ein neues Passwort vergeben zu können', + 'Please follow the instructions to change your password' => 'Bitte öffnen Sie Ihr E-Mail-Postfach und folgen Sie der beschriebenen Vorgehensweise, um Ihr Passwort zurückzusetzen', 'An error occurred and your password has not been changed. Please try again later.' => 'Es ist ein Problem aufgetreten. Ihr Passwort wurde nicht verändert. Bitte versuchen Sie es später noch einmal.', 'An error occurred processing your request' => 'Ein Fehler ist aufgetreten', 'Assignments' => 'Zuordnungen', 'Are you sure you want to switch to this user for the rest of this Session?' => 'Sind Sie sicher, dass sie für den Rest der Sitzung zu diesem Benutzer wechseln möchten?', 'Awesome, almost there. Now you need to click the confirmation link sent to your new email address' => 'Fast geschafft. Nun müssen Sie nur noch den Aktivierungslink besuchen, der an ihre neue E-Mail Adresse gesendet wurde', 'Awesome, almost there. Now you need to click the confirmation link sent to your old email address' => 'Fast geschafft. Nun müssen Sie nur noch den Aktivierungslink besuchen, der an ihre alte E-Mail Adresse gesendet wurde', + 'Back to Login' => 'Zurück zur Anmeldung', 'Become this user' => 'Zu diesem Nutzer wechseln', 'Complete password reset on {0}' => 'Passwort komplett zurücksetzen auf {0}', 'Confirm account on {0}' => 'Passwort bestätigen auf {0}', diff --git a/models/RecoveryForm.php b/models/RecoveryForm.php index f5a1b3b38..8436fce7a 100644 --- a/models/RecoveryForm.php +++ b/models/RecoveryForm.php @@ -35,6 +35,11 @@ class RecoveryForm extends Model */ public $password; + /** + * @var string + */ + public $password_confirmation; + /** * @var Mailer */ @@ -65,6 +70,7 @@ public function attributeLabels() return [ 'email' => \Yii::t('user', 'Email'), 'password' => \Yii::t('user', 'Password'), + 'password_confirmation' => \Yii::t('user', 'Password confirmation'), ]; } @@ -89,6 +95,7 @@ public function rules() 'emailRequired' => ['email', 'required'], 'emailPattern' => ['email', 'email'], 'passwordRequired' => ['password', 'required'], + 'newPasswordConfirmation' => ['password_confirmation', 'compare', 'compareAttribute' => 'password'], 'passwordLength' => ['password', 'string', 'max' => 72, 'min' => 6], ]; } diff --git a/views/recovery/password_change_success.php b/views/recovery/password_change_success.php new file mode 100644 index 000000000..6737cfe84 --- /dev/null +++ b/views/recovery/password_change_success.php @@ -0,0 +1 @@ + diff --git a/views/recovery/recovery_token_invalid.php b/views/recovery/recovery_token_invalid.php new file mode 100644 index 000000000..2f9e3c197 --- /dev/null +++ b/views/recovery/recovery_token_invalid.php @@ -0,0 +1,6 @@ + + + + +

'btn btn-primary']); ?>

+ diff --git a/views/recovery/request_sent.php b/views/recovery/request_sent.php new file mode 100644 index 000000000..efe5c667f --- /dev/null +++ b/views/recovery/request_sent.php @@ -0,0 +1,7 @@ + + +

.

+ +

.

+ +

'btn btn-primary']); ?>

diff --git a/views/registration/register_success.php b/views/registration/register_success.php new file mode 100644 index 000000000..29d670793 --- /dev/null +++ b/views/registration/register_success.php @@ -0,0 +1 @@ +.