Modifies database structure for phones
[platal.git] / include / validations / listes.inc.php
index cd7356d..47471e4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2007 Polytechnique.org                              *
+ *  Copyright (C) 2003-2008 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,7 +24,7 @@
 class ListeReq extends Validate
 {
     // {{{ properties
-    
+
     public $liste;
     public $desc;
 
@@ -39,12 +39,12 @@ class ListeReq extends Validate
         Refuser également des listes qui pourraient nous servir (admin, postmaster,...)";
     // }}}
     // {{{ constructor
-    
+
     public function __construct($_uid, $_liste, $_desc, $_advertise, $_modlevel,
                                 $_inslevel, $_owners, $_members, $_stamp=0)
     {
-        parent::__construct($_uid, true, 'liste', $_stamp);
-        
+        parent::__construct($_uid, false, 'liste', $_stamp);
+
         $this->liste     = $_liste;
         $this->desc      = $_desc;
         $this->advertise = $_advertise;
@@ -107,12 +107,12 @@ class ListeReq extends Validate
     public function commit()
     {
         $list = new MMList(S::v('uid'), S::v('password'));
-        $ret = $list->create_list($this->liste, $this->desc, $this->advertise,
+        $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) {
-            foreach(Array($liste, $liste."-owner", $liste."-admin", $liste."-bounces") as $l) {
+            foreach(Array($liste, $liste."-owner", $liste."-admin", $liste."-bounces", $liste."-unsubscribe") as $l) {
                 XDB::execute("INSERT INTO aliases (alias,type) VALUES({?}, 'liste')", $l);
             }
         }