diff --git a/module/fid/src/Controller/UserController.php b/module/fid/src/Controller/UserController.php index 2e8d89f664e26f06036cca1126cc77fb048f42f7..7eb04a7da71cacdf802bfdbbe83e0ee5798ecb07 100644 --- a/module/fid/src/Controller/UserController.php +++ b/module/fid/src/Controller/UserController.php @@ -458,6 +458,12 @@ class UserController extends AbstractBase $form = $this->serviceLocator->get(PasswordResetModel::class); $forwarded = $this->params()->fromRoute('forwarded', false); + if($this->getUser()) { + $form->get('username')->setAttribute('disabled', 'true'); + $form->get('username')->setValue($this->client->requestUserDetails()->getUsername()); + $form->setValidationGroup(['submit']); + } + if ($submitted = $this->formWasSubmitted()) { $form->setData($request->getPost()); if (!$forwarded && $form->isValid()) { @@ -474,11 +480,15 @@ class UserController extends AbstractBase protected function sendResetPassword(Form $form) { - /** @var PasswordResetModel $model */ $messenger = $this->getMessenger(); - $model = $form->getHydrator()->hydrate( - $form->getData(), new PasswordResetModel()); - $username = $model->getUsername(); + if ($this->getUser()) { + $username = $this->client->requestUserDetails()->getUsername(); + } else { + /** @var PasswordResetModel $model */ + $model = $form->getHydrator()->hydrate( + $form->getData(), new PasswordResetModel()); + $username = $model->getUsername(); + } try { /** @noinspection PhpUndefinedFieldInspection */ diff --git a/themes/fid/languages/fid/de.ini b/themes/fid/languages/fid/de.ini index c6b2429f49a38d7e1e18ac1cd31d98d9af2f4986..9e3e16e570023de702f87ef9f4375039a72b6988 100644 --- a/themes/fid/languages/fid/de.ini +++ b/themes/fid/languages/fid/de.ini @@ -6,8 +6,10 @@ user_init_form_title = "Registrierung" user_create_form_title = "Registrierung abschließen" user_update_form_title = "Profildaten editieren." password_reset_form_title = "Passwort zurücksetzen" +password_reset_form_information = "Bitte geben Sie die E-Mail-Adresse ein, mit der Sie sich registriert haben. Wir senden Ihnen einen Link per E-Mail, über den Sie Ihr Passwort ändern können." password_change_form_title = "Neues Passwort speichern" username_change_form_title = "E-Mail-Adresse ändern" +username_change_form_information = "Bitte geben Sie Ihre neue E-Mail-Adresse ein. Wir senden Ihnen einen Link per E-Mail, über den Sie Ihre neue E-Mail-Adresse bestätigen müssen. Danach können Sie sich mit Ihrer neuen E-Mail-Adresse anmelden." label_username = "E-Mail-Adresse" label_newusername = "Neue E-Mail-Adresse" diff --git a/themes/fid/languages/fid/en.ini b/themes/fid/languages/fid/en.ini index d23b1f317e91a096bc6dc441f46aced014e8b296..45291196faabba6997c7f74c11b2270f9cfc5687 100644 --- a/themes/fid/languages/fid/en.ini +++ b/themes/fid/languages/fid/en.ini @@ -6,8 +6,10 @@ user_init_form_title = "Registration" user_create_form_title = "Complete registration" user_update_form_title = "Profile data" password_reset_form_title = "Reset password" +password_reset_form_information = "Please enter the e-mail address by which you registered your user account. We will send you a link to change your password." password_change_form_title = "Save new password" username_change_form_title = "Update email address" +username_change_form_information = "Please enter your new e-mail address. We will send you a link to confirm your new email address. Then you can login with your new e-mail address." label_username = "Email address" label_newusername = "New email address" diff --git a/themes/fid/templates/fid/user/password-reset.phtml b/themes/fid/templates/fid/user/password-reset.phtml index 3bf4994ed40108c5a67ae37625d5a333745c156f..02cb1122f8b6b725b91a335cc9131575041139ad 100644 --- a/themes/fid/templates/fid/user/password-reset.phtml +++ b/themes/fid/templates/fid/user/password-reset.phtml @@ -53,6 +53,7 @@ $this->headTitle($this->translate("fid::password_reset_form_title")); ?> <h2><?= $this->translate("fid::password_reset_form_title") ?></h2> <?= $this->flashmessages() ?> +<?= $this->translate("fid::password_reset_form_information") ?> <?= $this->form()->openTag($form) ?> <br/> <?php /* username */ ?> diff --git a/themes/fid/templates/fid/user/username-change.phtml b/themes/fid/templates/fid/user/username-change.phtml index 4d9f6945dfcb05cf80734001916971165d550969..80331a37350bed8bd9c2178bd8ffe066d0311e2e 100644 --- a/themes/fid/templates/fid/user/username-change.phtml +++ b/themes/fid/templates/fid/user/username-change.phtml @@ -54,12 +54,8 @@ $this->headTitle($this->translate("fid::username_change_form_title")); ?> <h2><?= $this->translate("fid::username_change_form_title") ?></h2> - -<div class="subito-pg"> - * <?=$this->transEsc("This field is required")?> -</div> - <?= $this->flashmessages() ?> +<?= $this->translate("fid::username_change_form_information") ?> <?= $this->form()->openTag($form) ?> <br/> <? /* username */ ?>