Merge branch 'platal-0.9.16'
[platal.git] / modules / xnet.php
index b1dd12b..c8e5611 100644 (file)
@@ -80,7 +80,9 @@ class XnetModule extends PLModule
                                         Get::v('del'));
             list($id, $nom, $domain) = $res->fetchOneRow();
             $page->assign('nom', $nom);
-            if ($id && Post::has('del') && S::has_xsrf_token()) {
+            if ($id && Post::has('del')) {
+                S::assert_xsrf_token();
+
                 XDB::query('DELETE FROM groupex.membres WHERE asso_id={?}', $id);
                 $page->trig('membres supprimés');
 
@@ -103,20 +105,18 @@ class XnetModule extends PLModule
                 XDB::query('DELETE FROM groupex.asso WHERE id={?}', $id);
                 $page->trig("Groupe $nom supprimé");
                 Get::kill('del');
-            } else if ($id && Post::has('del')) {
-                $page->trig("La suppression du groupe X a échouée, merci de réssayer.");
             }
             if (!$id) {
                 Get::kill('del');
             }
         }
 
-        if (Post::has('diminutif') && S::has_xsrf_token()) {
+        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');
-        } else if (Post::has('diminutif')) {
-            $page->trig("L'ajout du groupe X a échoué, merci de réssayer.");
         }
 
         $res = XDB::query('SELECT nom,diminutif FROM groupex.asso ORDER by NOM');