diff --git a/lib/fileproxy/quota.php b/lib/fileproxy/quota.php
index 94a49176ee6fbbe2424081fe61332bdcb1b6711f..9e4c2d0643e46201985d9341cddc2ec51e1683f9 100644
--- a/lib/fileproxy/quota.php
+++ b/lib/fileproxy/quota.php
@@ -26,11 +26,37 @@
  */
 
 class OC_FileProxy_Quota extends OC_FileProxy{
+	private $userQuota=-1;
+	
+	/**
+	 * get the quota for the current user
+	 * @return int
+	 */
+	private function getQuota(){
+		if($this->userQuota!=-1){
+			return $this->userQuota;
+		}
+		$userQuota=OC_Preferences::getValue(OC_User::getUser(),'files','quota','default');
+		if($userQuota=='default'){
+			$userQuota=OC_AppConfig::getValue('files','default_quota','none');
+		}
+		if($userQuota=='none'){
+			$this->userQuota=0;
+		}else{
+			$this->userQuota=OC_Helper::computerFileSize($userQuota);
+		}
+		return $this->userQuota;
+		
+	}
+	
+	/**
+	 * get the free space in the users home folder
+	 * @return int
+	 */
 	private function getFreeSpace(){
 		$rootInfo=OC_FileCache::get('');
 		$usedSpace=$rootInfo['size'];
-		$totalSpace=OC_Preferences::getValue(OC_User::getUser(),'files','quota',0);
-		$totalSpace=OC_Helper::computerFileSize($totalSpace);
+		$totalSpace=$this->getQuota();
 		if($totalSpace==0){
 			return 0;
 		}
diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php
index d4e3c58ac113d91f19fe8dd2ba72367c404dd402..7bfc65102c1858502f597e8f7e622c52335dc02f 100644
--- a/settings/ajax/setquota.php
+++ b/settings/ajax/setquota.php
@@ -8,8 +8,14 @@ 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);
+$quota=$_POST["quota"];
+if($quota!='none' and $quota!='default'){
+	$quota= OC_Helper::computerFileSize($quota);
+	$quota=OC_Helper::humanFileSize($quota);
+}
+if($quota==0){
+	$quota='default';
+}
 
 // Return Success story
 OC_Preferences::setValue($username,'files','quota',$quota);