- fputcsv($csv, array('nom', 'promo', 'alias', 'bounce', 'nbmails', 'url'), ';');
- foreach ($broken_user_list as $alias => $mails) {
- $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)
- WHERE a.alias = {?}
- GROUP BY acc.uid", $alias);
-
- if ($x = $sel->fetchOneAssoc()) {
- if ($x['nb_mails'] == 0) {
- register_profile_update($x['user_id'], 'broken');
- }
- fputcsv($csv, array($x['fullname'], $x['promo'], $alias,
- join(',', $mails), $x['nb_mails'],
- 'https://www.polytechnique.org/marketing/broken/' . $alias), ';');
+ fputcsv($csv, array('nom', 'promo', 'bounces', 'nbmails', 'url', 'corps', 'job', 'networking'), ';');
+ $corpsList = DirEnum::getOptions(DirEnum::CURRENTCORPS);
+ foreach ($broken_user_list as $uid => $mails) {
+ $profile = Profile::get($uid);
+ $corps = $profile->getCorps();
+ $current_corps = ($corps && $corps->current) ? $corpsList[$corps->current] : '';
+ $jobs = $profile->getJobs();
+ $companies = array();
+ foreach ($jobs as $job) {
+ $companies[] = $job->company->name;
+ }
+ $networkings = $profile->getNetworking(Profile::NETWORKING_ALL);
+ $networking_list = array();
+ foreach ($networkings as $networking) {
+ $networking_list[] = $networking['address'];