X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Femail.php;h=41e5d2518914a7f893010c121d3f8e4bfd322bee;hb=9483a7c7e923556fcafbe5154910dcc53a8e3d5a;hp=f7cedd5a81a44f70678a439f35fc789d14f9aacd;hpb=0073747ac81cc9cff9e43847eb008f0e815255f0;p=platal.git diff --git a/modules/email.php b/modules/email.php index f7cedd5..41e5d25 100644 --- a/modules/email.php +++ b/modules/email.php @@ -131,6 +131,9 @@ class EmailModule extends PLModule // Fetch existing @alias_dom aliases. $alias = $user->emailAlias(); $visibility = $user->hasProfile() && $user->profile()->alias_pub; + $page->assign('actuel', $alias); + $page->assign('user', $user); + $page->assign('mail_public', $visibility); if ($action == 'ask' && Env::has('alias') && Env::has('raison')) { S::assert_xsrf_token(); @@ -917,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'],