Merge pull request #10766 from owncloud/getUserFolder

Add optional user ID parameter for getUseFolder
This commit is contained in:
Robin Appelman 2014-08-31 11:07:37 +02:00
commit ab5a389836
1 changed files with 9 additions and 5 deletions

View File

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