Commit 13a1acc2 authored by Akhil's avatar Akhil 😶
Browse files

Merge branch 'occ-user-change-trigger' into 'main'

Occ user change trigger

See merge request !105
parents 2fc2ac94 1ea2d2ad
Pipeline #201574 passed with stage
in 1 minute and 11 seconds
......@@ -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,24/' ${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
......@@ -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
......
From: Akhil <akhil@e.email>
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 21:24:11.654134876 +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'));
+ 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;
} elseif ($input->hasParameterOption('--delete')) {
if ($input->hasParameterOption('--error-if-not-exists') && $value === null) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment