+ $user_same_email = get_infos($user['email']);
+ $domain = $globals->asso('mail_domain');
+
+ if (!$domain || !empty($user_same_email)) {
+ return true;
+ }
+
+ $mmlist = new MMList(S::v('uid'), S::v('password'), $domain);
+ $listes = $mmlist->get_lists($user['email2']);
+
+ $may_update = may_update();
+ $warning = false;
+ foreach ($listes as $liste) {
+ if ($liste['sub'] == 2) {
+ if ($may_update) {
+ $mmlist->mass_unsubscribe($liste['list'], Array($user['email2']));
+ } else {
+ $mmlist->unsubscribe($liste['list']);
+ }
+ } elseif ($liste['sub']) {
+ $page->trig("{$user['prenom']} {$user['nom']} a une"
+ ." demande d'inscription en cours sur la"
+ ." liste {$liste['list']}@ !");
+ $warning = true;
+ }
+ }
+
+ XDB::execute(
+ "DELETE FROM virtual_redirect
+ USING virtual_redirect
+ INNER JOIN virtual USING(vid)
+ WHERE redirect={?} AND alias LIKE {?}", $user['email'], '%@'.$domain);
+ return !$warning;
+ }
+
+ function handler_unsubscribe(&$page)
+ {
+ $page->changeTpl('xnetgrp/membres-del.tpl');
+ $user = get_infos(S::v('forlife'));