summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorRobin McCorkell <rmccorkell@owncloud.com>2015-09-23 15:35:17 +0100
committerRobin McCorkell <rmccorkell@owncloud.com>2015-09-23 16:00:11 +0100
commit24043333008b12dfbe7374cb318d9041717b87e0 (patch)
tree415d4ddb64db6da0971d6059769a0ef0e63a815f /apps/files_external/lib
parent6f5f1c4f142e5e2417b188b55d2f9fadf03749b3 (diff)
downloadnextcloud-server-24043333008b12dfbe7374cb318d9041717b87e0.tar.gz
nextcloud-server-24043333008b12dfbe7374cb318d9041717b87e0.zip
Perform visibility checks on storages
StoragesService::getStorages() will check the visibility of the backend and auth mechanism for the storage, and if either are not visible to the user (aka disabled by admin) then the storage will be filtered out. The original method StoragesService::getAllStorages() still exists in case such storages need to be detected, but its use is discouraged.
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/config.php14
-rw-r--r--apps/files_external/lib/config/configadapter.php2
2 files changed, 8 insertions, 8 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 2dc7de30a6c..afea7ead4e6 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -112,7 +112,7 @@ class OC_Mount_Config {
* @param string $uid user
* @return array of mount point string as key, mountpoint config as value
*
- * @deprecated 8.2.0 use UserGlobalStoragesService::getAllStorages() and UserStoragesService::getAllStorages()
+ * @deprecated 8.2.0 use UserGlobalStoragesService::getStorages() and UserStoragesService::getStorages()
*/
public static function getAbsoluteMountPoints($uid) {
$mountPoints = array();
@@ -124,7 +124,7 @@ class OC_Mount_Config {
$userGlobalStoragesService->setUser($user);
$userStoragesService->setUser($user);
- foreach ($userGlobalStoragesService->getAllStorages() as $storage) {
+ foreach ($userGlobalStoragesService->getStorages() as $storage) {
$mountPoint = '/'.$uid.'/files'.$storage->getMountPoint();
$mountEntry = self::prepareMountPointEntry($storage, false);
foreach ($mountEntry['options'] as &$option) {
@@ -133,7 +133,7 @@ class OC_Mount_Config {
$mountPoints[$mountPoint] = $mountEntry;
}
- foreach ($userStoragesService->getAllStorages() as $storage) {
+ foreach ($userStoragesService->getStorages() as $storage) {
$mountPoint = '/'.$uid.'/files'.$storage->getMountPoint();
$mountEntry = self::prepareMountPointEntry($storage, true);
foreach ($mountEntry['options'] as &$option) {
@@ -153,13 +153,13 @@ class OC_Mount_Config {
*
* @return array
*
- * @deprecated 8.2.0 use GlobalStoragesService::getAllStorages()
+ * @deprecated 8.2.0 use GlobalStoragesService::getStorages()
*/
public static function getSystemMountPoints() {
$mountPoints = [];
$service = self::$app->getContainer()->query('OCA\Files_External\Service\GlobalStoragesService');
- foreach ($service->getAllStorages() as $storage) {
+ foreach ($service->getStorages() as $storage) {
$mountPoints[] = self::prepareMountPointEntry($storage, false);
}
@@ -171,13 +171,13 @@ class OC_Mount_Config {
*
* @return array
*
- * @deprecated 8.2.0 use UserStoragesService::getAllStorages()
+ * @deprecated 8.2.0 use UserStoragesService::getStorages()
*/
public static function getPersonalMountPoints() {
$mountPoints = [];
$service = self::$app->getContainer()->query('OCA\Files_External\Service\UserStoragesService');
- foreach ($service->getAllStorages() as $storage) {
+ foreach ($service->getStorages() as $storage) {
$mountPoints[] = self::prepareMountPointEntry($storage, true);
}
diff --git a/apps/files_external/lib/config/configadapter.php b/apps/files_external/lib/config/configadapter.php
index cb8c2f24caa..fb36e011655 100644
--- a/apps/files_external/lib/config/configadapter.php
+++ b/apps/files_external/lib/config/configadapter.php
@@ -133,7 +133,7 @@ class ConfigAdapter implements IMountProvider {
$mounts[$storage->getMountPoint()] = $mount;
}
- foreach ($this->userStoragesService->getAllStorages() as $storage) {
+ foreach ($this->userStoragesService->getStorages() as $storage) {
try {
$this->prepareStorageConfig($storage, $user);
$impl = $this->constructStorage($storage);