From: Stéphane Jacob Date: Tue, 22 Jun 2010 20:26:58 +0000 (+0200) Subject: Fixes broken email processer. X-Git-Tag: xorg/1.0.0~102 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=e03a98e9e01313204a54ae0c0b45ab2ed0b08ee1;p=platal.git Fixes broken email processer. Signed-off-by: Stéphane Jacob --- 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'],