-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
don't blame randome people for background email updates #10687
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,6 +165,7 @@ public function onChangeEmail(IUser $user, $oldMailAddress) { | |
|
||
$actor = $this->userSession->getUser(); | ||
if ($actor instanceof IUser) { | ||
$subject = Provider::EMAIL_CHANGED_SELF; | ||
if ($actor->getUID() !== $user->getUID()) { | ||
$this->l = $this->languageFactory->get( | ||
'settings', | ||
|
@@ -173,15 +174,11 @@ public function onChangeEmail(IUser $user, $oldMailAddress) { | |
$this->config->getSystemValue('default_language', 'en') | ||
) | ||
); | ||
|
||
$text = $this->l->t('%1$s changed your email address on %2$s.', [$actor->getDisplayName(), $instanceUrl]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My guess is this case was there to notify you if an admin changed your e-mail... right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, that's further below. Though i don't know what that works at it checks the user who is logged in. But it works. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The one below is for the CLI change. That one here is for all web based accesses. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was for admin cases where its done via the UI. So you know whome to contact if someone changes your details. The admin strings below are for not logged in users, aka CLI commands. |
||
$event->setAuthor($actor->getUID()) | ||
->setSubject(Provider::EMAIL_CHANGED_BY, [$actor->getUID()]); | ||
} else { | ||
$text = $this->l->t('Your email address on %s was changed.', [$instanceUrl]); | ||
$event->setAuthor($actor->getUID()) | ||
->setSubject(Provider::EMAIL_CHANGED_SELF); | ||
$subject = Provider::EMAIL_CHANGED; | ||
} | ||
$text = $this->l->t('Your email address on %s was changed.', [$instanceUrl]); | ||
$event->setAuthor($actor->getUID()) | ||
->setSubject($subject); | ||
} else { | ||
$text = $this->l->t('Your email address on %s was changed by an administrator.', [$instanceUrl]); | ||
$event->setSubject(Provider::EMAIL_CHANGED); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just hardening right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and avoiding an uneccesary request to LDAP