You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
htmlspecialchars($this->l10n->t('Click the following button to reset your password. If you have not requested the password reset, then ignore this email.')),
350
-
$this->l10n->t('Click the following link to reset your password. If you have not requested the password reset, then ignore this email.')
351
-
);
454
+
$emailTemplate->addBodyText(
455
+
htmlspecialchars($this->l10n->t('Click the following button to reset your password. If you have not requested the password reset, then ignore this email.')),
456
+
$this->l10n->t('Click the following link to reset your password. If you have not requested the password reset, then ignore this email.')
457
+
);
352
458
353
-
$emailTemplate->addBodyButton(
354
-
htmlspecialchars($this->l10n->t('Reset your password')),
355
-
$link,
356
-
false
357
-
);
358
-
$emailTemplate->addFooter();
459
+
$emailTemplate->addBodyButton(
460
+
htmlspecialchars($this->l10n->t('Reset your password')),
461
+
$link,
462
+
false
463
+
);
464
+
} elseif($action == 'NEW'){
465
+
$emailTemplate->setSubject($this->l10n->t('%s activate and choose a password', [$this->defaults->getName()]));
466
+
$emailTemplate->addHeader();
467
+
$emailTemplate->addHeading($this->l10n->t('Activate and choose a password'));
468
+
469
+
$emailTemplate->addBodyText(
470
+
htmlspecialchars($this->l10n->t('Click the following button to activate and choose a new password. If you have not requested the new password, then ignore this email.')),
471
+
$this->l10n->t('Click the following link to activate and choose a new password. If you have not requested the new password, then ignore this email.')
472
+
);
473
+
474
+
$emailTemplate->addBodyButton(
475
+
htmlspecialchars($this->l10n->t('Activate and choose your new password')),
476
+
$link,
477
+
false
478
+
);
479
+
480
+
} else {
481
+
thrownew \Exception($this->l10n->t(
482
+
'Couldn\'t send reset email. Please contact your administrator.'
483
+
));
484
+
}
359
485
486
+
$emailTemplate->addFooter();
360
487
try {
361
488
$message = $this->mailer->createMessage();
362
489
$message->setTo([$email => $user->getUID()]);
@@ -394,9 +521,37 @@ protected function findUserByIdOrMail($input) {
394
521
});
395
522
396
523
if (\count($users) === 1) {
397
-
return$users[0];
524
+
return$users[1];
398
525
}
399
526
400
527
throw$userNotFound;
401
528
}
529
+
530
+
/**
531
+
* Sets the password reset params.
532
+
*
533
+
* Users may not change their passwords if:
534
+
* - The account is disabled
535
+
* - The backend doesn't support password resets
536
+
* - The password reset function is disabled
537
+
*
538
+
* @param IUser $userObj
539
+
* @param array $parameters
540
+
* @return array
541
+
*/
542
+
protectedfunctionsetPasswordResetParameters(
543
+
$userObj = null, array$parameters): array {
544
+
545
+
if ($parameters['resetPasswordLink'] === 'disabled') {
0 commit comments