From: Raphaël Barrois Date: Sun, 5 Sep 2010 15:16:37 +0000 (+0200) Subject: Fix axletter promo restriction. X-Git-Tag: xorg/1.0.1~15^2~11 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=69834218f84372802e2cb6839e82aab7367b2975;p=platal.git Fix axletter promo restriction. Signed-off-by: Raphaël Barrois --- diff --git a/include/massmailer.inc.php b/include/massmailer.inc.php index 269a570..c866f90 100644 --- a/include/massmailer.inc.php +++ b/include/massmailer.inc.php @@ -195,6 +195,8 @@ abstract class MassMailer INNER JOIN accounts AS a ON (ni.uid = a.uid) LEFT JOIN email_options AS eo ON (eo.uid = a.uid) LEFT JOIN emails AS e ON (e.uid = a.uid AND e.flags='active') + LEFT JOIN account_profiles AS ap ON (a.uid = ap.uid AND FIND_IN_SET('owner', ap.perms)) + LEFT JOIN profile_display AS pd ON (ap.pid = pd.pid) WHERE ni.last < {?} AND ({$this->subscriptionWhere()}) AND (e.email IS NOT NULL OR FIND_IN_SET('googleapps', eo.storage)) GROUP BY a.uid"; diff --git a/modules/axletter/axletter.inc.php b/modules/axletter/axletter.inc.php index 761724c..5297ac9 100644 --- a/modules/axletter/axletter.inc.php +++ b/modules/axletter/axletter.inc.php @@ -177,10 +177,10 @@ class AXLetter extends MassMailer } $where = array(); if ($this->_promo_min) { - $where[] = "((ni.uid = 0 AND ni.promo >= {$this->_promo_min}) OR (ni.uid != 0 AND u.promo >= {$this->_promo_min}))"; + $where[] = "((ni.uid = 0 AND ni.promo >= {$this->_promo_min}) OR (ni.uid != 0 AND pd.promo >= 'X{$this->_promo_min}'))"; } if ($this->_promo_max) { - $where[] = "((ni.uid = 0 AND ni.promo <= {$this->_promo_max}) OR (ni.uid != 0 AND u.promo <= {$this->_promo_max}))"; + $where[] = "((ni.uid = 0 AND ni.promo <= {$this->_promo_max}) OR (ni.uid != 0 AND pd.promo <= 'X{$this->_promo_max}'))"; } if ($this->_subset) { require_once("emails.inc.php");