- return 1;
- }
-
- $list = new MMList(S::v('uid'), S::v('password'), $this->domain);
- $ret = $list->create_list($this->liste, utf8_decode($this->desc), $this->advertise,
- $this->modlevel, $this->inslevel,
- $this->owners, $this->members);
- $liste = strtolower($this->liste);
- if ($ret && !$this->asso) {
- foreach(Array($liste, $liste . "-owner", $liste . "-admin", $liste . "-bounces", $liste . "-unsubscribe") as $l) {
- XDB::execute("INSERT INTO aliases (alias,type) VALUES({?}, 'liste')", $l);
- }
- } elseif ($ret) {
- foreach (Array('', 'owner', 'admin', 'bounces', 'unsubscribe') as $app) {
- $mdir = $app == '' ? '+post' : '+' . $app;
- if (!empty($app)) {
- $app = '-' . $app;
- }
- $red = $this->domain . '_' . $liste;
- XDB::execute('INSERT INTO x4dat.virtual (alias,type)
- VALUES({?},{?})', $liste . $app . '@' . $this->domain, 'list');
- XDB::execute('INSERT INTO x4dat.virtual_redirect (vid,redirect)
- VALUES ({?}, {?})', XDB::insertId(),
- $red . $mdir . '@listes.polytechnique.org');
- $list->mass_subscribe($liste, join(' ', $this->members));
+ } else {
+ $list = new MMList(S::user(), $this->domain);
+ $success = $list->create_list($this->liste, utf8_decode($this->desc), $this->advertise,
+ $this->modlevel, $this->inslevel,
+ $this->owners, $this->members);
+ if ($success) {
+ create_list($this->liste, $this->domain);