// 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();
if (!is_array($aliases)) {
return null;
}
- $rel = Env::v('contacts');
+ $uf = new UserFilter(new UFC_Hrpid($aliases));
+ $users = $uf->iterUsers();
$ret = array();
- foreach ($aliases as $alias) {
- $ret[$alias] = $rel[$alias];
+ while ($user = $users->next()) {
+ $ret[] = $user->forlife;
}
return join(', ', $ret);
}
}
}
- $contacts = S::user()->getContacts();
+ $uf = new UserFilter(new PFC_And(new UFC_Contact(S::user()),
+ new UFC_Registered()),
+ UserFilter::sortByName());
+ $contacts = $uf->getProfiles();
$page->assign('contacts', $contacts);
$page->assign('maxsize', ini_get('upload_max_filesize') . 'o');
$page->assign('user', S::user());
$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'],