Reformat examples
[platal.git] / modules / xnetlists.php
index 2a9ad7d..fbdde4e 100644 (file)
@@ -70,6 +70,9 @@ class XnetListsModule extends ListsModule
     {
         global $globals;
 
+        if (!$globals->asso('mail_domain')) {
+            return PL_NOT_FOUND;
+        }
         $this->prepare_client($page);
 
         $page->changeTpl('xnetlists/index.tpl');
@@ -113,6 +116,9 @@ class XnetListsModule extends ListsModule
     {
         global $globals;
 
+        if (!$globals->asso('mail_domain')) {
+            return PL_NOT_FOUND;
+        }
         $this->prepare_client($page);
 
         $page->changeTpl('xnetlists/create.tpl');
@@ -163,22 +169,22 @@ class XnetListsModule extends ListsModule
         XDB::execute('INSERT INTO x4dat.virtual (alias,type)
                                 VALUES({?},{?})', $liste.'@'.$dom, 'list');
         XDB::execute('INSERT INTO x4dat.virtual_redirect (vid,redirect)
-                                VALUES ({?}, {?})', mysql_insert_id(),
+                                VALUES ({?}, {?})', XDB::insertId(),
                                "$red+post@listes.polytechnique.org");
         XDB::execute('INSERT INTO x4dat.virtual (alias,type)
                                 VALUES({?},{?})', $liste.'-owner@'.$dom, 'list');
         XDB::execute('INSERT INTO x4dat.virtual_redirect (vid,redirect)
-                                VALUES ({?}, {?})', mysql_insert_id(),
+                                VALUES ({?}, {?})', XDB::insertId(),
                                "$red+owner@listes.polytechnique.org");
         XDB::execute('INSERT INTO x4dat.virtual (alias,type)
                                 VALUES({?},{?})', $liste.'-admin@'.$dom, 'list');
         XDB::execute('INSERT INTO x4dat.virtual_redirect (vid,redirect)
-                                VALUES ({?}, {?})', mysql_insert_id(),
+                                VALUES ({?}, {?})', XDB::insertId(),
                                "$red+admin@listes.polytechnique.org");
         XDB::execute('INSERT INTO x4dat.virtual (alias,type)
                                 VALUES({?},{?})', $liste.'-bounces@'.$dom, 'list');
         XDB::execute('INSERT INTO x4dat.virtual_redirect (vid,redirect)
-                                VALUES ({?}, {?})', mysql_insert_id(),
+                                VALUES ({?}, {?})', XDB::insertId(),
                                 "$red+bounces@listes.polytechnique.org");
 
         pl_redirect('lists/admin/'.$liste);
@@ -188,6 +194,9 @@ class XnetListsModule extends ListsModule
     {
         global $globals;
 
+        if (!$globals->asso('mail_domain')) {
+            return PL_NOT_FOUND;
+        }
         $this->prepare_client($page);
 
         $page->changeTpl('xnetlists/sync.tpl');
@@ -229,7 +238,9 @@ class XnetListsModule extends ListsModule
 
     function handler_aadmin(&$page, $lfull = null)
     {
-        if (is_null($lfull)) {
+        global $globals;
+
+        if (!$globals->asso('mail_domain') || is_null($lfull)) {
             return PL_NOT_FOUND;
         }
 
@@ -305,6 +316,9 @@ class XnetListsModule extends ListsModule
     {
         global $globals;
 
+        if (!$globals->asso('mail_domain')) {
+            return PL_NOT_FOUND;
+        }
         new_groupadmin_page('xnet/groupe/alias-create.tpl');
 
         if (!Post::has('submit')) {