diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-12-12 02:23:59 +0400 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-12-12 02:34:13 +0400 |
commit | ccd9b56609ceb0d5f8470c386702751acfb49994 (patch) | |
tree | ab1e9e7f9239512261abe1530e38261065d38a9d /settings | |
parent | 1746cba249328d92cf22bd81e367dd35dabed60c (diff) |
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
Diffstat (limited to 'settings')
-rw-r--r-- | settings/ajax/setquota.php | 2 | ||||
-rw-r--r-- | 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 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{ |