Merge branch 'platal-0.9.16'
[platal.git] / modules / xnet.php
index 1f30778..c8e5611 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   *
@@ -56,7 +56,7 @@ class XnetModule extends PLModule
         }
         exit;
     }
-    
+
     function handler_index(&$page)
     {
         $page->nomenu = true;
@@ -72,7 +72,7 @@ class XnetModule extends PLModule
 
     function handler_admin(&$page)
     {
-        new_admin_page('xnet/admin.tpl');
+        $page->changeTpl('xnet/admin.tpl');
 
         if (Get::has('del')) {
             $res = XDB::query('SELECT id, nom, mail_domain
@@ -81,6 +81,8 @@ class XnetModule extends PLModule
             list($id, $nom, $domain) = $res->fetchOneRow();
             $page->assign('nom', $nom);
             if ($id && Post::has('del')) {
+                S::assert_xsrf_token();
+
                 XDB::query('DELETE FROM groupex.membres WHERE asso_id={?}', $id);
                 $page->trig('membres supprimés');
 
@@ -110,6 +112,8 @@ class XnetModule extends PLModule
         }
 
         if (Post::has('diminutif')) {
+            S::assert_xsrf_token();
+
             XDB::query('INSERT INTO groupex.asso (id,diminutif)
                                  VALUES(NULL,{?})', Post::v('diminutif'));
             pl_redirect('../'.Post::v('diminutif').'/edit');
@@ -197,7 +201,7 @@ class XnetModule extends PLModule
 
         $page->setType($cat);
     }
-    
+
     function handler_autologin(&$page)
     {
         $allkeys = func_get_args();