quota cache fixes quota display error when editing user quota in admin panel (fuf\!)
This commit is contained in:
parent
446ed8575d
commit
bedb8ecabe
|
@ -126,9 +126,9 @@ class m_quota {
|
||||||
function getquota($ressource="") {
|
function getquota($ressource="") {
|
||||||
global $db,$err,$cuid,$get_quota_cache;
|
global $db,$err,$cuid,$get_quota_cache;
|
||||||
$err->log("quota","getquota",$ressource);
|
$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 function is called many time each webpage, so I cache the result
|
||||||
$this->quotas = $get_quota_cache;
|
$this->quotas = $get_quota_cache[$cuid];
|
||||||
} else {
|
} else {
|
||||||
$this->qlist(); // Generate the quota list.
|
$this->qlist(); // Generate the quota list.
|
||||||
$db->query("select * from quotas where uid='$cuid';");
|
$db->query("select * from quotas where uid='$cuid';");
|
||||||
|
@ -152,7 +152,7 @@ class m_quota {
|
||||||
exec("/usr/lib/alternc/quota_get ".$cuid." ".$val,$a);
|
exec("/usr/lib/alternc/quota_get ".$cuid." ".$val,$a);
|
||||||
$this->quotas[$val]=array("t"=>$a[1],"u"=>$a[0]);
|
$this->quotas[$val]=array("t"=>$a[1],"u"=>$a[0]);
|
||||||
}
|
}
|
||||||
$get_quota_cache = $this->quotas;
|
$get_quota_cache[$cuid] = $this->quotas;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ressource) {
|
if ($ressource) {
|
||||||
|
|
Loading…
Reference in New Issue