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>
pull/34135/head
Julien Veyssier 2 years ago committed by Julien Veyssier
parent f49ccd140f
commit 08a77315b4
No known key found for this signature in database
GPG Key ID: 4141FEE162030638

@ -178,12 +178,17 @@ class Hooks {
if ($actor instanceof IUser) {
$subject = Provider::EMAIL_CHANGED_SELF;
if ($actor->getUID() !== $user->getUID()) {
// set via the OCS API
if ($this->config->getAppValue('settings', 'disable_activity.email_address_changed_by_admin', 'no') === 'yes') {
return;
}
$subject = Provider::EMAIL_CHANGED;
}
$text = $l->t('Your email address on %s was changed.', [$instanceUrl]);
$event->setAuthor($actor->getUID())
->setSubject($subject);
} else {
// set with occ
if ($this->config->getAppValue('settings', 'disable_activity.email_address_changed_by_admin', 'no') === 'yes') {
return;
}

Loading…
Cancel
Save