summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/server.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/private/server.php b/lib/private/server.php
index bf1801a5ce8..28c4fe60856 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -263,14 +263,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;