]> source.dussan.org Git - nextcloud-server.git/commitdiff
check disable_activity.email_address_changed_by_admin when email is changed by admin... 34600/head
authorJulien Veyssier <eneiluj@posteo.net>
Mon, 19 Sep 2022 10:42:44 +0000 (12:42 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Fri, 14 Oct 2022 09:24:01 +0000 (09:24 +0000)
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
apps/settings/lib/Hooks.php

index b7b78c49b121f495acee4cd995255aad300b7cda..a5be30be53f3080b0a2f496e12fe1d9046c5a40c 100644 (file)
@@ -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;
                        }