Skip to content
Snippets Groups Projects
Commit ac2367fc authored by Rasmus Fuhse's avatar Rasmus Fuhse Committed by David Siegfried
Browse files

Draft: Resolve "Neues-Passwort-Mail ist falsch"

Closes #4368

Merge request studip/studip!3166
parent c8d06fae
Branches
No related tags found
No related merge requests found
...@@ -41,8 +41,10 @@ class NewPasswordController extends StudipController ...@@ -41,8 +41,10 @@ class NewPasswordController extends StudipController
$users = User::findByEmail(Request::get('mail')); $users = User::findByEmail(Request::get('mail'));
if (count($users) === 1) {
$user = $users[0]; $user = $users[0];
setTempLanguage($user->id); } else if (count($users) > 1) {
setTempLanguage($users[0]->id);
// there are mutliple accounts with this mail addresses! // there are mutliple accounts with this mail addresses!
$subject = sprintf( $subject = sprintf(
...@@ -64,9 +66,11 @@ class NewPasswordController extends StudipController ...@@ -64,9 +66,11 @@ class NewPasswordController extends StudipController
$GLOBALS['UNI_CONTACT'] $GLOBALS['UNI_CONTACT']
); );
StudipMail::sendMessage($user->email, $subject, $mailbody); StudipMail::sendMessage($users[0]->email, $subject, $mailbody);
restoreLanguage(); restoreLanguage();
}
if ($user) { if ($user) {
// spam/abuse-protection // spam/abuse-protection
// if there are more than 5 tokens present, do NOT send another mail // if there are more than 5 tokens present, do NOT send another mail
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment