Skip to content
Snippets Groups Projects
Commit ccd9b566 authored by Robin Appelman's avatar Robin Appelman
Browse files

after editing a user quota, set the value of the quota field to how the server...

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
parent 1746cba2
Branches
No related tags found
No related merge requests found
...@@ -10,6 +10,6 @@ $quota= OC_Helper::computerFileSize($_POST["quota"]); ...@@ -10,6 +10,6 @@ $quota= OC_Helper::computerFileSize($_POST["quota"]);
// Return Success story // Return Success story
OC_Preferences::setValue($username,'files','quota',$quota); 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))));
?> ?>
...@@ -102,7 +102,10 @@ $(document).ready(function(){ ...@@ -102,7 +102,10 @@ $(document).ready(function(){
$.post( $.post(
OC.filePath('settings','ajax','setquota.php'), OC.filePath('settings','ajax','setquota.php'),
{username:uid,quota:$(this).val()}, {username:uid,quota:$(this).val()},
function(result){} function(result){
img.parent().children('span').text(result.data.quota)
alert(result.data.quota);
}
); );
input.blur(); input.blur();
}else{ }else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment