From 5dd20a55e87922bce72d3ffcb70ed67ccfcc84f3 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 15 Aug 2016 15:32:22 +0200 Subject: [PATCH] dont register personal files_external setting if it's empty --- apps/files_external/lib/AppInfo/Application.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/files_external/lib/AppInfo/Application.php b/apps/files_external/lib/AppInfo/Application.php index 06c163419f..8e76ffd335 100644 --- a/apps/files_external/lib/AppInfo/Application.php +++ b/apps/files_external/lib/AppInfo/Application.php @@ -68,7 +68,14 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide * Register settings templates */ public function registerSettings() { - \OCP\App::registerPersonal('files_external', 'personal'); + $container = $this->getContainer(); + $backendService = $container->query('OCA\\Files_External\\Service\\BackendService'); + + /** @var \OCA\Files_External\Service\UserGlobalStoragesService $userGlobalStoragesService */ + $userGlobalStoragesService = $container->query('OCA\Files_External\Service\UserGlobalStoragesService'); + if (count($userGlobalStoragesService->getStorages()) > 0 || $backendService->isUserMountingAllowed()) { + \OCP\App::registerPersonal('files_external', 'personal'); + } } /**