diff options
author | Robin Appelman <robin@icewind.nl> | 2022-03-17 18:24:18 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-03-24 17:03:44 +0100 |
commit | fc6e4530c41758c7b8713153f45dbe38f5cdca08 (patch) | |
tree | 5f701bb184e43a4256d684cd95ef0749d4188765 /apps/files_external/lib | |
parent | 15c9a3114aa16af35a772cefe5b3e6566c304607 (diff) | |
download | nextcloud-server-fc6e4530c41758c7b8713153f45dbe38f5cdca08.tar.gz nextcloud-server-fc6e4530c41758c7b8713153f45dbe38f5cdca08.zip |
force full setup after external storage config change
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_external/lib')
3 files changed, 23 insertions, 5 deletions
diff --git a/apps/files_external/lib/Service/StoragesService.php b/apps/files_external/lib/Service/StoragesService.php index b8eabd65e1e..6d03590d345 100644 --- a/apps/files_external/lib/Service/StoragesService.php +++ b/apps/files_external/lib/Service/StoragesService.php @@ -40,7 +40,9 @@ use OCA\Files_External\Lib\Backend\InvalidBackend; use OCA\Files_External\Lib\DefinitionParameter; use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\NotFoundException; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Config\IUserMountCache; +use OCP\Files\Events\InvalidateMountCacheEvent; use OCP\Files\StorageNotAvailableException; use OCP\ILogger; @@ -62,15 +64,24 @@ abstract class StoragesService { */ protected $userMountCache; + protected IEventDispatcher $eventDispatcher; + /** * @param BackendService $backendService * @param DBConfigService $dbConfigService * @param IUserMountCache $userMountCache + * @param IEventDispatcher $eventDispatcher */ - public function __construct(BackendService $backendService, DBConfigService $dbConfigService, IUserMountCache $userMountCache) { + public function __construct( + BackendService $backendService, + DBConfigService $dbConfigService, + IUserMountCache $userMountCache, + IEventDispatcher $eventDispatcher + ) { $this->backendService = $backendService; $this->dbConfig = $dbConfigService; $this->userMountCache = $userMountCache; + $this->eventDispatcher = $eventDispatcher; } protected function readDBConfig() { @@ -339,6 +350,7 @@ abstract class StoragesService { * @param array $applicableArray array of applicable users/groups for which to trigger the hook */ protected function triggerApplicableHooks($signal, $mountPoint, $mountType, $applicableArray) { + $this->eventDispatcher->dispatchTyped(new InvalidateMountCacheEvent(null)); foreach ($applicableArray as $applicable) { \OCP\Util::emitHook( Filesystem::CLASSNAME, diff --git a/apps/files_external/lib/Service/UserGlobalStoragesService.php b/apps/files_external/lib/Service/UserGlobalStoragesService.php index ba894d8f210..2eda36e9242 100644 --- a/apps/files_external/lib/Service/UserGlobalStoragesService.php +++ b/apps/files_external/lib/Service/UserGlobalStoragesService.php @@ -24,6 +24,7 @@ namespace OCA\Files_External\Service; use OCA\Files_External\Lib\StorageConfig; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Config\IUserMountCache; use OCP\IGroupManager; use OCP\IUser; @@ -45,15 +46,17 @@ class UserGlobalStoragesService extends GlobalStoragesService { * @param IUserSession $userSession * @param IGroupManager $groupManager * @param IUserMountCache $userMountCache + * @param IEventDispatcher $eventDispatcher */ public function __construct( BackendService $backendService, DBConfigService $dbConfig, IUserSession $userSession, IGroupManager $groupManager, - IUserMountCache $userMountCache + IUserMountCache $userMountCache, + IEventDispatcher $eventDispatcher ) { - parent::__construct($backendService, $dbConfig, $userMountCache); + parent::__construct($backendService, $dbConfig, $userMountCache, $eventDispatcher); $this->userSession = $userSession; $this->groupManager = $groupManager; } diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php index 8af6bdb3a77..b09b37b40cc 100644 --- a/apps/files_external/lib/Service/UserStoragesService.php +++ b/apps/files_external/lib/Service/UserStoragesService.php @@ -32,6 +32,7 @@ use OC\Files\Filesystem; use OCA\Files_External\Lib\StorageConfig; use OCA\Files_External\NotFoundException; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Config\IUserMountCache; use OCP\IUserSession; @@ -49,15 +50,17 @@ class UserStoragesService extends StoragesService { * @param DBConfigService $dbConfig * @param IUserSession $userSession user session * @param IUserMountCache $userMountCache + * @param IEventDispatcher $eventDispatcher */ public function __construct( BackendService $backendService, DBConfigService $dbConfig, IUserSession $userSession, - IUserMountCache $userMountCache + IUserMountCache $userMountCache, + IEventDispatcher $eventDispatcher ) { $this->userSession = $userSession; - parent::__construct($backendService, $dbConfig, $userMountCache); + parent::__construct($backendService, $dbConfig, $userMountCache, $eventDispatcher); } protected function readDBConfig() { |