Merge pull request #8459 from owncloud/fix-getUserFolder
fix getUserFolder() of server container
This commit is contained in:
commit
9411ba2acd
1 changed files with 10 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue