]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add optional user ID parameter for getUseFolder
authorMorris Jobke <hey@morrisjobke.de>
Sun, 31 Aug 2014 07:49:19 +0000 (09:49 +0200)
committerMorris Jobke <hey@morrisjobke.de>
Sun, 31 Aug 2014 11:27:53 +0000 (13:27 +0200)
lib/private/server.php

index 20d6078738b647e2de6107781b498817f3e89e7e..d1c5768b19b6a1faec4326d1605ef1177b656f7c 100644 (file)
@@ -262,14 +262,18 @@ class Server extends SimpleContainer implements IServerContainer {
        /**
         * Returns a view to ownCloud's files folder
         *
+        * @param string $userId user ID
         * @return \OCP\Files\Folder
         */
-       function getUserFolder() {
-               $user = $this->getUserSession()->getUser();
-               if (!$user) {
-                       return null;
+       function getUserFolder($userId = null) {
+               if($userId === null) {
+                       $user = $this->getUserSession()->getUser();
+                       if (!$user) {
+                               return null;
+                       }
+                       $userId = $user->getUID();
                }
-               $dir = '/' . $user->getUID();
+               $dir = '/' . $userId;
                $root = $this->getRootFolder();
                $folder = null;