- elseif ($short_name && !$infos['short_name']) {
- // if we have a first new short_name create the lists
- //
- $globals->xdb->execute("INSERT INTO virtual SET type = 'evt', alias = {?}",
- $short_name."-participants@".$globals->xnet->evts_domain);
-
- $res = $globals->xdb->query("SELECT LAST_INSERT_ID()");
- $globals->xdb->execute("INSERT INTO virtual_redirect (
- SELECT {?} AS vid, IF(u.nom IS NULL, m.email, CONCAT(a.alias, {?})) AS redirect
- FROM groupex.evenements_participants AS ep
- LEFT JOIN groupex.membres AS m ON (ep.uid = m.uid)
- LEFT JOIN auth_user_md5 AS u ON (u.user_id = ep.uid)
- LEFT JOIN aliases AS a ON (a.id = ep.uid AND a.type = 'a_vie')
- WHERE ep.eid = {?}
- GROUP BY ep.uid)",
- $res->fetchOneCell(), "@".$globals->mail->domain, $eid);
-
- $globals->xdb->execute("INSERT INTO virtual SET type = 'evt', alias = {?}",
- $short_name."-absents@".$globals->xnet->evts_domain);
-
- $res = $globals->xdb->query("SELECT LAST_INSERT_ID()");
- $globals->xdb->execute("INSERT INTO virtual_redirect (
- SELECT {?} AS vid, IF(u.nom IS NULL, m.email, CONCAT(a.alias, {?})) AS redirect
- FROM groupex.membres AS m
- LEFT JOIN groupex.evenements_participants AS ep ON (ep.uid = m.uid)
- LEFT JOIN auth_user_md5 AS u ON (u.user_id = m.uid)
- LEFT JOIN aliases AS a ON (a.id = m.uid AND a.type = 'a_vie')
- WHERE m.asso_id = {?} AND ep.uid IS NULL
- GROUP BY m.uid)",
- $res->fetchOneCell(), "@".$globals->mail->domain, $globals->asso('id'));
- }
- elseif (!$short_name && $infos['short_name']) {
- // if we delete the old short name, delete the lists
- $globals->xdb->execute("DELETE virtual, virtual_redirect FROM virtual
- LEFT JOIN virtual_redirect USING(vid)
- WHERE virtual.alias LIKE {?}",
- $infos['short_name']."-%");