mirror of
https://github.com/nextcloud/server.git
synced 2024-08-05 20:16:00 +02:00
Consolidate user mounting check code
This commit is contained in:
parent
b48ddc94a9
commit
4ffe8d70fa
@ -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',
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user