Consolidate user mounting check code

This commit is contained in:
Robin McCorkell 2016-01-14 22:13:28 +00:00
parent b48ddc94a9
commit 4ffe8d70fa
2 changed files with 15 additions and 5 deletions

View File

@ -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',

View File

@ -45,6 +45,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
*/