| @@ 1023-1029 (lines=7) @@ | ||
| 1020 | * @return \OCP\Files\Folder|null |
|
| 1021 | */ |
|
| 1022 | public function getUserFolder($userId = null) { |
|
| 1023 | if ($userId === null) { |
|
| 1024 | $user = $this->getUserSession()->getUser(); |
|
| 1025 | if (!$user) { |
|
| 1026 | return null; |
|
| 1027 | } |
|
| 1028 | $userId = $user->getUID(); |
|
| 1029 | } |
|
| 1030 | $root = $this->getRootFolder(); |
|
| 1031 | return $root->getUserFolder($userId); |
|
| 1032 | } |
|
| @@ 1340-1347 (lines=8) @@ | ||
| 1337 | * @return \OCP\ICertificateManager | null if $uid is null and no user is logged in |
|
| 1338 | */ |
|
| 1339 | public function getCertificateManager($userId = '') { |
|
| 1340 | if ($userId === '') { |
|
| 1341 | $userSession = $this->getUserSession(); |
|
| 1342 | $user = $userSession->getUser(); |
|
| 1343 | if ($user === null) { |
|
| 1344 | return null; |
|
| 1345 | } |
|
| 1346 | $userId = $user->getUID(); |
|
| 1347 | } |
|
| 1348 | return new CertificateManager($userId, new View(), $this->getConfig()); |
|
| 1349 | } |
|
| 1350 | ||