diff options
Diffstat (limited to 'apps/files_external/lib/Service/GlobalStoragesService.php')
-rw-r--r-- | apps/files_external/lib/Service/GlobalStoragesService.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/apps/files_external/lib/Service/GlobalStoragesService.php b/apps/files_external/lib/Service/GlobalStoragesService.php index 96d7aa46e8d..39d3da5d803 100644 --- a/apps/files_external/lib/Service/GlobalStoragesService.php +++ b/apps/files_external/lib/Service/GlobalStoragesService.php @@ -162,4 +162,23 @@ class GlobalStoragesService extends StoragesService { protected function isApplicable(StorageConfig $config) { return true; } + + /** + * Get all configured admin and personal mounts + * + * @return array map of storage id to storage config + */ + public function getStorageForAllUsers() { + $mounts = $this->dbConfig->getAllMounts(); + $configs = array_map([$this, 'getStorageConfigFromDBMount'], $mounts); + $configs = array_filter($configs, function ($config) { + return $config instanceof StorageConfig; + }); + + $keys = array_map(function (StorageConfig $config) { + return $config->getId(); + }, $configs); + + return array_combine($keys, $configs); + } } |