Skip to content

Commit

Permalink
SW-19822 - Improve error message when account could not be found
Browse files Browse the repository at this point in the history
  • Loading branch information
soebbing committed Sep 22, 2017
1 parent c5a92e8 commit 71c1892
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions engine/Shopware/Controllers/Frontend/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,14 @@ private function getCustomerByResetHash($hash)
}

/** @var $customer Customer */
$customer = $this->get('models')->find('Shopware\Models\Customer\Customer', $confirmModel->getData());
$customer = $this->get('models')->find(\Shopware\Models\Customer\Customer::class, $confirmModel->getData());
if (!$customer) {
throw new Exception(sprintf($resetPasswordNamespace->get(
'PasswordResetNewMissingId',
'Could not find the user with the ID "%s".'
), $confirmModel->getData()));
throw new Exception(
$resetPasswordNamespace->get(
'PasswordResetNewMissingId',
'Your account could not be found. Please contact us to fix this problem.'
)
);
}

return $customer;
Expand Down
6 changes: 3 additions & 3 deletions snippets/frontend/account/reset_password.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
PasswordResetNewHeadline = "Specify a new passowrd"
PasswordResetNewHelpText = "If you have forgotten your account's password, you can now set a new one. Once you save your new password, your old password will no longer be valid"
PasswordResetNewLinkError = "Confirmation link not found. Note that the confirmation link is only valid for 2 hours. After that you have to request a new confirmation link."
PasswordResetNewMissingId = "Could not find the user with the ID \"%s\"."
PasswordResetNewMissingId = "Your account could not be found. Please contact us to fix this problem."
PasswordResetNewSuccess = "Your password has been changed successfully."

[de_DE]
PasswordResetNewHeadline = "Ein neues Passwort definieren"
PasswordResetNewHelpText = "Wenn Sie das Passwort für Ihr Konto vergessen haben, können Sie hier ein neues definieren. Wenn Sie das neue Passwort speichern, wird Ihr altes Passwort ungültig."
PasswordResetNewLinkError = "Bestätigungslink nicht gefunden. Bedenken Sie, dass der Bestätigungslink nur 2 Stunden gültig ist. Danach müssen Sie sich einen neuen Bestätigungslink zusenden lassen."
PasswordResetNewMissingId = "Konnte den Benutzer mit der ID \"%s\" nicht finden."
PasswordResetNewSuccess = "Ihr Passwort wurde erfolgreich geändert."
PasswordResetNewMissingId = "Ihr Kundenkonto konnte nicht gefunden werden, bitte kontaktieren Sie uns, um dieses Problem zu lösen."
PasswordResetNewSuccess = "Ihr Passwort wurde erfolgreich geändert."

0 comments on commit 71c1892

Please sign in to comment.