| @@ 1010-1016 (lines=7) @@ | ||
| 1007 | * @return \OCP\Files\Folder|null |
|
| 1008 | */ |
|
| 1009 | public function getUserFolder($userId = null) { |
|
| 1010 | if ($userId === null) { |
|
| 1011 | $user = $this->getUserSession()->getUser(); |
|
| 1012 | if (!$user) { |
|
| 1013 | return null; |
|
| 1014 | } |
|
| 1015 | $userId = $user->getUID(); |
|
| 1016 | } |
|
| 1017 | $root = $this->getRootFolder(); |
|
| 1018 | return $root->getUserFolder($userId); |
|
| 1019 | } |
|
| @@ 1318-1325 (lines=8) @@ | ||
| 1315 | * @return \OCP\ICertificateManager | null if $uid is null and no user is logged in |
|
| 1316 | */ |
|
| 1317 | public function getCertificateManager($userId = '') { |
|
| 1318 | if ($userId === '') { |
|
| 1319 | $userSession = $this->getUserSession(); |
|
| 1320 | $user = $userSession->getUser(); |
|
| 1321 | if ($user === null) { |
|
| 1322 | return null; |
|
| 1323 | } |
|
| 1324 | $userId = $user->getUID(); |
|
| 1325 | } |
|
| 1326 | return new CertificateManager($userId, new View(), $this->getConfig()); |
|
| 1327 | } |
|
| 1328 | ||