]> source.dussan.org Git - nextcloud-server.git/commitdiff
add parameter to specify user for which OC_Filesystem should be initialized.
authorBjörn Schießle <schiessle@owncloud.com>
Mon, 22 Oct 2012 12:52:59 +0000 (14:52 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Mon, 22 Oct 2012 12:55:53 +0000 (14:55 +0200)
(needed to share files via public links where no user is logged in)

lib/filesystem.php
lib/util.php

index 8b44ab6e6c6a8ce848cb00a3f09ee3fc783aea4a..00682573dd9e8694d32aa53f0d7626e2d69b3e2c 100644 (file)
@@ -254,14 +254,17 @@ class OC_Filesystem{
                }               
        }
        
-       static public function init($root) {
+       static public function init($root, $user = '') {
                if(self::$defaultInstance) {
                        return false;
                }
                self::$defaultInstance=new OC_FilesystemView($root);
 
                //load custom mount config
-               self::loadSystemMountPoints(OC_User::getUser());
+               if (!isset($user)) {
+                       $user = OC_User::getUser();
+               }
+               self::loadSystemMountPoints($user);
 
                self::$loaded=true;
        }
index eb0e5e8ec406a59612fe75123b33cf7ec623e820..a847c02872e77c3aaf1dd161821dcb2403d03dca 100755 (executable)
@@ -47,7 +47,7 @@ class OC_Util {
                        }
                        //jail the user into his "home" directory
                        OC_Filesystem::mount('OC_Filestorage_Local', array('datadir' => $user_root), $user);
-                       OC_Filesystem::init($user_dir);
+                       OC_Filesystem::init($user_dir, $user);
                        $quotaProxy=new OC_FileProxy_Quota();
                        $fileOperationProxy = new OC_FileProxy_FileOperations();
                        OC_FileProxy::register($quotaProxy);