From: Stéphane Jacob Date: Tue, 22 Jun 2010 21:10:28 +0000 (+0200) Subject: Fixes email notification to the group admins when a user subscribed to the group. X-Git-Tag: xorg/1.0.0~99 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=ae775de9c2e35e007369e2c5107ba7d3bbd772fe;p=platal.git Fixes email notification to the group admins when a user subscribed to the group. Signed-off-by: Stéphane Jacob --- diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 28d1dd3..413fd2a 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -477,16 +477,13 @@ class XnetGrpModule extends PLModule XDB::execute("INSERT INTO group_member_sub_requests (asso_id, uid, ts, reason) VALUES ({?}, {?}, NOW(), {?})", $globals->asso('id'), S::i('uid'), Post::v('message')); - $res = XDB::query('SELECT IF(m.email IS NULL, - CONCAT(al.alias,"@polytechnique.org"), - m.email) - FROM group_members AS m - INNER JOIN aliases AS al ON (al.type = "a_vie" - AND al.uid = m.uid) - WHERE perms="admin" AND m.asso_id = {?}', - $globals->asso('id')); - $emails = $res->fetchColumn(); - $to = implode(',', $emails); + $uf = New UserFilter(New UFC_Group($globals->asso('id'), true)); + $admins = $uf->iterUsers(); + $admin = $admins->next(); + $to = $admin->bestalias; + while ($admin = $admins->next()) { + $to .= ', ' . $admin->bestalias; + } $append = "\n" . "-- \n"