- $membres = array_map(create_function('$str', 'return "\"$str\"";'), $membres);
- $membres = join(',', $membres);
- $res = XDB::query(
- 'SELECT IF(u.nom <> "", u.nom, m.nom) AS nom,
- IF(u.prenom <> "", u.prenom, m.prenom) AS prenom,
- IF(m.email <> "", m.email, CONCAT(a.alias, "@polytechnique.org")) as email,
- IF(m.sexe IS NULL, FIND_IN_SET("femme", u.flags), m.sexe) AS sexe
- FROM groupex.membres AS m
- LEFT JOIN auth_user_md5 AS u ON (m.uid=u.user_id AND m.uid<50000)
- LEFT JOIN aliases AS a ON (a.id=u.user_id and a.type="a_vie")
- WHERE asso_id = {?}
- AND m.origine IN (' . $membres . ')
- AND (m.email <> "" OR u.perms <> "pending")', $globals->asso('id'));
- $tos = $res->fetchAllAssoc();