Merge pull request #21735 from owncloud/files-external-checkbox-settings

Consolidate user mounting check code
This commit is contained in:
Thomas Müller 2016-01-15 12:25:27 +01:00
commit 64fb3c0606
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
*/