Merge pull request #8459 from owncloud/fix-getUserFolder

fix getUserFolder() of server container
This commit is contained in:
Morris Jobke 2014-05-05 23:08:42 +02:00
commit 9411ba2acd

View file

@ -240,15 +240,23 @@ class Server extends SimpleContainer implements IServerContainer {
* @return \OCP\Files\Folder
*/
function getUserFolder() {
$dir = '/files';
$dir = '/' . \OCP\User::getUser();
$root = $this->getRootFolder();
$folder = null;
if(!$root->nodeExists($dir)) {
$folder = $root->newFolder($dir);
} else {
$folder = $root->get($dir);
}
$dir = '/files';
if(!$folder->nodeExists($dir)) {
$folder = $folder->newFolder($dir);
} else {
$folder = $folder->get($dir);
}
return $folder;
}