summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/Service/GlobalStoragesService.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-06-17 13:29:29 +0200
committerRobin Appelman <icewind@owncloud.com>2016-06-23 13:12:03 +0200
commitbac1a3a6237b466d7b9d92491ad0f91d97247e46 (patch)
treea4b076b2c85d01248841a2df50d548124329164e /apps/files_external/lib/Service/GlobalStoragesService.php
parent1e1903e4feffb98bde50cf41618d6bb3ef11c88a (diff)
downloadnextcloud-server-bac1a3a6237b466d7b9d92491ad0f91d97247e46.tar.gz
nextcloud-server-bac1a3a6237b466d7b9d92491ad0f91d97247e46.zip
Add option to `occ files_external:list` to show all configured mounts
Diffstat (limited to 'apps/files_external/lib/Service/GlobalStoragesService.php')
-rw-r--r--apps/files_external/lib/Service/GlobalStoragesService.php19
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);
+ }
}