Merge pull request #10766 from owncloud/getUserFolder
Add optional user ID parameter for getUseFolder
This commit is contained in:
commit
ab5a389836
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue