X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Faxletter%2Faxletter.inc.php;h=385365e5c65c4c7192f27db211da170dbe6c37ec;hb=b20ef4deed1b6fa6334bc57c0166a88e2beac9e4;hp=a82eb6416469aef415c4d7179f2d7de74864ed93;hpb=756ff73fbb0cdd01cce2eda27ba18e1cc99bd735;p=platal.git diff --git a/modules/axletter/axletter.inc.php b/modules/axletter/axletter.inc.php index a82eb64..385365e 100644 --- a/modules/axletter/axletter.inc.php +++ b/modules/axletter/axletter.inc.php @@ -1,6 +1,6 @@ numRows()) { - $this->_id = null; - return; + throw new MailNotFound(); } $id = $res->fetchOneRow(); } @@ -99,7 +98,9 @@ class AXLetter extends MassMailer protected function getAllRecipients() { - return "SELECT ni.user_id, IF(ni.user_id = 0, ni.email, a.alias) AS alias, + global $globals; + return "SELECT ni.user_id, IF(ni.user_id = 0, NULL, u.hruid) AS hruid, + IF(ni.user_id = 0, ni.email, CONCAT(a.alias, '@{$globals->mail->domain}')) AS alias, IF(ni.user_id = 0, ni.prenom, u.prenom) AS prenom, IF(ni.user_id = 0, ni.nom, IF(u.nom_usage='', u.nom, u.nom_usage)) AS nom, FIND_IN_SET('femme', IF(ni.user_id = 0, ni.flag, u.flags)) AS sexe, @@ -111,7 +112,7 @@ class AXLetter extends MassMailer LEFT JOIN aliases AS a ON(u.user_id=a.id AND FIND_IN_SET('bestalias',a.flags)) LEFT JOIN emails AS e ON(e.uid=u.user_id AND e.flags='active') WHERE ni.last < {?} AND {$this->subscriptionWhere()} - AND (e.email IS NOT NULL OR ni.user_id = 0) + AND (e.email IS NOT NULL OR FIND_IN_SET('googleapps', u.mail_storage) OR ni.user_id = 0) GROUP BY u.user_id"; } @@ -225,7 +226,7 @@ class AXLetter extends MassMailer { $res = XDB::query("SELECT IF(short_name IS NULL, id, short_name) as id, date, subject AS titre FROM axletter - WHERE NOT (FIND_IN_SET('new', bits)) + WHERE NOT FIND_IN_SET('new', bits) AND NOT FIND_IN_SET('invalid', bits) ORDER BY date DESC"); return $res->fetchAllAssoc(); }