@@ -39,19 +39,24 @@ public function __construct(IConfig $config) {
3939 */
4040 public function getMountsForUser (IUser $ user , IStorageFactory $ loader ) {
4141 $ cacheBaseDir = $ this ->config ->getSystemValueString ('cache_path ' , '' );
42+ $ mounts = [];
4243 if ($ cacheBaseDir !== '' ) {
4344 $ cacheDir = rtrim ($ cacheBaseDir , '/ ' ) . '/ ' . $ user ->getUID ();
4445 if (!file_exists ($ cacheDir )) {
4546 mkdir ($ cacheDir , 0770 , true );
46- mkdir ($ cacheDir . '/uploads ' , 0770 , true );
4747 }
48-
49- return [
50- new MountPoint ('\OC\Files\Storage\Local ' , '/ ' . $ user ->getUID () . '/cache ' , ['datadir ' => $ cacheDir ], $ loader , null , null , self ::class),
51- new MountPoint ('\OC\Files\Storage\Local ' , '/ ' . $ user ->getUID () . '/uploads ' , ['datadir ' => $ cacheDir . '/uploads ' ], $ loader , null , null , self ::class)
52- ];
53- } else {
54- return [];
48+ $ mounts [] = new MountPoint ('\OC\Files\Storage\Local ' , '/ ' . $ user ->getUID () . '/cache ' , ['datadir ' => $ cacheDir ], $ loader , null , null , self ::class);
5549 }
50+
51+ $ uploadsPath = $ this ->config ->getSystemValueString ('uploads_path ' , $ this ->config ->getSystemValueString ('cache_path ' , '' ));
52+ if ($ uploadsPath !== '' ) {
53+ $ uploadsDir = rtrim ($ uploadsPath , '/ ' ) . '/ ' . $ user ->getUID () . '/uploads ' ;
54+ if (!file_exists ($ uploadsDir )) {
55+ mkdir ($ uploadsDir , 0770 , true );
56+ }
57+ $ mounts [] = new MountPoint ('\OC\Files\Storage\Local ' , '/ ' . $ user ->getUID () . '/uploads ' , ['datadir ' => $ uploadsDir ], $ loader , null , null , self ::class);
58+ }
59+
60+ return $ mounts ;
5661 }
5762}
0 commit comments