| @@ 955-961 (lines=7) @@ | ||
| 952 | * @return \OCP\Files\Folder|null |
|
| 953 | */ |
|
| 954 | public function getUserFolder($userId = null) { |
|
| 955 | if ($userId === null) { |
|
| 956 | $user = $this->getUserSession()->getUser(); |
|
| 957 | if (!$user) { |
|
| 958 | return null; |
|
| 959 | } |
|
| 960 | $userId = $user->getUID(); |
|
| 961 | } |
|
| 962 | $root = $this->getRootFolder(); |
|
| 963 | return $root->getUserFolder($userId); |
|
| 964 | } |
|
| @@ 1265-1272 (lines=8) @@ | ||
| 1262 | * @return \OCP\ICertificateManager | null if $uid is null and no user is logged in |
|
| 1263 | */ |
|
| 1264 | public function getCertificateManager($userId = '') { |
|
| 1265 | if ($userId === '') { |
|
| 1266 | $userSession = $this->getUserSession(); |
|
| 1267 | $user = $userSession->getUser(); |
|
| 1268 | if (is_null($user)) { |
|
| 1269 | return null; |
|
| 1270 | } |
|
| 1271 | $userId = $user->getUID(); |
|
| 1272 | } |
|
| 1273 | return new CertificateManager($userId, new View(), $this->getConfig()); |
|
| 1274 | } |
|
| 1275 | ||