From b41ca8bacb8e1bdb9a28ab7e3e76b817262338d4 Mon Sep 17 00:00:00 2001 From: Robin Appelman <icewind1991@gmail.com> Date: Sun, 11 Dec 2011 23:23:59 +0100 Subject: [PATCH] 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 --- settings/ajax/setquota.php | 2 +- settings/js/users.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php index edbf5b7451..5c07285cfc 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 684fee21c6..18e7a9df10 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{ -- GitLab