From 60a210c6274edf1deaa77447e91b1a3782b05c59 Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 5 Jul 2022 20:30:37 +0530 Subject: [PATCH 1/5] Added occ user setting patch to trigger change event if change in quota or recovery email --- Dockerfile | 1 + patches/019-occ-user-setting.patch | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 patches/019-occ-user-setting.patch diff --git a/Dockerfile b/Dockerfile index c5b00c3c..2c7a5f14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -128,6 +128,7 @@ RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/015-email-mail-template.patch RUN patch -u ${BASE_DIR}/core/templates/layout.guest.php -i ${TMP_PATCH_DIR}/016-login-screen.patch RUN patch -u ${BASE_DIR}/lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php -i ${TMP_PATCH_DIR}/017-storage-wrapper.patch RUN patch -u ${BASE_DIR}/core/templates/layout.user.php -i ${TMP_PATCH_DIR}/018-login-favicon.patch +RUN patch -u ${BASE_DIR}/core/Command/User/Setting.php -i ${TMP_PATCH_DIR}/019-occ-user-setting.patch RUN rm -rf ${TMP_PATCH_DIR} # autocomplete leak tweak apps frontend with sed, disable group suggestion diff --git a/patches/019-occ-user-setting.patch b/patches/019-occ-user-setting.patch new file mode 100644 index 00000000..32e4ff56 --- /dev/null +++ b/patches/019-occ-user-setting.patch @@ -0,0 +1,23 @@ +--- Setting.php 2022-07-05 14:53:54.093230637 +0530 ++++ Setting-new.php 2022-07-05 19:16:16.517558999 +0530 +@@ -34,6 +34,8 @@ + use Symfony\Component\Console\Input\InputInterface; + use Symfony\Component\Console\Input\InputOption; + use Symfony\Component\Console\Output\OutputInterface; ++use OCP\EventDispatcher\IEventDispatcher; ++use OCP\User\Events\UserChangedEvent; + + class Setting extends Base { + /** @var IUserManager */ +@@ -201,6 +203,11 @@ + } + + $this->config->setUserValue($uid, $app, $key, $input->getArgument('value')); ++ $user = $this->userManager->get($uid); ++ $eventDispatcher = \OC::$server->get(IEventDispatcher::class); ++ if (($app === 'files' && $key === 'quota') || ($app === 'email-recovery' && $key === 'recovery-email')) { ++ $eventDispatcher->dispatchTyped(new UserChangedEvent($uid, $key, $input->getArgument('value'), $value)); ++ } + return 0; + } elseif ($input->hasParameterOption('--delete')) { + if ($input->hasParameterOption('--error-if-not-exists') && $value === null) { -- GitLab From 7897617203bedb76c079916d36ef8041027b04be Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 5 Jul 2022 21:04:18 +0530 Subject: [PATCH 2/5] Add explanation for patch --- Dockerfile | 2 +- patches/019-occ-user-setting.patch | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2c7a5f14..1e27150c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="318040" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,8,1/22,2,8,24/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,8,1/22,2,8,25/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images diff --git a/patches/019-occ-user-setting.patch b/patches/019-occ-user-setting.patch index 32e4ff56..7a9f5da8 100644 --- a/patches/019-occ-user-setting.patch +++ b/patches/019-occ-user-setting.patch @@ -1,5 +1,11 @@ ---- Setting.php 2022-07-05 14:53:54.093230637 +0530 -+++ Setting-new.php 2022-07-05 19:16:16.517558999 +0530 +From: Akhil +Date: Tue, 05 Jul 2022 19:20 +0530 +Subject: [PATCH] Triggers user changed event when quota is updated via occ command + +This patch triggers a user changed event when quota is updated via the occ command + +--- ./core/Command/User/Setting.php 2022-07-05 14:53:54.093230637 +0530 ++++ ./core/Command/User/Setting-new.php 2022-07-05 19:16:16.517558999 +0530 @@ -34,6 +34,8 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; -- GitLab From 8b790f09e4ddf7f4de8e524758a263d5104495e8 Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 5 Jul 2022 21:25:20 +0530 Subject: [PATCH 3/5] Pass $user and not $uid --- patches/019-occ-user-setting.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/019-occ-user-setting.patch b/patches/019-occ-user-setting.patch index 7a9f5da8..4b630e02 100644 --- a/patches/019-occ-user-setting.patch +++ b/patches/019-occ-user-setting.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Triggers user changed event when quota is updated via occ comma This patch triggers a user changed event when quota is updated via the occ command --- ./core/Command/User/Setting.php 2022-07-05 14:53:54.093230637 +0530 -+++ ./core/Command/User/Setting-new.php 2022-07-05 19:16:16.517558999 +0530 ++++ ./core/Command/User/Setting-new.php 2022-07-05 21:24:11.654134876 +0530 @@ -34,6 +34,8 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -22,7 +22,7 @@ This patch triggers a user changed event when quota is updated via the occ comma + $user = $this->userManager->get($uid); + $eventDispatcher = \OC::$server->get(IEventDispatcher::class); + if (($app === 'files' && $key === 'quota') || ($app === 'email-recovery' && $key === 'recovery-email')) { -+ $eventDispatcher->dispatchTyped(new UserChangedEvent($uid, $key, $input->getArgument('value'), $value)); ++ $eventDispatcher->dispatchTyped(new UserChangedEvent($user, $key, $input->getArgument('value'), $value)); + } return 0; } elseif ($input->hasParameterOption('--delete')) { -- GitLab From e483dc3beae2508a30a7478ac2cfbe6cdb7d98fe Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 6 Jul 2022 14:34:53 +0530 Subject: [PATCH 4/5] Move $user and $eventDispatcher into the if --- Dockerfile | 2 +- patches/019-occ-user-setting.patch | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e27150c..52f1c18c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ ARG ECLOUD_LAUNCHER_JOB_ID="318040" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,8,1/22,2,8,25/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,8,1/22,2,8,26/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images diff --git a/patches/019-occ-user-setting.patch b/patches/019-occ-user-setting.patch index 4b630e02..7c15dc1c 100644 --- a/patches/019-occ-user-setting.patch +++ b/patches/019-occ-user-setting.patch @@ -19,9 +19,9 @@ This patch triggers a user changed event when quota is updated via the occ comma } $this->config->setUserValue($uid, $app, $key, $input->getArgument('value')); -+ $user = $this->userManager->get($uid); -+ $eventDispatcher = \OC::$server->get(IEventDispatcher::class); + if (($app === 'files' && $key === 'quota') || ($app === 'email-recovery' && $key === 'recovery-email')) { ++ $user = $this->userManager->get($uid); ++ $eventDispatcher = \OC::$server->get(IEventDispatcher::class); + $eventDispatcher->dispatchTyped(new UserChangedEvent($user, $key, $input->getArgument('value'), $value)); + } return 0; -- GitLab From 6cc17062c7e300c744bff774328d1100592f81dc Mon Sep 17 00:00:00 2001 From: Akhil Date: Wed, 6 Jul 2022 14:43:02 +0530 Subject: [PATCH 5/5] Ecloud accounts 2.0.2 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 52f1c18c..361e7db6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,12 +12,12 @@ ARG USER_BACKEND_RAW_SQL_VERSION="1.3.0" ARG EMAIL_RECOVERY_JOB_ID="313915" ARG RAINLOOP_VERSION="7.2.5" ARG RAINLOOP_COMMIT_SHA="523518ba" -ARG EA_TAG="2.0.1" +ARG EA_TAG="2.0.2" ARG ECLOUD_LAUNCHER_JOB_ID="318040" ARG GOOGLE_INTEGRATION_VERSION="1.0.6" ARG LDAP_WRITE_SUPPORT_VERSION="1.4.0" -RUN sed -i 's/22,2,8,1/22,2,8,26/' ${BASE_DIR}/version.php +RUN sed -i 's/22,2,8,1/22,2,8,27/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images -- GitLab