From e03a98e9e01313204a54ae0c0b45ab2ed0b08ee1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 22 Jun 2010 22:26:58 +0200 Subject: [PATCH] Fixes broken email processer. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- modules/email.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/email.php b/modules/email.php index cca8797..41e5d25 100644 --- a/modules/email.php +++ b/modules/email.php @@ -920,19 +920,21 @@ class EmailModule extends PLModule $sel = Xdb::query( "SELECT acc.uid, count(e.email) AS nb_mails, IFNULL(pd.public_name, acc.full_name) AS fullname, - IFNULL(pd.promo, 0) AS promo, - FROM aliases AS a - INNER JOIN accounts AS acc ON a.id = acc.uid - LEFT JOIN emails AS e ON (e.uid = acc.uid - AND FIND_IN_SET('active', e.flags) AND e.panne = 0) - LEFT JOIN account_profiles AS ap ON (acc.uid = ap.uid AND FIND_IN_SET('owner', ap.perms)) - LEFT JOIN profile_display AS pd ON (pd.pid = ap.pid) + IFNULL(pd.promo, 0) AS promo + FROM aliases AS a + INNER JOIN accounts AS acc ON (a.uid = acc.uid) + LEFT JOIN emails AS e ON (e.uid = acc.uid + AND FIND_IN_SET('active', e.flags) AND e.panne = 0) + LEFT JOIN account_profiles AS ap ON (acc.uid = ap.uid AND FIND_IN_SET('owner', ap.perms)) + LEFT JOIN profile_display AS pd ON (pd.pid = ap.pid) WHERE a.alias = {?} GROUP BY acc.uid", $alias); if ($x = $sel->fetchOneAssoc()) { if ($x['nb_mails'] == 0) { - register_profile_update($x['uid'], 'broken'); + $user = User::getSilentWithUID($x['uid']); + $profile = $user->profile(); + WatchProfileUpdate::register($profile, 'broken'); } fputcsv($csv, array($x['fullname'], $x['promo'], $alias, join(',', $mails), $x['nb_mails'], -- 2.1.4