Hello everyone,

I recently upgraded to base 1.2.17b and everything went fine except for the FTP server that couldn't start.
I tweaked the file a little and produced a dirty patch with code from previous BASE release (patch included).
This is maybe not the best way to do it, but it's working...

Anyways, thansk for the job, BASE is great !

Bertrand
diff -Naur base-1.2.17.ORI/include/classes/user.inc.php base-1.2.17/include/classes/user.inc.php
--- base-1.2.17.ORI/include/classes/user.inc.php	2005-11-10 13:26:03.000000000 -0500
+++ base-1.2.17/include/classes/user.inc.php	2005-11-23 14:06:59.000000000 -0500
@@ -644,6 +644,10 @@
 	{
 		return $this->activeUntil;
 	}
+	function getFileQuota()
+        {
+                return $this->fileQuota;
+        }
 	function getLastExperiment()
 	{
 		return $this->lastExperiment;
@@ -794,6 +798,22 @@
 		return $arr;
 	}
 
+        // Returns the total size of uploads, in bytes.
+        function getQuotaUsedForId($userid)
+        {
+                $query = "SELECT SUM(`fileSize`) FROM Upload ".
+                         "WHERE owner = ".(int)$userid." AND removed = 0";
+                $res = query($query);
+                if($row =& db_fetch_row($res))
+                        return (float)$row[0];
+                return 0;
+        }
+
+        function getQuotaUsed()
+        {
+                return $this->getQuotaUsedForId($this->id);
+        }
+
 	function addToGroup($account, $group, $reviewer)
 	{
 		$keys = array("parent", "child");

Reply via email to