aboutsummaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-03-21 16:52:16 +0100
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-03-22 10:14:15 +0100
commit6e7b7749bda5eab9d28197159a8f9fba91b71752 (patch)
treead6ca9e3094a85194403660f7d323725b251d69c /apps/provisioning_api
parent29c551c88ff42e4cd0699787f038175b01e56980 (diff)
downloadnextcloud-server-6e7b7749bda5eab9d28197159a8f9fba91b71752.tar.gz
nextcloud-server-6e7b7749bda5eab9d28197159a8f9fba91b71752.zip
Return quota even if user is not initialized
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/provisioning_api')
-rw-r--r--apps/provisioning_api/lib/Controller/UsersController.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php
index cd277adb162..b1b110b5289 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/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;
}