diff options
author | Robin McCorkell <rmccorkell@owncloud.com> | 2016-01-14 22:13:28 +0000 |
---|---|---|
committer | Robin McCorkell <rmccorkell@owncloud.com> | 2016-01-14 22:13:28 +0000 |
commit | 4ffe8d70fae05e0bc6dba69190da665e3b85d64b (patch) | |
tree | 1b49a05a6a439b3bd61c92d73d62c778f59492a6 /apps/files_external/appinfo | |
parent | b48ddc94a9caa1c482a7260a298f5418b6028793 (diff) | |
download | nextcloud-server-4ffe8d70fae05e0bc6dba69190da665e3b85d64b.tar.gz nextcloud-server-4ffe8d70fae05e0bc6dba69190da665e3b85d64b.zip |
Consolidate user mounting check code
Diffstat (limited to 'apps/files_external/appinfo')
-rw-r--r-- | apps/files_external/appinfo/app.php | 7 | ||||
-rw-r--r-- | apps/files_external/appinfo/application.php | 13 |
2 files changed, 15 insertions, 5 deletions
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php index 9a2ec7286ca..c8d90f02f29 100644 --- a/apps/files_external/appinfo/app.php +++ b/apps/files_external/appinfo/app.php @@ -45,12 +45,9 @@ require_once __DIR__ . '/../3rdparty/autoload.php'; \OC_Mount_Config::$app = new \OCA\Files_external\Appinfo\Application(); $appContainer = \OC_Mount_Config::$app->getContainer(); -$l = \OC::$server->getL10N('files_external'); +\OC_Mount_Config::$app->registerSettings(); -OCP\App::registerAdmin('files_external', 'settings'); -if (OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') == 'yes') { - OCP\App::registerPersonal('files_external', 'personal'); -} +$l = \OC::$server->getL10N('files_external'); \OCA\Files\App::getNavigationManager()->add([ "id" => 'extstoragemounts', diff --git a/apps/files_external/appinfo/application.php b/apps/files_external/appinfo/application.php index b750734bf34..0c8b90935d3 100644 --- a/apps/files_external/appinfo/application.php +++ b/apps/files_external/appinfo/application.php @@ -46,6 +46,19 @@ class Application extends App { } /** + * Register settings templates + */ + public function registerSettings() { + $container = $this->getContainer(); + $backendService = $container->query('OCA\\Files_External\\Service\\BackendService'); + + \OCP\App::registerAdmin('files_external', 'settings'); + if ($backendService->isUserMountingAllowed()) { + \OCP\App::registerPersonal('files_external', 'personal'); + } + } + + /** * Load storage backends provided by this app */ protected function loadBackends() { |