Browse Source
Return quota even if user is not initialized
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
pull/8926/head
John Molakvoæ (skjnldsv)
8 years ago
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
1 changed files with
10 additions and
1 deletions
-
apps/provisioning_api/lib/Controller/UsersController.php
|
|
|
@ -873,7 +873,16 @@ class UsersController extends OCSController { |
|
|
|
'quota' => $storage['quota'], |
|
|
|
]; |
|
|
|
} catch (NotFoundException $ex) { |
|
|
|
$data = []; |
|
|
|
// User fs is not setup yet
|
|
|
|
$user = $this->userManager->get($userId); |
|
|
|
if ($user === null) { |
|
|
|
throw new OCSException('User does not exist', 101); |
|
|
|
} |
|
|
|
$quota = OC_Helper::computerFileSize($user->getQuota()); |
|
|
|
$data = [ |
|
|
|
'quota' => $quota, |
|
|
|
'used' => 0 |
|
|
|
]; |
|
|
|
} |
|
|
|
return $data; |
|
|
|
} |
|
|
|
|