From e86ed4499d84d91acab0b5eaf509cac8cb4c8709 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Mon, 25 Jan 2021 20:04:40 +0000 Subject: [PATCH] this might fix update_quota.pl to work with teh quota2 table --- ADDITIONS/quota_usage.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ADDITIONS/quota_usage.pl b/ADDITIONS/quota_usage.pl index ad91769a..2dbe06af 100644 --- a/ADDITIONS/quota_usage.pl +++ b/ADDITIONS/quota_usage.pl @@ -86,7 +86,11 @@ sub list_quota_usage { $usage = $usage + 500; $usage = int $usage / 1000; } - if($insert_db == 1){execSql("UPDATE mailbox set quota_usage = $usage, quota_usage_date = CAST(NOW() AS DATE) WHERE username = '$email'");} + + if($insert_db == 1) + { + execSql("INSERT INTO quota2 (username, bytes) values ('$email', $usage) ON DUPLICATE KEY UPDATE bytes = VALUES(bytes)"); + } print_list() if ($list == 1); } @@ -144,8 +148,4 @@ sub help { print "$0 [options...]\n"; print "-l|--list List quota used\n"; print "-i|--addmysql For insert quota used in database mysql\n"; - } - - -