From f3f1d1ee737e73f804bb21731f83d1d19635e021 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Sun, 31 Aug 2014 09:49:19 +0200 Subject: [PATCH] Add optional user ID parameter for getUseFolder --- lib/private/server.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/private/server.php b/lib/private/server.php index 20d6078738b..d1c5768b19b 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -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; -- 2.39.5