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
parent c5c71c668d
commit 5dd20a55e8

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