summaryrefslogtreecommitdiffstats
path: root/settings/ajax
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-12-14 01:16:14 +0100
committerRobin Appelman <icewind1991@gmail.com>2011-12-14 01:16:14 +0100
commit835d6a9b6e1be4eab22d138e0ef01e608a5597bf (patch)
tree9c8e20f506fef3c4de89b5f6dc9372aaece9d613 /settings/ajax
parenta9e94a34c9a80929d606c4d64711ad8ecaff35e0 (diff)
downloadnextcloud-server-835d6a9b6e1be4eab22d138e0ef01e608a5597bf.tar.gz
nextcloud-server-835d6a9b6e1be4eab22d138e0ef01e608a5597bf.zip
save quota in human readable format (42 MB), should prevent some of the overflow related problems
Diffstat (limited to 'settings/ajax')
-rw-r--r--settings/ajax/setquota.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php
index 5c07285cfca..d4e3c58ac11 100644
--- a/settings/ajax/setquota.php
+++ b/settings/ajax/setquota.php
@@ -6,10 +6,13 @@ require_once('../../lib/base.php');
OC_JSON::checkAdminUser();
$username = $_POST["username"];
+
+//make sure the quota is in the expected format
$quota= OC_Helper::computerFileSize($_POST["quota"]);
+$quota=OC_Helper::humanFileSize($quota);
// Return Success story
OC_Preferences::setValue($username,'files','quota',$quota);
-OC_JSON::success(array("data" => array( "username" => $username ,'quota'=>OC_Helper::humanFileSize($quota))));
+OC_JSON::success(array("data" => array( "username" => $username ,'quota'=>$quota)));
?>