quota cache fixes quota display error when editing user quota in admin panel (fuf\!)

This commit is contained in:
Benjamin Sonntag 2011-03-27 17:39:17 +00:00
parent 446ed8575d
commit bedb8ecabe
1 changed files with 3 additions and 3 deletions

View File

@ -126,9 +126,9 @@ class m_quota {
function getquota($ressource="") {
global $db,$err,$cuid,$get_quota_cache;
$err->log("quota","getquota",$ressource);
if (! empty($get_quota_cache) ) {
if (! empty($get_quota_cache[$cuid]) ) {
// This function is called many time each webpage, so I cache the result
$this->quotas = $get_quota_cache;
$this->quotas = $get_quota_cache[$cuid];
} else {
$this->qlist(); // Generate the quota list.
$db->query("select * from quotas where uid='$cuid';");
@ -152,7 +152,7 @@ class m_quota {
exec("/usr/lib/alternc/quota_get ".$cuid." ".$val,$a);
$this->quotas[$val]=array("t"=>$a[1],"u"=>$a[0]);
}
$get_quota_cache = $this->quotas;
$get_quota_cache[$cuid] = $this->quotas;
}
if ($ressource) {