File tree Expand file tree Collapse file tree
apps/files_external/lib/Controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828namespace OCA \Files_External \Controller ;
2929
3030use OCA \Files_External \NotFoundException ;
31+ use OCA \Files_External \Service \BackendService ;
3132use OCA \Files_External \Service \GlobalStoragesService ;
3233use OCP \AppFramework \Http ;
3334use OCP \AppFramework \Http \Attribute \PasswordConfirmationRequired ;
@@ -63,7 +64,8 @@ public function __construct(
6364 ILogger $ logger ,
6465 IUserSession $ userSession ,
6566 IGroupManager $ groupManager ,
66- IConfig $ config
67+ IConfig $ config ,
68+ BackendService $ backendService
6769 ) {
6870 parent ::__construct (
6971 $ AppName ,
@@ -73,7 +75,8 @@ public function __construct(
7375 $ logger ,
7476 $ userSession ,
7577 $ groupManager ,
76- $ config
78+ $ config ,
79+ $ backendService
7780 );
7881 }
7982
Original file line number Diff line number Diff line change 3434use OCA \Files_External \Lib \InsufficientDataForMeaningfulAnswerException ;
3535use OCA \Files_External \Lib \StorageConfig ;
3636use OCA \Files_External \NotFoundException ;
37+ use OCA \Files_External \Service \BackendService ;
3738use OCA \Files_External \Service \StoragesService ;
3839use OCP \AppFramework \Controller ;
3940use OCP \AppFramework \Http ;
@@ -139,7 +140,7 @@ protected function createStorage(
139140 $ priority = null
140141 ) {
141142 $ canCreateNewLocalStorage = $ this ->config ->getSystemValue ('files_external_allow_create_new_local ' , true );
142- if (!$ canCreateNewLocalStorage && $ backend === ' local ' ) {
143+ if (!$ canCreateNewLocalStorage && $ this -> backendService -> getBackend ( $ backend) instanceof Local ) {
143144 return new DataResponse (
144145 [
145146 'message ' => $ this ->l10n ->t ('Forbidden to manage local mounts ' )
Original file line number Diff line number Diff line change 3333use OCA \Files_External \Lib \InsufficientDataForMeaningfulAnswerException ;
3434use OCA \Files_External \Lib \StorageConfig ;
3535use OCA \Files_External \NotFoundException ;
36+ use OCA \Files_External \Service \BackendService ;
3637use OCA \Files_External \Service \UserGlobalStoragesService ;
3738use OCP \AppFramework \Http ;
3839use OCP \AppFramework \Http \Attribute \NoAdminRequired ;
@@ -68,7 +69,8 @@ public function __construct(
6869 ILogger $ logger ,
6970 IUserSession $ userSession ,
7071 IGroupManager $ groupManager ,
71- IConfig $ config
72+ IConfig $ config ,
73+ BackendService $ backendService
7274 ) {
7375 parent ::__construct (
7476 $ AppName ,
@@ -78,7 +80,8 @@ public function __construct(
7880 $ logger ,
7981 $ userSession ,
8082 $ groupManager ,
81- $ config
83+ $ config ,
84+ $ backendService ,
8285 );
8386 }
8487
Original file line number Diff line number Diff line change 3232use OCA \Files_External \Lib \Backend \Backend ;
3333use OCA \Files_External \Lib \StorageConfig ;
3434use OCA \Files_External \NotFoundException ;
35+ use OCA \Files_External \Service \BackendService ;
3536use OCA \Files_External \Service \UserStoragesService ;
3637use OCP \AppFramework \Http ;
3738use OCP \AppFramework \Http \Attribute \NoAdminRequired ;
@@ -67,7 +68,8 @@ public function __construct(
6768 ILogger $ logger ,
6869 IUserSession $ userSession ,
6970 IGroupManager $ groupManager ,
70- IConfig $ config
71+ IConfig $ config ,
72+ BackendService $ backendService
7173 ) {
7274 parent ::__construct (
7375 $ AppName ,
@@ -77,7 +79,8 @@ public function __construct(
7779 $ logger ,
7880 $ userSession ,
7981 $ groupManager ,
80- $ config
82+ $ config ,
83+ $ backendService ,
8184 );
8285 }
8386
You can’t perform that action at this time.
0 commit comments