dont register personal files_external setting if it's empty

This commit is contained in:
Robin Appelman 2016-08-15 15:32:22 +02:00 committed by Marius Blüm
parent 263c73c685
commit 42f14ab5a9
1 changed files with 8 additions and 1 deletions

View File

@ -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');
}
}
/**