Remove xnet manuel... ==> wiki
[platal.git] / modules / xnet.php
index 565c7f3..165ccf1 100644 (file)
@@ -32,7 +32,6 @@ class XnetModule extends PLModule
             'article16' => $this->make_hook('article16', AUTH_PUBLIC),
             'creategpx' => $this->make_hook('creategpx', AUTH_PUBLIC),
             'services'  => $this->make_hook('services',  AUTH_PUBLIC),
-            'manuel'    => $this->make_hook('manuel',    AUTH_PUBLIC),
 
             'admin'     => $this->make_hook('admin',     AUTH_MDP, 'admin'),
             'groups'    => $this->make_hook('groups',    AUTH_PUBLIC),
@@ -83,23 +82,15 @@ class XnetModule extends PLModule
         $page->useMenu();
     }
 
-    function handler_manuel(&$page)
-    {
-        $page->changeTpl('xnet/manuel.tpl');
-        $page->useMenu();
-    }
-
     function handler_admin(&$page)
     {
-        global $globals;
-
         new_admin_page('xnet/admin.tpl');
         $page->useMenu();
 
         if (Get::has('del')) {
             $res = XDB::query('SELECT id, nom, mail_domain
                                            FROM groupex.asso WHERE diminutif={?}',
-                                        Get::get('del'));
+                                        Get::v('del'));
             list($id, $nom, $domain) = $res->fetchOneRow();
             $page->assign('nom', $nom);
             if ($id && Post::has('del')) {
@@ -114,7 +105,7 @@ class XnetModule extends PLModule
                     $page->trig('suppression des alias mails');
 
                     require_once('lists.inc.php');
-                    $client =& lists_xmlrpc(Session::getInt('uid'), Session::get('password'), $domain);
+                    $client =& lists_xmlrpc(S::v('uid'), S::v('password'), $domain);
                     if ($listes = $client->get_lists()) {
                         foreach ($listes as $l) {
                             $client->delete_list($l['list'], true);
@@ -134,8 +125,8 @@ class XnetModule extends PLModule
 
         if (Post::has('diminutif')) {
             XDB::query('INSERT INTO groupex.asso (id,diminutif)
-                                 VALUES(NULL,{?})', Post::get('diminutif'));
-            redirect(Post::get('diminutif').'/edit');
+                                 VALUES(NULL,{?})', Post::v('diminutif'));
+            pl_redirect('../'.Post::v('diminutif').'/edit');
         }
 
         $res = XDB::query('SELECT nom,diminutif FROM groupex.asso ORDER by NOM');
@@ -144,8 +135,6 @@ class XnetModule extends PLModule
 
     function handler_plan(&$page)
     {
-        global $globals;
-
         $page->changeTpl('xnet/plan.tpl');
 
         $page->setType('plan');
@@ -183,17 +172,16 @@ class XnetModule extends PLModule
                   WHERE  FIND_IN_SET("Institutions", cat)
                ORDER BY  diminutif');
         $page->assign('inst', $res);
+        $page->useMenu();
     }
 
     function handler_groups2(&$page)
     {
-        $this->handler_groups(&$page, Get::get('cat'), Get::get('dom'));
+        $this->handler_groups(&$page, Get::v('cat'), Get::v('dom'));
     }
 
     function handler_groups(&$page, $cat = null, $dom = null)
     {
-        global $globals;
-
         if (!$cat) {
             $this->handler_index(&$page);
         }
@@ -205,21 +193,22 @@ class XnetModule extends PLModule
         $page->assign('dom', $dom);
 
         $res  = XDB::query("SELECT id,nom FROM groupex.dom
-                                       WHERE FIND_IN_SET({?}, cat) ORDER BY nom", $cat);
+                             WHERE FIND_IN_SET({?}, cat)
+                          ORDER BY nom", $cat);
         $doms = $res->fetchAllAssoc();
         $page->assign('doms', $doms);
 
         if (empty($doms)) {
-            $res = XDB::iterator("SELECT diminutif, nom FROM groupex.asso
-                                             WHERE FIND_IN_SET({?}, cat) ORDER BY nom", $cat);
+            $res = XDB::query("SELECT diminutif, nom FROM groupex.asso
+                                   WHERE FIND_IN_SET({?}, cat)
+                                ORDER BY nom", $cat);
+            $page->assign('gps', $res->fetchAllAssoc());
         } elseif (!is_null($dom)) {
-            $res = XDB::iterator("SELECT diminutif, nom FROM groupex.asso
-                                             WHERE FIND_IN_SET({?}, cat) AND dom={?}
-                                          ORDER BY nom", $cat, $dom);
-        } else {
-            $res = null;
+            $res = XDB::query("SELECT diminutif, nom FROM groupex.asso
+                                WHERE FIND_IN_SET({?}, cat) AND dom={?}
+                             ORDER BY nom", $cat, $dom);
+            $page->assign('gps', $res->fetchAllAssoc());
         }
-        $page->assign('gps', $res);
 
         $page->useMenu();
         $page->setType($cat);