From 4eaf0d98b9ce8b070b181e6232c75e544a22595b Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sun, 25 Jun 2017 14:46:21 +0200 Subject: [PATCH] Fix broadcast-message queries to work with postgresql This is a follow-up fix as discussed on https://github.com/postfixadmin/postfixadmin/pull/50 --- broadcast-message.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/broadcast-message.php b/broadcast-message.php index bd606061..9101276b 100644 --- a/broadcast-message.php +++ b/broadcast-message.php @@ -61,9 +61,9 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") $recipients = []; - $q = "SELECT username, active from $table_mailbox WHERE active=1 AND ".db_in_clause("domain", $wanted_domains); + $q = "SELECT username from $table_mailbox WHERE active='" . db_get_boolean(true) . "' AND ".db_in_clause("domain", $wanted_domains); if (intval(safepost('mailboxes_only')) == 0) { - $q .= " UNION SELECT goto, active FROM $table_alias WHERE ".db_in_clause("domain", $wanted_domains)."AND goto NOT IN ($q)"; + $q .= " UNION SELECT goto FROM $table_alias WHERE active='" . db_get_boolean(true) . "' AND ".db_in_clause("domain", $wanted_domains)."AND goto NOT IN ($q)"; } $result = db_query($q); if($result['rows'] > 0) {