From f7b066a6b36b53e9afcfa2ac266a97e0717becd7 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Mon, 19 Sep 2022 12:42:44 +0200 Subject: [PATCH] check disable_activity.email_address_changed_by_admin when email is changed by admin via the OCS API Signed-off-by: Julien Veyssier --- apps/settings/lib/Hooks.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/settings/lib/Hooks.php b/apps/settings/lib/Hooks.php index b7b78c49b12..a5be30be53f 100644 --- a/apps/settings/lib/Hooks.php +++ b/apps/settings/lib/Hooks.php @@ -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; } -- 2.39.5