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
This commit is contained in:
Robin Appelman 2011-12-11 23:23:59 +01:00
parent 1746cba249
commit ccd9b56609
2 changed files with 6 additions and 3 deletions

View File

@ -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))));
?>

View File

@ -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{