| @@ 1602-1609 (lines=8) @@ | ||
| 1599 | * @return \OCP\ICertificateManager | null if $uid is null and no user is logged in |
|
| 1600 | */ |
|
| 1601 | public function getCertificateManager($userId = '') { |
|
| 1602 | if ($userId === '') { |
|
| 1603 | $userSession = $this->getUserSession(); |
|
| 1604 | $user = $userSession->getUser(); |
|
| 1605 | if (is_null($user)) { |
|
| 1606 | return null; |
|
| 1607 | } |
|
| 1608 | $userId = $user->getUID(); |
|
| 1609 | } |
|
| 1610 | return new CertificateManager( |
|
| 1611 | $userId, |
|
| 1612 | new View(), |
|
| @@ 1331-1337 (lines=7) @@ | ||
| 1328 | * @return \OCP\Files\Folder|null |
|
| 1329 | */ |
|
| 1330 | public function getUserFolder($userId = null) { |
|
| 1331 | if ($userId === null) { |
|
| 1332 | $user = $this->getUserSession()->getUser(); |
|
| 1333 | if (!$user) { |
|
| 1334 | return null; |
|
| 1335 | } |
|
| 1336 | $userId = $user->getUID(); |
|
| 1337 | } |
|
| 1338 | $root = $this->getRootFolder(); |
|
| 1339 | return $root->getUserFolder($userId); |
|
| 1340 | } |
|