@@ -69,6 +69,9 @@ class MountProvider implements IMountProvider {
6969 private $ connection ;
7070 private $ allowRootShare ;
7171
72+ /** @var bool */
73+ private $ enableEncryption ;
74+
7275 public function __construct (
7376 IGroupManager $ groupProvider ,
7477 FolderManager $ folderManager ,
@@ -79,7 +82,8 @@ public function __construct(
7982 ISession $ session ,
8083 IMountProviderCollection $ mountProviderCollection ,
8184 IDBConnection $ connection ,
82- bool $ allowRootShare
85+ bool $ allowRootShare ,
86+ bool $ enableEncryption
8387 ) {
8488 $ this ->groupProvider = $ groupProvider ;
8589 $ this ->folderManager = $ folderManager ;
@@ -91,6 +95,7 @@ public function __construct(
9195 $ this ->mountProviderCollection = $ mountProviderCollection ;
9296 $ this ->connection = $ connection ;
9397 $ this ->allowRootShare = $ allowRootShare ;
98+ $ this ->enableEncryption = $ enableEncryption ;
9499 }
95100
96101 /**
@@ -189,14 +194,25 @@ public function getMount(int $id, string $mountPoint, int $permissions, int $quo
189194 'storage ' => $ storage ,
190195 'root ' => $ rootPath
191196 ]);
192- $ quotaStorage = new GroupFolderStorage ([
193- 'storage ' => $ baseStorage ,
194- 'quota ' => $ quota ,
195- 'folder_id ' => $ id ,
196- 'rootCacheEntry ' => $ cacheEntry ,
197- 'userSession ' => $ this ->userSession ,
198- 'mountOwner ' => $ user ,
199- ]);
197+ if ($ this ->enableEncryption ) {
198+ $ quotaStorage = new GroupFolderStorage ([
199+ 'storage ' => $ baseStorage ,
200+ 'quota ' => $ quota ,
201+ 'folder_id ' => $ id ,
202+ 'rootCacheEntry ' => $ cacheEntry ,
203+ 'userSession ' => $ this ->userSession ,
204+ 'mountOwner ' => $ user ,
205+ ]);
206+ } else {
207+ $ quotaStorage = new GroupFolderNoEncryptionStorage ([
208+ 'storage ' => $ baseStorage ,
209+ 'quota ' => $ quota ,
210+ 'folder_id ' => $ id ,
211+ 'rootCacheEntry ' => $ cacheEntry ,
212+ 'userSession ' => $ this ->userSession ,
213+ 'mountOwner ' => $ user ,
214+ ]);
215+ }
200216 $ maskedStore = new PermissionsMask ([
201217 'storage ' => $ quotaStorage ,
202218 'mask ' => $ permissions
0 commit comments