Skip to content

Commit 60a91b4

Browse files
Julien Veyssierjulien-nc
Julien Veyssier
authored andcommitted
check disable_activity.email_address_changed_by_admin when email is changed by admin via the OCS API
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
1 parent c63f61d commit 60a91b4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apps/settings/lib/Hooks.php

+5
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,17 @@ public function onChangeEmail(IUser $user, $oldMailAddress) {
178178
if ($actor instanceof IUser) {
179179
$subject = Provider::EMAIL_CHANGED_SELF;
180180
if ($actor->getUID() !== $user->getUID()) {
181+
// set via the OCS API
182+
if ($this->config->getAppValue('settings', 'disable_activity.email_address_changed_by_admin', 'no') === 'yes') {
183+
return;
184+
}
181185
$subject = Provider::EMAIL_CHANGED;
182186
}
183187
$text = $l->t('Your email address on %s was changed.', [$instanceUrl]);
184188
$event->setAuthor($actor->getUID())
185189
->setSubject($subject);
186190
} else {
191+
// set with occ
187192
if ($this->config->getAppValue('settings', 'disable_activity.email_address_changed_by_admin', 'no') === 'yes') {
188193
return;
189194
}

0 commit comments

Comments
 (0)