@@ -32,72 +32,72 @@ |
||
32 | 32 | |
33 | 33 | class Personal implements ISettings { |
34 | 34 | |
35 | - /** @var IManager */ |
|
36 | - private $encryptionManager; |
|
35 | + /** @var IManager */ |
|
36 | + private $encryptionManager; |
|
37 | 37 | |
38 | - /** @var UserGlobalStoragesService */ |
|
39 | - private $userGlobalStoragesService; |
|
38 | + /** @var UserGlobalStoragesService */ |
|
39 | + private $userGlobalStoragesService; |
|
40 | 40 | |
41 | - /** @var BackendService */ |
|
42 | - private $backendService; |
|
41 | + /** @var BackendService */ |
|
42 | + private $backendService; |
|
43 | 43 | |
44 | - /** @var GlobalAuth */ |
|
45 | - private $globalAuth; |
|
44 | + /** @var GlobalAuth */ |
|
45 | + private $globalAuth; |
|
46 | 46 | |
47 | - /** @var IUserSession */ |
|
48 | - private $userSession; |
|
47 | + /** @var IUserSession */ |
|
48 | + private $userSession; |
|
49 | 49 | |
50 | - public function __construct( |
|
51 | - IManager $encryptionManager, |
|
52 | - UserGlobalStoragesService $userGlobalStoragesService, |
|
53 | - BackendService $backendService, |
|
54 | - GlobalAuth $globalAuth, |
|
55 | - IUserSession $userSession |
|
56 | - ) { |
|
57 | - $this->encryptionManager = $encryptionManager; |
|
58 | - $this->userGlobalStoragesService = $userGlobalStoragesService; |
|
59 | - $this->backendService = $backendService; |
|
60 | - $this->globalAuth = $globalAuth; |
|
61 | - $this->userSession = $userSession; |
|
62 | - } |
|
50 | + public function __construct( |
|
51 | + IManager $encryptionManager, |
|
52 | + UserGlobalStoragesService $userGlobalStoragesService, |
|
53 | + BackendService $backendService, |
|
54 | + GlobalAuth $globalAuth, |
|
55 | + IUserSession $userSession |
|
56 | + ) { |
|
57 | + $this->encryptionManager = $encryptionManager; |
|
58 | + $this->userGlobalStoragesService = $userGlobalStoragesService; |
|
59 | + $this->backendService = $backendService; |
|
60 | + $this->globalAuth = $globalAuth; |
|
61 | + $this->userSession = $userSession; |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @return TemplateResponse |
|
66 | - */ |
|
67 | - public function getForm() { |
|
68 | - $uid = $this->userSession->getUser()->getUID(); |
|
64 | + /** |
|
65 | + * @return TemplateResponse |
|
66 | + */ |
|
67 | + public function getForm() { |
|
68 | + $uid = $this->userSession->getUser()->getUID(); |
|
69 | 69 | |
70 | - $parameters = [ |
|
71 | - 'encryptionEnabled' => $this->encryptionManager->isEnabled(), |
|
72 | - 'visibilityType' => BackendService::VISIBILITY_PERSONAL, |
|
73 | - 'storages' => $this->userGlobalStoragesService->getStorages(), |
|
74 | - 'backends' => $this->backendService->getAvailableBackends(), |
|
75 | - 'authMechanisms' => $this->backendService->getAuthMechanisms(), |
|
76 | - 'dependencies' => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()), |
|
77 | - 'allowUserMounting' => $this->backendService->isUserMountingAllowed(), |
|
78 | - 'globalCredentials' => $this->globalAuth->getAuth($uid), |
|
79 | - 'globalCredentialsUid' => $uid, |
|
80 | - ]; |
|
70 | + $parameters = [ |
|
71 | + 'encryptionEnabled' => $this->encryptionManager->isEnabled(), |
|
72 | + 'visibilityType' => BackendService::VISIBILITY_PERSONAL, |
|
73 | + 'storages' => $this->userGlobalStoragesService->getStorages(), |
|
74 | + 'backends' => $this->backendService->getAvailableBackends(), |
|
75 | + 'authMechanisms' => $this->backendService->getAuthMechanisms(), |
|
76 | + 'dependencies' => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()), |
|
77 | + 'allowUserMounting' => $this->backendService->isUserMountingAllowed(), |
|
78 | + 'globalCredentials' => $this->globalAuth->getAuth($uid), |
|
79 | + 'globalCredentialsUid' => $uid, |
|
80 | + ]; |
|
81 | 81 | |
82 | - return new TemplateResponse('files_external', 'settings', $parameters, ''); |
|
83 | - } |
|
82 | + return new TemplateResponse('files_external', 'settings', $parameters, ''); |
|
83 | + } |
|
84 | 84 | |
85 | - /** |
|
86 | - * @return string the section ID, e.g. 'sharing' |
|
87 | - */ |
|
88 | - public function getSection() { |
|
89 | - return 'externalstorages'; |
|
90 | - } |
|
85 | + /** |
|
86 | + * @return string the section ID, e.g. 'sharing' |
|
87 | + */ |
|
88 | + public function getSection() { |
|
89 | + return 'externalstorages'; |
|
90 | + } |
|
91 | 91 | |
92 | - /** |
|
93 | - * @return int whether the form should be rather on the top or bottom of |
|
94 | - * the admin section. The forms are arranged in ascending order of the |
|
95 | - * priority values. It is required to return a value between 0 and 100. |
|
96 | - * |
|
97 | - * E.g.: 70 |
|
98 | - */ |
|
99 | - public function getPriority() { |
|
100 | - return 40; |
|
101 | - } |
|
92 | + /** |
|
93 | + * @return int whether the form should be rather on the top or bottom of |
|
94 | + * the admin section. The forms are arranged in ascending order of the |
|
95 | + * priority values. It is required to return a value between 0 and 100. |
|
96 | + * |
|
97 | + * E.g.: 70 |
|
98 | + */ |
|
99 | + public function getPriority() { |
|
100 | + return 40; |
|
101 | + } |
|
102 | 102 | |
103 | 103 | } |
@@ -29,39 +29,39 @@ |
||
29 | 29 | use OCP\IUserSession; |
30 | 30 | |
31 | 31 | class PersonalSection extends Section { |
32 | - /** @var IUserSession */ |
|
33 | - private $userSession; |
|
32 | + /** @var IUserSession */ |
|
33 | + private $userSession; |
|
34 | 34 | |
35 | - /** @var UserGlobalStoragesService */ |
|
36 | - private $userGlobalStoragesService; |
|
35 | + /** @var UserGlobalStoragesService */ |
|
36 | + private $userGlobalStoragesService; |
|
37 | 37 | |
38 | - /** @var BackendService */ |
|
39 | - private $backendService; |
|
38 | + /** @var BackendService */ |
|
39 | + private $backendService; |
|
40 | 40 | |
41 | - public function __construct( |
|
42 | - IURLGenerator $url, |
|
43 | - IL10N $l, |
|
44 | - IUserSession $userSession, |
|
45 | - UserGlobalStoragesService $userGlobalStoragesService, |
|
46 | - BackendService $backendService |
|
47 | - ) { |
|
48 | - parent::__construct($url, $l); |
|
49 | - $this->userSession = $userSession; |
|
50 | - $this->userGlobalStoragesService = $userGlobalStoragesService; |
|
51 | - $this->backendService = $backendService; |
|
52 | - } |
|
41 | + public function __construct( |
|
42 | + IURLGenerator $url, |
|
43 | + IL10N $l, |
|
44 | + IUserSession $userSession, |
|
45 | + UserGlobalStoragesService $userGlobalStoragesService, |
|
46 | + BackendService $backendService |
|
47 | + ) { |
|
48 | + parent::__construct($url, $l); |
|
49 | + $this->userSession = $userSession; |
|
50 | + $this->userGlobalStoragesService = $userGlobalStoragesService; |
|
51 | + $this->backendService = $backendService; |
|
52 | + } |
|
53 | 53 | |
54 | - public function getID() { |
|
55 | - if (!$this->userSession->isLoggedIn()) { |
|
56 | - // we need to return the proper id while installing/upgrading the app |
|
57 | - return parent::getID(); |
|
58 | - } |
|
54 | + public function getID() { |
|
55 | + if (!$this->userSession->isLoggedIn()) { |
|
56 | + // we need to return the proper id while installing/upgrading the app |
|
57 | + return parent::getID(); |
|
58 | + } |
|
59 | 59 | |
60 | - if (count($this->userGlobalStoragesService->getStorages()) > 0 || $this->backendService->isUserMountingAllowed()) { |
|
61 | - return parent::getID(); |
|
62 | - } else { |
|
63 | - // by returning a different id, no matching settings will be found and the item will be hidden |
|
64 | - return null; |
|
65 | - } |
|
66 | - } |
|
60 | + if (count($this->userGlobalStoragesService->getStorages()) > 0 || $this->backendService->isUserMountingAllowed()) { |
|
61 | + return parent::getID(); |
|
62 | + } else { |
|
63 | + // by returning a different id, no matching settings will be found and the item will be hidden |
|
64 | + return null; |
|
65 | + } |
|
66 | + } |
|
67 | 67 | } |
68 | 68 | \ No newline at end of file |
@@ -36,14 +36,14 @@ |
||
36 | 36 | $appContainer = \OC_Mount_Config::$app->getContainer(); |
37 | 37 | |
38 | 38 | \OCA\Files\App::getNavigationManager()->add(function () { |
39 | - $l = \OC::$server->getL10N('files_external'); |
|
40 | - return [ |
|
41 | - 'id' => 'extstoragemounts', |
|
42 | - 'appname' => 'files_external', |
|
43 | - 'script' => 'list.php', |
|
44 | - 'order' => 30, |
|
45 | - 'name' => $l->t('External storages'), |
|
46 | - ]; |
|
39 | + $l = \OC::$server->getL10N('files_external'); |
|
40 | + return [ |
|
41 | + 'id' => 'extstoragemounts', |
|
42 | + 'appname' => 'files_external', |
|
43 | + 'script' => 'list.php', |
|
44 | + 'order' => 30, |
|
45 | + 'name' => $l->t('External storages'), |
|
46 | + ]; |
|
47 | 47 | }); |
48 | 48 | |
49 | 49 | $mountProvider = $appContainer->query('OCA\Files_External\Config\ConfigAdapter'); |
@@ -29,13 +29,13 @@ |
||
29 | 29 | |
30 | 30 | OC::$CLASSPATH['OC_Mount_Config'] = 'files_external/lib/config.php'; |
31 | 31 | |
32 | -require_once __DIR__ . '/../3rdparty/autoload.php'; |
|
32 | +require_once __DIR__.'/../3rdparty/autoload.php'; |
|
33 | 33 | |
34 | 34 | // register Application object singleton |
35 | 35 | \OC_Mount_Config::$app = new \OCA\Files_External\AppInfo\Application(); |
36 | 36 | $appContainer = \OC_Mount_Config::$app->getContainer(); |
37 | 37 | |
38 | -\OCA\Files\App::getNavigationManager()->add(function () { |
|
38 | +\OCA\Files\App::getNavigationManager()->add(function() { |
|
39 | 39 | $l = \OC::$server->getL10N('files_external'); |
40 | 40 | return [ |
41 | 41 | 'id' => 'extstoragemounts', |