From 8151aed33823bd3b6ed1e8b1de62694937c0eb91 Mon Sep 17 00:00:00 2001 From: Phoenix Eve Aspacio Date: Sun, 26 Feb 2017 16:19:27 +0800 Subject: [PATCH] Incorrect mysql statement --- data/web/inc/functions.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/web/inc/functions.inc.php b/data/web/inc/functions.inc.php index 0311671c..7c83484b 100644 --- a/data/web/inc/functions.inc.php +++ b/data/web/inc/functions.inc.php @@ -1725,6 +1725,7 @@ function get_domain_admins() { } function get_domain_admin_details($domain_admin) { global $pdo; + global $lang; $domainadmindata = array(); if (isset($domain_admin) && $_SESSION['mailcow_cc_role'] != "admin") { @@ -4349,8 +4350,8 @@ function mailbox_get_mailbox_details($mailbox) { $stmt->execute(array(':domain' => $row['domain'], ':username' => $mailbox)); $MailboxUsage = $stmt->fetch(PDO::FETCH_ASSOC); - $stmt = $pdo->prepare("SELECT IFNULL(COUNT(`address`), 0) AS `sa_count` FROM `spamalias` WHERE `address` = :address"); - $stmt->execute(array(':address' => $mailbox)); + $stmt = $pdo->prepare("SELECT IFNULL(COUNT(`address`), 0) AS `sa_count` FROM `spamalias` WHERE `goto` = :address AND `validity` >= :unixnow"); + $stmt->execute(array(':address' => $mailbox, ':unixnow' => time())); $SpamaliasUsage = $stmt->fetch(PDO::FETCH_ASSOC); $mailboxdata['max_new_quota'] = ($DomainQuota['quota'] * 1048576) - $MailboxUsage['in_use'];