- $globals->xdb->execute('INSERT INTO x4dat.virtual (alias,type)
- VALUES({?},{?})', $liste.'@'.$dom, 'list');
- $globals->xdb->execute('INSERT INTO x4dat.virtual_redirect (vid,redirect)
- VALUES ({?}, {?})', mysql_insert_id(),
- "$red+post@listes.polytechnique.org");
- $globals->xdb->execute('INSERT INTO x4dat.virtual (alias,type)
- VALUES({?},{?})', $liste.'-owner@'.$dom, 'list');
- $globals->xdb->execute('INSERT INTO x4dat.virtual_redirect (vid,redirect)
- VALUES ({?}, {?})', mysql_insert_id(),
- "$red+owner@listes.polytechnique.org");
- $globals->xdb->execute('INSERT INTO x4dat.virtual (alias,type)
- VALUES({?},{?})', $liste.'-admin@'.$dom, 'list');
- $globals->xdb->execute('INSERT INTO x4dat.virtual_redirect (vid,redirect)
- VALUES ({?}, {?})', mysql_insert_id(),
- "$red+admin@listes.polytechnique.org");
- $globals->xdb->execute('INSERT INTO x4dat.virtual (alias,type)
- VALUES({?},{?})', $liste.'-bounces@'.$dom, 'list');
- $globals->xdb->execute('INSERT INTO x4dat.virtual_redirect (vid,redirect)
- VALUES ({?}, {?})', mysql_insert_id(),
- "$red+bounces@listes.polytechnique.org");
-
- global $platal;
- redirect(smarty_function_rel().'/'.$platal->ns.'lists/admin/'.$liste);
+ foreach (array('', 'owner', 'admin', 'bounces', 'unsubscribe') as $app) {
+ $mdir = $app == '' ? '+post' : '+' . $app;
+ if (!empty($app)) {
+ $app = '-' . $app;
+ }
+ XDB::execute('INSERT INTO x4dat.virtual (alias,type)
+ VALUES({?},{?})', $liste. $app . '@'.$dom, 'list');
+ XDB::execute('INSERT INTO x4dat.virtual_redirect (vid,redirect)
+ VALUES ({?}, {?})', XDB::insertId(),
+ $red . $mdir . '@listes.polytechnique.org');
+ }
+
+ XDB::execute("UPDATE groupex.asso
+ SET flags = CONCAT_WS(',', IF(flags = '', NULL, flags), 'has_ml')
+ WHERE id = {?}",
+ $globals->asso('id'));
+
+ pl_redirect('lists/admin/'.$liste);