diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-05-26 10:51:24 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-06-07 11:30:37 +0200 |
commit | da583f05fce25a7f2ffadf54509b820bb7bc61e6 (patch) | |
tree | f7297714c5af2bddaa1cf8e1af33c2ebdc8ab036 /apps/provisioning_api | |
parent | 132597bbd3e3e1633fa83c77c268242d5c59a4f4 (diff) | |
download | nextcloud-server-da583f05fce25a7f2ffadf54509b820bb7bc61e6.tar.gz nextcloud-server-da583f05fce25a7f2ffadf54509b820bb7bc61e6.zip |
Allow 0 quota by provisioning api
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/provisioning_api')
-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); |