Skip to content

Commit

Permalink
Merge pull request #30755 from owncloud/backport/bugfix/owncloud#19811
Browse files Browse the repository at this point in the history
fixes #19811 - only use existing key words 'default' and 'none' as ma…
  • Loading branch information
Vincent Petry authored Mar 13, 2018
2 parents f833582 + 249ebb6 commit d890c82
Show file tree
Hide file tree
Showing 2 changed files with 190 additions and 175 deletions.
10 changes: 2 additions & 8 deletions apps/provisioning_api/lib/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public function editUser($parameters) {
break;
case 'quota':
$quota = $parameters['_put']['value'];
if($quota !== 'none' and $quota !== 'default') {
if($quota !== 'none' && $quota !== 'default') {
if (is_numeric($quota)) {
$quota = floatval($quota);
} else {
Expand All @@ -286,13 +286,7 @@ public function editUser($parameters) {
if ($quota === false) {
return new Result(null, 103, "Invalid quota value {$parameters['_put']['value']}");
}
if($quota === 0) {
$quota = 'default';
}else if($quota === -1) {
$quota = 'none';
} else {
$quota = Util::humanFileSize($quota);
}
$quota = Util::humanFileSize($quota);
}
$targetUser->setQuota($quota);
break;
Expand Down
Loading

0 comments on commit d890c82

Please sign in to comment.