Fix clear cache on X.net
[platal.git] / include / xnet / page.inc.php
index 5ab3069..8acc8eb 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   *
@@ -96,7 +96,7 @@ class XnetPage extends PlatalPage
             if ($perms->hasFlag('groupannu')) {
                 $sub['annuaire du groupe'] = "$dim/annuaire";
                 $sub['trombinoscope'] = "$dim/trombi";
-                $sub['carte'] = "$dim/geoloc";
+                $sub['planisphère'] = "$dim/geoloc";
             }
             if ($perms->hasFlag('groupmember')) {
                 if ($globals->asso('forum')) {
@@ -114,7 +114,7 @@ class XnetPage extends PlatalPage
             $menu[$globals->asso('nom')] = $sub;
         }
 
-        if (is_object($perms) && $perms->hasFlag('groupadmin')) {
+        if ($globals->asso() && is_object($perms) && $perms->hasFlag('groupadmin')) {
             $sub = array();
             $sub['modifier l\'accueil'] = "$dim/edit";
             $sub['gérer les annonces'] = "$dim/admin/announces";
@@ -125,13 +125,13 @@ class XnetPage extends PlatalPage
             }
             if (S::has_perms()) {
                 $sub['gérer les groupes'] = array('href' => 'admin', 'style' => 'color: gray;');
-                $sub['clear cache'] = array('href' => 'purge_cache', 'style' => 'color: gray;');
+                $sub['clear cache'] = array('href' => 'purge_cache?token=' . S::v('xsrf_token'), 'style' => 'color: gray;');
             }
             $menu['Administrer'] = $sub;
         } elseif (S::has_perms()) {
             $sub = array();
             $sub['gérer les groupes'] = 'admin';
-            $sub['clear cache'] = 'purge_cache';
+            $sub['clear cache'] = 'purge_cache?token=' . S::v('xsrf_token');
             $menu['Administrer'] = $sub;
         }