diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2018-06-07 13:54:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-07 13:54:44 +0200 |
commit | 44c6d22b2222fa8f8107cef9718eefbb30434374 (patch) | |
tree | 803217afea4c3e64327aba30d559a07f5f69aed8 /apps | |
parent | 1ef32e0e5986fbabec5ae7364cc857706b41a23e (diff) | |
parent | 49145a78e9f6f5b185780997de909f3f88e0b676 (diff) | |
download | nextcloud-server-44c6d22b2222fa8f8107cef9718eefbb30434374.tar.gz nextcloud-server-44c6d22b2222fa8f8107cef9718eefbb30434374.zip |
Merge pull request #9616 from nextcloud/zero-quota-fix
Allow 0 quota by provisioning api
Diffstat (limited to 'apps')
-rw-r--r-- | apps/provisioning_api/lib/Controller/AUserData.php | 7 | ||||
-rw-r--r-- | apps/provisioning_api/lib/Controller/UsersController.php | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/apps/provisioning_api/lib/Controller/AUserData.php b/apps/provisioning_api/lib/Controller/AUserData.php index 7a90e7a0a48..348eea7c19b 100644 --- a/apps/provisioning_api/lib/Controller/AUserData.php +++ b/apps/provisioning_api/lib/Controller/AUserData.php @@ -174,9 +174,12 @@ abstract class AUserData extends OCSController { if ($user === null) { throw new OCSException('User does not exist', 101); } - $quota = OC_Helper::computerFileSize($user->getQuota()); + $quota = $user->getQuota(); + if ($quota !== 'none') { + $quota = OC_Helper::computerFileSize($quota); + } $data = [ - 'quota' => $quota ? $quota : 'none', + 'quota' => $quota !== false ? $quota : 'none', 'used' => 0 ]; } diff --git a/apps/provisioning_api/lib/Controller/UsersController.php b/apps/provisioning_api/lib/Controller/UsersController.php index 38d0e08ff8b..2e46492b842 100644 --- a/apps/provisioning_api/lib/Controller/UsersController.php +++ b/apps/provisioning_api/lib/Controller/UsersController.php @@ -487,9 +487,7 @@ class UsersController extends AUserData { if ($quota === false) { throw new OCSException('Invalid quota value '.$value, 103); } - if ($quota === 0) { - $quota = 'default'; - }else if ($quota === -1) { + if ($quota === -1) { $quota = 'none'; } else { $quota = \OCP\Util::humanFileSize($quota); |