From: Robin Appelman Date: Sun, 11 Dec 2011 22:23:59 +0000 (+0100) Subject: after editing a user quota, set the value of the quota field to how the server parsed... X-Git-Tag: v3.0~80^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ccd9b56609ceb0d5f8470c386702751acfb49994;p=nextcloud-server.git after editing a user quota, set the value of the quota field to how the server parsed the input, not the user input this way the user can see when an invalid input is given --- diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php index edbf5b74516..5c07285cfca 100644 --- a/settings/ajax/setquota.php +++ b/settings/ajax/setquota.php @@ -10,6 +10,6 @@ $quota= OC_Helper::computerFileSize($_POST["quota"]); // Return Success story OC_Preferences::setValue($username,'files','quota',$quota); -OC_JSON::success(array("data" => array( "username" => $username ,'quota'=>$quota))); +OC_JSON::success(array("data" => array( "username" => $username ,'quota'=>OC_Helper::humanFileSize($quota)))); ?> diff --git a/settings/js/users.js b/settings/js/users.js index 684fee21c64..18e7a9df104 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -101,8 +101,11 @@ $(document).ready(function(){ if($(this).val().length>0){ $.post( OC.filePath('settings','ajax','setquota.php'), - {username:uid,quota:$(this).val()}, - function(result){} + {username:uid,quota:$(this).val()}, + function(result){ + img.parent().children('span').text(result.data.quota) + alert(result.data.quota); + } ); input.blur(); }else{