summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2018-04-04 17:19:54 +0200
committerGitHub <noreply@github.com>2018-04-04 17:19:54 +0200
commit3678d3b14af7331e5f99fbf34e5aef26a65637ab (patch)
treeb279ab85cc726b4083ba42b1be2ec27c631ae849 /apps/provisioning_api/lib
parent9c4d5628084784bf3d14e9ae4f2e750bd537acef (diff)
parent63fa245461228225e196b43a8f338536358b76b2 (diff)
downloadnextcloud-server-3678d3b14af7331e5f99fbf34e5aef26a65637ab.tar.gz
nextcloud-server-3678d3b14af7331e5f99fbf34e5aef26a65637ab.zip
Merge pull request #8926 from nextcloud/ocs-api-quota-fallback
Return quota even if user is not initialised
Diffstat (limited to 'apps/provisioning_api/lib')
-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 e3b7840cd3b..c8c00fa8592 100644
--- a/apps/provisioning_api/lib/Controller/UsersController.php
+++ b/apps/provisioning_api/lib/Controller/UsersController.php
@@ -909,7 +909,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 ? $quota : 'none',
+ 'used' => 0
+ ];
}
return $data;
}