@@ -53,19 +53,24 @@ public function __construct(IConfig $config) {
5353 */
5454 public function getMountsForUser (IUser $ user , IStorageFactory $ loader ) {
5555 $ cacheBaseDir = $ this ->config ->getSystemValueString ('cache_path ' , '' );
56+ $ mounts = [];
5657 if ($ cacheBaseDir !== '' ) {
5758 $ cacheDir = rtrim ($ cacheBaseDir , '/ ' ) . '/ ' . $ user ->getUID ();
5859 if (!file_exists ($ cacheDir )) {
5960 mkdir ($ cacheDir , 0770 , true );
60- mkdir ($ cacheDir . '/uploads ' , 0770 , true );
6161 }
62-
63- return [
64- new MountPoint ('\OC\Files\Storage\Local ' , '/ ' . $ user ->getUID () . '/cache ' , ['datadir ' => $ cacheDir ], $ loader , null , null , self ::class),
65- new MountPoint ('\OC\Files\Storage\Local ' , '/ ' . $ user ->getUID () . '/uploads ' , ['datadir ' => $ cacheDir . '/uploads ' ], $ loader , null , null , self ::class)
66- ];
67- } else {
68- return [];
62+ $ mounts [] = new MountPoint ('\OC\Files\Storage\Local ' , '/ ' . $ user ->getUID () . '/cache ' , ['datadir ' => $ cacheDir ], $ loader , null , null , self ::class);
6963 }
64+
65+ $ uploadsPath = $ this ->config ->getSystemValueString ('uploads_path ' , $ this ->config ->getSystemValueString ('cache_path ' , '' ));
66+ if ($ uploadsPath !== '' ) {
67+ $ uploadsDir = rtrim ($ uploadsPath , '/ ' ) . '/ ' . $ user ->getUID () . '/uploads ' ;
68+ if (!file_exists ($ uploadsDir )) {
69+ mkdir ($ uploadsDir , 0770 , true );
70+ }
71+ $ mounts [] = new MountPoint ('\OC\Files\Storage\Local ' , '/ ' . $ user ->getUID () . '/uploads ' , ['datadir ' => $ uploadsDir ], $ loader , null , null , self ::class);
72+ }
73+
74+ return $ mounts ;
7075 }
7176}
0 commit comments