Newone.php applique les quotas de manière standart.

This commit is contained in:
Alan Garcia 2012-10-16 09:30:58 +00:00
parent fb514b928c
commit 5c7653670d
2 changed files with 3 additions and 5 deletions

View File

@ -95,7 +95,7 @@ class m_quota {
global $db,$err;
$err->log("quota","apply_greater_quota");
$q="insert into quotas select m.uid as uid, d.quota as name, d.value as total from membres m, defquotas d left join quotas q on q.name=d.quota where m.type=d.type ON DUPLICATE KEY UPDATE total = greatest(d.value, quotas.total);";
$db->query($q);
if (!$db->query($q)) return false;
return true;
}

View File

@ -53,11 +53,9 @@ if(!$db->query("update membres set su=1 where login='admin';"))
exit(1);
// On lui attribue des quotas par defaut
// 10 domains, 10 stats, 10 bases mysql, 20 ftp et 100 emails
if(!($db->query("update quotas,membres set quotas.total=10 where (quotas.name='stats' or quotas.name='sta2' or quotas.name='mysql' or quotas.name='dom') and quotas.uid=membres.uid and membres.login='admin' ;")
&& $db->query("update quotas,membres set quotas.total=20 where quotas.name='ftp' and quotas.uid=membres.uid and membres.login='admin' ;")
&& $db->query("update quotas,membres set quotas.total=100 where quotas.name='mail' and quotas.uid=membres.uid and membres.login='admin' ;")))
if(!$quota->synchronise_user_profile()) {
exit(1);
}
exit(0);
?>