epnadmin-fr
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Epnadmin-fr] CVS: epnadmin config.php,NONE,1.1 constantes.inc.php,1.20


From: Loïc Dayot
Subject: [Epnadmin-fr] CVS: epnadmin config.php,NONE,1.1 constantes.inc.php,1.20,1.21 entete.inc.php,1.19,1.20 fr.lang.inc.php,1.4,1.5 localisations.php,1.4,1.5 logiciels.php,1.5,1.6 materiels.php,1.7,1.8 mysql.inc.php,1.2,1.3 structures.inc.php,1.4,1.5 structures.php,1.7,1.8
Date: Tue, 04 Feb 2003 18:32:01 -0500

Update of /cvsroot/epnadmin/epnadmin
In directory subversions:/tmp/cvs-serv8567/epnadmin

Modified Files:
        constantes.inc.php entete.inc.php fr.lang.inc.php 
        localisations.php logiciels.php materiels.php mysql.inc.php 
        structures.inc.php structures.php 
Added Files:
        config.php 
Log Message:
La modularisation est bien avancée.
Du coup, comme ça me parraissait important, début d'une procédure de 
configuration pas à pas.



--- NEW FILE ---
<?
/*
    Copyright (C) 2003 Loïc Dayot - Mairie de Pierrefitte (93)

    EPNadmin - Version 0.6

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

    http://epnadmin.pierrefitte93.fr/
*/

require_once("constantes.inc.php");             // définition des constantes
//require_once("fonctions.inc.php");              // concernant des fonctions 
transversales inclassables
//require_once("mysql.inc.php");                  // concernant mysql
//require_once("sessions.inc.php");             // concernant les sessions et 
initiations
//require_once("usagers.inc.php");              // concernant la gestion des 
usagers
//require_once("reservations.inc.php");         // concernant les réservations 
des postes en accès individuel par des usagers
//require_once("tableaux.inc.php");             // Concernant l'affichage 
transposé d'un tableau
//require_once("siteweb.inc.php");              // concernant les pages perso 
des usagers et les sites web des structures
//require_once("dateheure.inc.php");            // concernant la manipulation 
des heures et des dates, formulaire, conversion...
//require_once("structures.inc.php");           // concernant les structures
//require_once("initiations.inc.php");          // concernant les initiations 
et les thèmes
//require_once("parcours.inc.php");             // concernant les parcours des 
usagers et leur positionnement

echo "<html><head>
  <title>$titreconfig - epnadmin</title>
  <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
  <body>\n";


// Fonction suivante inspirée de :
/*
* Avertissement : Cette librairie de fonctions PHP est distribuee avec l'espoir
* qu'elle sera utile, mais elle l'est SANS AUCUNE GARANTIE; sans meme la 
garantie de
* COMMERCIALISATION ou d'UTILITE POUR UN BUT QUELCONQUE.
* Elle est librement redistribuable tant que la presente licence, ainsi que les 
credits des
* auteurs respectifs de chaque fonctions sont laisses ensembles.
* En aucun cas, Nexen.net ne pourra etre tenu responsable de quelques 
consequences que ce soit
* de l'utilisation ou la mesutilisation de ces fonctions PHP.
*/
/* ***
* Titre : Modifie un fichier de config
* Auteur : Haj
* Email : address@hidden
* Url : haj.ht.st
* Description : Cette fonction modifie un fichier de configuration sur le 
modèle: $var=$value
Prend un nom de fichier et un tableau $array[var]=value comme argument.
*** */

function enregistreconfig($variable, $valeur)
{ // Tente de modifier le contenu du fichier constantes.inc.php
  // et met à jour la variable avec la nouvelle valeur.

  if (! $fic = fopen ("constantes.inc.php", "r"))
  {
    echo "<p>Impossible d'ouvrir le fichier constantes.inc.php en lecture.</p>
          <p>Vérifier les permissions pour l'utilisateur dont se sert le 
serveur apache.</p>\n";
    return FALSE;
  }

  $contenu='';

  while (! feof($fic))
  {
    $ligne = fgets($fic, 4096);
    if ($posvariable = strpos($ligne, "$"))
    {                          
      // verifie si on trouve le signe "=" à un plus grande position que "$"
      if ($posaffecte = strpos($ligne, "=", $posvariable))
      {
        // verifie si on trouve le signe ";" à un plus grande position que "="
        if ($posfin = strpos($ligne, ";", $posaffecte))
        {
          // tout est bon, on recupere la variable et sa valeur
          $ancienvariable = substr($ligne, $posvariable + 1, $posaffecte - 
$posvariable - 1);
          // on enleve les blanc
          $ancienvariable = trim($ancienvariable);
          // la variable est celle qu'on veut modifier
          if ($ancienvariable==$variable)
          {
            $ancienvaleur = substr($ligne, $posaffecte + 1, $posfin - 
$posaffecte - 1);
            // on enleve les blanc
            $ancienvaleur = trim($ancienvaleur);
            // enlève les " (guillemets)
            $ancienvaleur = str_replace("\"", "", $ancienvaleur);  //"
            // On remplace sa valeur.
            $ligne=str_replace($ancienvaleur,$valeur, $ligne);
          }
        }
      }
    } // if $posvariable
    $contenu .= $ligne;
  }
  fclose($fic); // Ferme le fichier en lecture

  // ouverture en écriture
  if (! $fic = fopen ("constantes.inc.php", "w"))
  {
    echo "<p>Impossible d'ouvrir le fichier constantes.inc.php en écriture.</p>
          <p>Vérifier les permissions pour l'utilisateur dont se sert le 
serveur apache.</p>\n";
    return FALSE;
  }
  // on y inscrit le nouveau contenu
  fwrite($fic, $contenu);
  // on ferme le fichier
  fclose($fic);

  //echo nl2br($contenu);
  return TRUE; // fini
}

switch ($operation)
{
case 100 : // Choix de la langue
  echo "<h1>$choixlangue</h1>\n";
  echo "<h2>$langage</h2>";
  echo "<table>
        <form action=\"$PHP_SELF\" method=\"POST\" 
enctype=\"multipart/form-data\">
        <input type=\"hidden\" name=\"operation\" value=101>
        <tr><td>$choisirlangue</td><td>\n";
  // On regarde tous les fichiers de langues disponibles dans le dossier courant
  $dossier = opendir(".");
  while ($nom=readdir($dossier))
   if (strpos($nom,"lang.inc.php")>0)
    {
    $l=substr($nom,0,2);
    echo "<input type=\"radio\" name=\"langage\" value=\"$l\"";
    if ($l==$langage) echo " checked";
    echo ">$l<br>\n";
  }
  closedir($dossier);
  echo "</td></tr>
        <tr><td align=\"center\"><input type=\"submit\" name=\"Envoyer\" 
value=\"$envoyer\"></td></tr>
        </form>
        </table>\n";
  break;

case 101 : // Enregistrement de la langue
  echo "<h1>$enregistrementlangue</h1>\n";
  enregistreconfig("langage", $langage);
  break;

case 200 : // Configuration de la base de données
  echo "<h1>$configparamserveur</h1>\n";
  echo "<table>
        <form action=\"$PHP_SELF\" method=\"POST\" 
enctype=\"multipart/form-data\">
        <input type=\"hidden\" name=\"operation\" value=201>
        <tr><td>$nomserveurmysql</td><td><input type=\"text\" 
name=\"mysql_serveur\" value=\"$mysql_serveur\"></td></tr>
        <tr><td>$identifiantserveurmysql</td><td><input type=\"text\" 
name=\"mysql_identifiant\" value=\"$mysql_identifiant\"></td></tr>
        <tr><td>$pwserveurmysql</td><td><input type=\"text\" 
name=\"mysql_motdepasse\" value=\"$mysql_motdepasse\"></td></tr>
        <tr><td align=\"center\"><input type=\"submit\" name=\"Envoyer\" 
value=\"$envoyer\"></td></tr>
        </form>
        </table>\n";
  break;

case 201 : // Enregistrement de la config de la base de donnée
  echo "<h1>$configparamserveur</h1>\n";
  if (! mysql_connect($mysql_serveur,$mysql_identifiant,$mysql_motdepasse))
  {
    echo $connexionserveurimpossible;
    break;
  }
  else // Ca a marché, on peut enregistrer la configuration
  {
    echo $connexionserveurok;
    enregistreconfig("mysql_serveur", $mysql_serveur);
    enregistreconfig("mysql_identifiant", $mysql_identifiant);
    enregistreconfig("mysql_motdepasse", $mysql_motdepasse);
  }
  // pas de break; ???

case 202 : // Configuration de la base de données sur le serveur
  echo "<h1>$configbase</h1>\n";
  echo "<table>
        <form action=\"$PHP_SELF\" method=\"POST\" 
enctype=\"multipart/form-data\">
        <input type=\"hidden\" name=\"operation\" value=203>
        <tr><td>$basemysql</td><td><input type=\"text\" name=\"mysql_base\" 
value=\"$mysql_base\"></td></tr>
        <tr><td align=\"center\"><input type=\"submit\" name=\"Envoyer\" 
value=\"$envoyer\"></td></tr>
        </form>
        </table>\n";
  break;

case 203 : // Essai de connexion à la base de données
  echo "<h1>$configbase</h1>\n";
  if (! mysql_connect($mysql_serveur,$mysql_identifiant,$mysql_motdepasse))
  {
    echo $connexionserveurimpossible;
    break;
  }
  if (! mysql_select_db($mysql_base))
  {
    echo $connexionbaseimpossible;
    break;
  }
  else // Ca a marché, on peut enregistrer la configuration
  {
    echo $connexionbaseok;
    enregistreconfig("mysql_base", $mysql_base);
  }
  // pas de break;

case 300 : // Demande création des tables  
  break;

case 301 : // Création des tables
case 400 : // Saisie de la première structure
case 401 : // Enregistrement de la première structure
case 500 : //
  require_once("header.inc.php"); // C'est dans header.inc.php que sont 
retrouvés les droits issus de la table droits
  echo "<p>C'est apparemment la toute première utilisation.</p>";
  echo "<p>La fonctionnalité pour gérer les fonctionnalités et autorisations et 
créee.</p>";
  $req="INSERT INTO droits (id_fonction, id_structure, actif)
                    VALUES (1, 0, 'y')";
  executeRequete($req);
  echo "<p>Vous avez tous les droits pour effectuer des modifications.</p>";
  $req="INSERT INTO droits (id_fonction, id_structure, moi, autres)
                    VALUES (1, $id_structure, 'w', 'w')";
  executeRequete($req);
case 600 : // Direction vers une nouvelle identification
  echo "<p>Il faut maintenant se connecter en tant que structure</p>";
  echo "<a href=\"$PHP_SELF?logoff=1\">Reprendre</a>";

default : // Afficher toutes les étapes possibles

}




?>

Index: constantes.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/constantes.inc.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** constantes.inc.php  31 Jan 2003 21:19:40 -0000      1.20
--- constantes.inc.php  4 Feb 2003 23:31:58 -0000       1.21
***************
*** 25,35 ****
  
  // Langage, language, idioma
! $langage="fr";
  
  // Paramétrage de MySQL
! $mysql_serveur="localhost";
! $mysql_identifiant="epnadmin";  // Mettre le bon identifiant
! $mysql_motdepasse="epnadmin";           // Mettre le bon mot de passe
! $mysql_base="epnadmin";         // Mettre le nom de la bonne base
  
  // Divers chemins
--- 25,40 ----
  
  // Langage, language, idioma
! if (! $langage)
!   $langage="fr";
  
  // Paramétrage de MySQL
! if (! $mysql_serveur)
! {
!   $mysql_serveur="localhost";            // Mettre le bon serveur (localhost)
!   $mysql_identifiant="epnadmin";          // Mettre le bon identifiant
!   $mysql_motdepasse="epnadmin";           // Mettre le bon mot de passe
! }
! if (! $mysql_base)
!   $mysql_base="epnadmin";         // Mettre le nom de la bonne base
  
  // Divers chemins
***************
*** 68,74 ****
                                                  // et des domaines de 
courriels
  // utilisé dans courriel.(inc.)php et siteweb.(inc.)php
! $ip_serveur="192.168.0.253"; // sert dans courriel.inc.php
  
! // constantes
  define ("PASSE", "passé"); // sert dans l'affichage des parcours et des 
utlisations d'un usager
  define ("FUTUR", "futur");
--- 73,79 ----
                                                  // et des domaines de 
courriels
  // utilisé dans courriel.(inc.)php et siteweb.(inc.)php
! $ip_serveur="127.0.0.1"; // sert dans courriel.inc.php
  
! // constantes qui ne servent qu'en interne. Inutile de les changer.
  define ("PASSE", "passé"); // sert dans l'affichage des parcours et des 
utlisations d'un usager
  define ("FUTUR", "futur");
***************
*** 87,103 ****
  $logo = "./images/logoepnadmin2.png"; // image qui est utilisée dans 
entete.inc.php
  
- // Définition des couleurs, mais franchement, il faudrait repenser tout ça.
- /*
- define ("COULEUR_ACCES_INDIVIDUEL", "#70F120");  // reservations et usages
- define ("COULEUR_SESSION", "#2AA1F6");
- define ("COULEUR_STRUCTURE", "#C9FFA8");     // structures et localisations
- define ("COULEUR_USAGER", "#FFD07A");        // usagers, crédits et cartes
- define ("COULEUR_PARCOURS", "#E4C9F9");
- define ("COULEUR_POSITIONNEMENT", "#C8F9FF");
- define ("COULEUR_COURRIEL", "#FFB1B2");
- define ("COULEUR_SITEWEB", "#FFFDB9");
- define ("COULEUR_PARC", "#DAA4F1");          // prets, materiels, logiciels
- define ("COULEUR_ADMIN", "#C0C0C0");
- */
  // Chargement du fichier de langage
  require_once($langage.".lang.inc.php");
--- 92,95 ----

Index: entete.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/entete.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** entete.inc.php      31 Jan 2003 21:19:40 -0000      1.19
--- entete.inc.php      4 Feb 2003 23:31:58 -0000       1.20
***************
*** 103,129 ****
  if ($is_ident=="usager")
  {
!   if(USAGERS_MES>="r")
      echo "<a href=\"usagers.php\">mes infos</a><br>\n";
  
!   if (CREDITS_MES>="r")
      echo "<a href=\"usagers.php?operation=7\">mes cr&eacute;dits</a><br>\n";
  
!   if (USAGERS_MES>="r")
      echo "<a href=\"usagers.php?operation=6\">mot de passe</a><br>\n";
  
!   if (SITES_MES>="r")
      echo "<a href=\"siteweb.php\">ma page perso</a><br>\n";
  
!   if (COURRIELS_MES>="r")
      echo "<a href=\"courriel.php\">mon courriel</a><br>\n";
  }
  elseif ($is_ident=="structure")
  {
!   if (STRUCTURES_MES>="r")
      echo "<a href=\"structures.php\">informations</a><br>
            <a href=\"structures.php?operation=6\">mot de passe</a><br>\n";
!   if (SITES_MES>="r")
      echo "<a href=\"siteweb.php?operation=11\">site web</a><br>\n";
!   if (COURRIELS_MES>="r")
      echo "<a href=\"courriel.php?operation=11\">courriel</a><br>\n";
  }
--- 103,129 ----
  if ($is_ident=="usager")
  {
!   if(USAGERS_MOI>="r")
      echo "<a href=\"usagers.php\">mes infos</a><br>\n";
  
!   if (CREDITS_MOI>="r")
      echo "<a href=\"usagers.php?operation=7\">mes cr&eacute;dits</a><br>\n";
  
!   if (USAGERS_MOI>="r")
      echo "<a href=\"usagers.php?operation=6\">mot de passe</a><br>\n";
  
!   if (SITES_MOI>="r")
      echo "<a href=\"siteweb.php\">ma page perso</a><br>\n";
  
!   if (COURRIELS_MOI>="r")
      echo "<a href=\"courriel.php\">mon courriel</a><br>\n";
  }
  elseif ($is_ident=="structure")
  {
!   if (STRUCTURES_MOI>="r")
      echo "<a href=\"structures.php\">informations</a><br>
            <a href=\"structures.php?operation=6\">mot de passe</a><br>\n";
!   if (SITES_MOI>="r")
      echo "<a href=\"siteweb.php?operation=11\">site web</a><br>\n";
!   if (COURRIELS_MOI>="r")
      echo "<a href=\"courriel.php?operation=11\">courriel</a><br>\n";
  }
***************
*** 187,191 ****
  } // if
  
!   if ($is_ident=="usager" && PARCOURS_MES>="r")
    {
      echo "<tr>
--- 187,191 ----
  } // if
  
!   if ($is_ident=="usager" && PARCOURS_MOI>="r")
    {
      echo "<tr>
***************
*** 203,209 ****
      <td valign=\"top\">
        <a href=\"parcours.php\">mon parcours</a><br>\n";
!     if (SESSIONS_MES>="w")
        echo "<a href=\"parcours.php\">m'inscrire à une initiation</a><br>\n";
!     if (PARCOURS_MES>="w")
        echo "<a href=\"parcours.php?operation=4\">ajouter initiation</a><br>
          <a href=\"parcours.php?operation=5\">mettre &agrave; jour</a><br>\n";
--- 203,209 ----
      <td valign=\"top\">
        <a href=\"parcours.php\">mon parcours</a><br>\n";
!     if (SESSIONS_MOI>="w")
        echo "<a href=\"parcours.php\">m'inscrire à une initiation</a><br>\n";
!     if (PARCOURS_MOI>="w")
        echo "<a href=\"parcours.php?operation=4\">ajouter initiation</a><br>
          <a href=\"parcours.php?operation=5\">mettre &agrave; jour</a><br>\n";

Index: fr.lang.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/fr.lang.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** fr.lang.inc.php     31 Jan 2003 21:19:40 -0000      1.4
--- fr.lang.inc.php     4 Feb 2003 23:31:58 -0000       1.5
***************
*** 23,26 ****
--- 23,51 ----
  require_once("constantes.inc.php");
  
+ // config.php
+ $titreconfig="configuration de l'application";
+ $choixlangue="Choix de la langue";    
+ $choisirlangue="Choisir la langue";
+ $enregistrementlangue="Enregistrement de la langue";
+ $configparamserveur="Configuration des paramètres du serveur de base de 
données";
+ $nomserveurmysql="Nom du serveur de base de données";
+ $identifiantserveurmysql="Identifiant pour la connexion au serveur de la base 
de données";
+ $pwserveurmysql="Mot de passe pour la connexion au serveur de base de 
données";
+ $configbase="Configuration des paramètres de la base de données";
+ $basemysql="Nom de la base epnadmin";
+ $envoyer="Envoyer";
+ $connexionserveurimpossible="<p>Connexion au serveur impossible.</p>
+           <p>Assurez-vous que le serveur de base de données
+           est exécuté et que la machine serveur est accessible.</p>
+           <p><a href=\"$PHP_SELF?operation=201\">Réessayer la 
connexion</a>.</p>
+           <p><a href=\"$PHP_SELF?operation=200\">Modifier la configuration du 
serveur de base de données</a>.</p>\n";
+ $connexionserveurok="<p>Connexion au serveur de base de données réussie. 
Enregistrement des paramètres.</p>\n";
+ $connexionbaseimpossible="<p>Connexion à la base de données impossible.</p>
+           <p><a href=\"$PHP_SELF?operation=203\">Réessayer d'accéder à la 
base</a>.</p>
+           <p><a href=\"$PHP_SELF?operation=300\">Création de la base de 
données (car il s'agit d'une première installation)</a>.</p>
+           <p><a href=\"$PHP_SELF?operation=202\">Modifier la configuration de 
la base de données</a>.</p>
+           <p><a href=\"$PHP_SELF?operation=200\">Modifier la configuration du 
serveur de base de données</a>.</p>\n";
+ $connexionbaseok="<p>Connexion à la base de données réussie. Enregistrement 
des paramètres.</p>\n";
+ 
  // configuration.php
  $titreconfiguration="Configuration de l'application et des autorisations";
***************
*** 66,70 ****
  $questions="questions";
  $titrequestions="Base des questions d'autoévaluation";
!                       
  // Horaires.php
  $manqueinfosalle="<p>Problème : il me manque l'information sur la salle 
!</p>\n";
--- 91,95 ----
  $questions="questions";
  $titrequestions="Base des questions d'autoévaluation";
! 
  // Horaires.php
  $manqueinfosalle="<p>Problème : il me manque l'information sur la salle 
!</p>\n";
***************
*** 74,77 ****
--- 99,123 ----
  $manqueinfologiciel="<p>Problème : il me manque l'information sur le logiciel 
!</p>\n";
  $logicielintrouvable="<p>Problème : le logiciel n'a pas été retrouvé !</p>\n";
+ 
+ // materiels.php
+ $manqueinfomateriel="<p>Problème : il me manque l'information sur le materiel 
!</p>\n";
+ $materielintrouvable="<p>Problème : le materiel n'a pas été retrouvé !</p>\n";
+ 
+ // structures.php
+ $strusertsession="<p>Désolé, mais la structure est utilisés dans des 
sessions, il n'est pas possible de la supprimer.</p>\n";
+ $strusertlocal="<p>Désolé, mais la structure a des localisations, il n'est 
pas possible de la supprimer.</p>\n";
+ $logindejapris="<p>Désolé, mais l'identifiant est déjà utilisé.</p>\n";
+ $struestmoi="<p>Désolé, mais une structure ne peut pas se supprimer 
elle-même.</p>\n";
+ $strusertanimateur="<p>Désolé, mais la structure sert de provenance à des 
animateurs, il n'est pas possible de la supprimer.</p>\n";;
+ $strusertusagers="<p>Désolé, mais la structure sert de provenance à des 
usagers, il n'est pas possible de la supprimer.</p>\n";;
+ $strusertpret="<p>Désolé, mais la structure est utilisés dans des prets, il 
n'est pas possible de la supprimer.</p>\n";;
+ 
+ // localisations.php
+ $localsertsession="<p>Désolé, mais la salle utilisés dans des sessions, il 
n'est pas possible de la supprimer.</p>\n";
+ $localsertmateriel="<p>Désolé, mais la salle dispose de matériel, il n'est 
pas possible de la supprimer.</p>\n";
+ $localisationintrouvable="<p>Désolé, mais la salle est introuvable.</p>\n";
+ $manqueinforlocalisation="<p>Il manque une information sur la salle.</p>\n";
+ 
+ 
  
  // Toutes ou beaucoup

Index: localisations.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/localisations.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** localisations.php   5 Jan 2003 20:34:01 -0000       1.4
--- localisations.php   4 Feb 2003 23:31:58 -0000       1.5
***************
*** 23,26 ****
--- 23,32 ----
  
  require_once("header.inc.php");
+ if (! defined("FCT_LOCALISATIONS"))
+ {
+       echo $fctnonactive;
+       exit;
+ }
+ 
  require_once("constantes.inc.php");             // définition des constantes
  //require_once("fonctions.inc.php");              // concernant des fonctions 
transversales inclassables
***************
*** 42,207 ****
  <?
  $titr = "Gestion des localisations";
! $datemaj="5 janvier 2003";
  require("entete.inc.php");
  
  // Début du contenu de la page
  
! if ($isadmin!='super' || !$id_stru)  // si pas super administrateur, on ne 
peut voir que sa propre structure
!   $id_stru=$id_structure;
  
! if ($id_structure)
  {
  
!   switch($operation)
    {
!   case 3 : // Confirmation d'effacement
!     $mes="";
!     if (!$id_localisation)
!       $mes.="<p>Attention, la localisation n'a pas été définie.</p>";
!     $res = recherche("sessions", "id_localisation", $id_localisation);
!     if (mysql_fetch_object($res))
!       $mes.="<p>Désolé, mais la localisation est utilisés dans des sessions, 
il n'est pas possible de la supprimer.</p>";
!     $res = recherche("materiels", "id_localisation", $id_localisation);
!     if (mysql_fetch_object($res))
!       $mes.="<p>Désolé, mais la localisation est utilisés dans la base des 
matériels, il n'est pas possible de la supprimer.</p>";
!     if ($mes!="")
      {
!       echo "$mes\n";
        break;
      }
!     echo "<table  bgColor=\"".COULEUR_STRUCTURE."\" align=center>
!             <form name=\"form\" method=\"post\" action=\"localisations.php\">
!               <input type=\"hidden\" name=\"id_localisation\" 
value=\"$id_localisation\">
!               <input type=\"hidden\" name=\"operation\" value=\"31\">
!               <tr><td><b>Suis-je sûr(e) de vouloir supprimer la localisation 
";
!     echo localisation($id_localisation, true);
!     echo " ?</b></td></tr>
!              <tr><td><input type=\"submit\"
!                 name=\"Annuler\" value=\"Oui, je supprime la 
localisation.\"></td></tr>
!            </form>
!          </table>\n";
!     break;
! 
!   case 31:  // Efface final
!         $query = "DELETE FROM localisations WHERE id='$id_localisation'";
!         $result = executeRequete($query);
!         echo "<p>Localisation effacée.</p>";
!         break;
  
!   case 2:   // Formulaire modification
!         if (!$isadmin)
!         {
!           echo "<p>Je crois bien que tu as dû te perdre là où il ne fallait 
pas...</p>";
!           break;
!         }
!         $result = recherche("localisations", "id", $id_localisation);
!         if (! $u=mysql_fetch_array($result))
!         {
!            echo "<p>La localsation n'apparaît pas dans la base !</p>\n";
!            break;
!         }
!         $operation=21;
!         extract($u);
  
!   case 1:  // Ajoute une nouvelle localisation (ou la modifie)
!     if (!$isadmin)
!     {
!       echo "<p>Je crois bien que tu as dû te perdre là où il ne fallait 
pas...</p>";
        break;
!     }
!     if ($operation!=21)
!       $operation=11;
!     echo "<table align=center border=1 bgcolor=\"".COULEUR_STRUCTURE."\">
!              <form name=\"modilocal\" method=\"post\" 
action=\"localisations.php\">\n";
!        if ($operation==21)
!           echo "<input type=\"hidden\" name=\"id_localisation\" 
value=\"$id_localisation\">\n";
!        echo "<input type=\"hidden\" name=\"operation\" value=\"$operation\">
!              <tr><td>Structure* :</td><td>";
!        if ($isadmin=="super")
!          choix_structure($id_structure, "id_stru");
!        else
!        {
!          echo structure($id_structure);
!          echo "<input type=\"hidden\" name=\"id_stru\" 
value=\"$id_structure\">\n";
!        }
!        echo "</td></tr>
!              <tr><td>Salle (ou groupe d'ordinateurs) :</td>
!                  <td><input type=\"text\" name=\"salle\" value=\"$salle\" 
size=\"50\" maxlength=\"100\"></td></tr>
!              <tr><td>Image (url) :</td>
!                  <td><input type=\"text\" name=\"image\" value=\"$image\" 
size=\"50\" maxlength=\"120\"></td></tr>";
!        echo "<tr><td align=center colspan=2>
!              <input type=\"submit\" name=\"Envoyer\" value=\"Mettre à jour\">
!              </td></tr></table></form>\n";
!        break;
! 
!   case 11:  // Ajout final
!         if (!$id_structure)
!         {
!           echo "<p>Je crois bien que tu as dû te perdre là où il ne fallait 
pas...</p>";
!           break;
!         }
!         // vérification des paramètres
!         $mes="";
!         if ($salle=="") $mes.="<p>Attention, le nom de la salle n'a pas été 
choisi</p>";
!         if ($id_stru=="") $mes.="<p>Attention, la structure n'a pas été 
choisie</p>";
!         if ($mes!="")
!         {
!           echo "$mes\n";
!           break;
!         }
!         $query = "INSERT INTO localisations
!                             (id_structure, salle, image)
!                      VALUES (\"$id_stru\", \"$salle\", \"$image\")";
!         if (executeRequete($query))
!            echo "<p>Localisation ajoutée.</p>";
          break;
  
!   case 21:  // Modif finale
!         // vérification des paramètres
!         $mes="";
!         if ($salle=="") $mes.="<p>Attention, le nom de la salle n'a pas été 
choisi</p>";
!         if ($id_stru=="") $mes.="<p>Attention, la structure n'a pas été 
choisie</p>";
!         if ($id_localisation=="") $mes.="<p>Attention, la localisation a été 
perdue entre temps</p>";
!         if ($mes!="")
!         {
!           echo "$mes\n";
!           break;
!         }
!         $query = "UPDATE localisations SET
!                         id_structure=\"$id_stru\", salle=\"$salle\",
!                         image=\"$image\"
!                      WHERE id=\"$id_localisation\"";
!         if ($result = executeRequete($query))
!           echo "<p>Localisation modifiée.</p>";
          break;
  
!   case 5 : // liste des localisations
  
-   default : // liste des localisations
-         $req = "SELECT * FROM localisations";
-         if ($isadmin!="super")
-           $req.=" WHERE id_structure=$id_structure";
-         $req.=" ORDER BY id_structure, salle";
-         $res = executeRequete($req);
-       echo "<table align=center bgcolor=\"".COULEUR_STRUCTURE."\">
-             <tr><td align=center><font size=\"+2\">Liste des localisations 
(salles ou groupes d'ordinateurs)</font></td></tr>
-             <tr><td align=center>\n";
-         echo "<table align=center border=1>\n";
-         while ($u=mysql_fetch_object($res))
-         {
-            echo "<tr><td>".localisation($u->id, true)."</td>
-                      <td><a 
href=\"localisations.php?operation=2&id_localisation=$u->id\">$modifier</a></td>
-                      <td><a 
href=\"localisations.php?operation=3&id_localisation=$u->id\">$supprimer</a></td></tr>\n";
-         }
-         echo "<tr><td colspan=5 align=right><a 
href=\"localisations.php?operation=1\">$ajouter</a></td></tr>\n";
-         echo "</table></td></tr></table>\n";
-         break;
-   } // switch
- } // if
- else
-   echo "<p>Et l'internaute sorti un hyperlien de son chapeau magique... dans 
tes rêves</p>\n";
  
  include("basdepage.inc.php");
  echo "</body></html>\n";
  require("footer.inc.php");
! ?>
\ No newline at end of file
--- 48,268 ----
  <?
  $titr = "Gestion des localisations";
! $datemaj="4 février 2003";
  require("entete.inc.php");
  
+ function verifiedroits($droit="r", $affichage=true)
+ {
+ global $id_localisation, $id_structure,
+   $pasledroit, $localisationintrouvable, $manqueinforlocalisation;
+   if (!$id_localisation)
+   {                                               
+     if ($affichage)
+       echo $manqueinfolocalisation;
+     return FALSE;
+   }
+   $req="SELECT id_structure FROM localisations
+           WHERE id=\"$id_localisation\"";
+   $res=executeRequete($req);
+   if (! $localisation=mysql_fetch_object($res))
+   {
+     if ($affichage)
+       echo $localisationintrouvable;
+     return FALSE;
+   }
+   if (! (LOCALISATIONS_AUTRES>=$droit || (LOCALISATIONS_MOI>=$droit && 
$localisation->id_structure==$id_structure)))
+   {
+     if ($affichage)
+       echo $pasledroit;
+     return FALSE;
+   }
+   return TRUE;
+ }
+ 
+ 
  // Début du contenu de la page
  
! if (LOCALISATIONS<="~")
! {
!   echo $pasledroit;
!   exit;
! }
  
! switch($operation)
  {
+ case 3 : // Confirmation d'effacement
+   if (! verifiedroits("w"))
+     break;
+   $mes="";
+   $res = recherche("materiels", "id_localisation", $id_localisation);
+   if (mysql_fetch_object($res))
+     $mes.=$localsertmateriel;
+   $res = recherche("sessions", "id_localisation", $id_localisation);
+   if (mysql_fetch_object($res))
+     $mes.=$localsertsession;
+   if ($mes!="")
+   {
+     echo $mes;
+     break;
+   }
  
!   echo "<table  bgColor=\"".COULEUR_STRUCTURE."\" align=center>
!           <form name=\"form\" method=\"post\" action=\"localisations.php\">
!             <input type=\"hidden\" name=\"id_localisation\" 
value=\"$id_localisation\">
!             <input type=\"hidden\" name=\"operation\" value=\"31\">
!             <tr><td><b>Suis-je sûr(e) de vouloir supprimer la localisation ";
!   echo localisation($id_localisation, true);
!   echo " ?</b></td></tr>
!           <tr><td><input type=\"submit\"
!               name=\"Annuler\" value=\"Oui, je supprime la 
localisation.\"></td></tr>
!         </form>
!       </table>\n";
!   break;
! 
! case 31:  // Efface final
!   if (! verifiedroits("w"))
!     break;
!   $mes="";
!   $res = recherche("materiels", "id_localisation", $id_localisation);
!   if (mysql_fetch_object($res))
!     $mes.=$localsertmateriel;
!   $res = recherche("sessions", "id_localisation", $id_localisation);
!   if (mysql_fetch_object($res))
!     $mes.=$localsertsession;
!   if ($mes!="")
    {
!     echo $mes;
!     break;
!   }
! 
!   $query = "DELETE FROM localisations WHERE id='$id_localisation'";
!   $result = executeRequete($query);
!   echo "<p>Localisation effacée.</p>";
! 
!   $query = "DELETE FROM calendrier WHERE id_localisation='$id_localisation'";
!   $result = executeRequete($query);
!   $query = "DELETE FROM modeles_horaires WHERE 
id_localisation='$id_localisation'";
!   $result = executeRequete($query);
!   echo "<p>Ainsi que son calendrier et son modèle de calendrier.</p>";
! 
!   break;
! 
! case 2:   // Formulaire modification
!   if (! verifiedroits("r"))
!     break;
! 
!     $result = recherche("localisations", "id", $id_localisation);
!     if (! $u=mysql_fetch_array($result))
      {
!       echo "<p>La localsation n'apparaît pas dans la base !</p>\n";
        break;
      }
!     $operation=21;
!     extract($u);
  
! case 1:  // Ajoute une nouvelle localisation (ou la modifie)
!   if ($operation!=21)
!   {
!     $operation=11;
!     if (LOCALISATIONS_MOI<"w" && LOCALISATIONS_AUTRES<"w")
!       break;
!   }
  
!   echo "<table align=center border=1 bgcolor=\"".COULEUR_STRUCTURE."\">
!           <form name=\"modilocal\" method=\"post\" 
action=\"localisations.php\">\n";
!   if ($operation==21)
!       echo "<input type=\"hidden\" name=\"id_localisation\" 
value=\"$id_localisation\">\n";
!   echo "<input type=\"hidden\" name=\"operation\" value=\"$operation\">
!         <tr><td>Structure* :</td><td>";
!   // TODO changer les 7 lignes suivantes
!   //if ($isadmin=="super")
!     choix_structure($id_structure, "id_stru");
!   /*else
!   {
!     echo structure($id_structure);
!     echo "<input type=\"hidden\" name=\"id_stru\" value=\"$id_structure\">\n";
!   } */
!   echo "</td></tr>
!         <tr><td>Salle (ou groupe d'ordinateurs) :</td>
!             <td><input type=\"text\" name=\"salle\" value=\"$salle\" 
size=\"50\" maxlength=\"100\"></td></tr>
!         <tr><td>Image (url) :</td>
!             <td><input type=\"text\" name=\"image\" value=\"$image\" 
size=\"50\" maxlength=\"120\"></td></tr>";
!   echo "<tr><td align=center colspan=2>
!         <input type=\"submit\" name=\"Envoyer\" value=\"Mettre à jour\">
!         </td></tr></table></form>\n";
!   break;
! 
! case 11:  // Ajout final
!     if (LOCALISATIONS_MOI<"w" && LOCALISATIONS_AUTRES<"w")
        break;
!       // vérification des paramètres
!       $mes="";
!       if ($salle=="") $mes.="<p>Attention, le nom de la salle n'a pas été 
choisi</p>";
!       if ($id_stru=="") $mes.="<p>Attention, la structure n'a pas été 
choisie</p>";
!       if ($mes!="")
!       {
!         echo "$mes\n";
          break;
+       }
+       $query = "INSERT INTO localisations
+                           (id_structure, salle, image)
+                   VALUES (\"$id_stru\", \"$salle\", \"$image\")";
+       if (executeRequete($query))
+         echo "<p>Localisation ajoutée.</p>";
+       break;
  
! case 21:  // Modif finale
!       // vérification des paramètres
!       $mes="";
!       if ($salle=="") $mes.="<p>Attention, le nom de la salle n'a pas été 
choisi</p>";
!       if ($id_stru=="") $mes.="<p>Attention, la structure n'a pas été 
choisie</p>";
!       if ($id_localisation=="") $mes.="<p>Attention, la localisation a été 
perdue entre temps</p>";
!       if ($mes!="")
!       {
!         echo "$mes\n";
          break;
+       }
+       $query = "UPDATE localisations SET
+                       id_structure=\"$id_stru\", salle=\"$salle\",
+                       image=\"$image\"
+                   WHERE id=\"$id_localisation\"";
+       if ($result = executeRequete($query))
+         echo "<p>Localisation modifiée.</p>";
+       break;
  
! case 5 : // liste des localisations
! 
! default : // liste des localisations
!   if (STRUCTURES<="~")
!   {
!     echo $pasledroit;
!     break;
!   }
!   $req = "SELECT * FROM localisations";
!   if (STRUCTURES_AUTRES<"r")
!     $req.=" WHERE id_structure=$id_structure";
!   $req.=" ORDER BY id_structure, salle";
!   $res = executeRequete($req);
!   echo "<table align=center bgcolor=\"".COULEUR_STRUCTURE."\">
!           <tr><td align=center><font size=\"+2\">Liste des localisations 
(salles ou groupes d'ordinateurs)</font></td></tr>
!           <tr><td align=center>\n";
!   echo "<table align=center border=1>\n";
!   while ($u=mysql_fetch_object($res))
!   {
!     echo "<tr><td>".localisation($u->id, true)."</td>";
!     $id_localisation=$u->id;
!     if (verifiedroits("w", false))
!       echo "  <td><a 
href=\"localisations.php?operation=2&id_localisation=$u->id\">$modifier</a></td>
!               <td><a 
href=\"localisations.php?operation=3&id_localisation=$u->id\">$supprimer</a></td>";
!     echo "</tr>\n";
!   }                 
!   if (STRUCTURES_MOI>="w" || STRUCTURES_AUTRES>="w")
!     echo "<tr><td colspan=5 align=right><a 
href=\"localisations.php?operation=1\">$ajouter</a></td></tr>\n";
!   echo "</table></td></tr></table>\n";
!   break;
! } // switch
  
  
  include("basdepage.inc.php");
  echo "</body></html>\n";
  require("footer.inc.php");
! ?>

Index: logiciels.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/logiciels.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** logiciels.php       31 Jan 2003 21:19:40 -0000      1.5
--- logiciels.php       4 Feb 2003 23:31:58 -0000       1.6
***************
*** 22,26 ****
  */
  
! require_once("header.inc.php"); 
  if (! defined("FCT_PARC"))
  {
--- 22,26 ----
  */
  
! require_once("header.inc.php");
  if (! defined("FCT_PARC"))
  {
***************
*** 52,55 ****
--- 52,66 ----
  require("entete.inc.php");
  
+ if (PARC<="~")
+   echo $pasledroit;
+ else
+   if (PARC_AUTRES>="r")
+     echo "<p><a href=\"logiciels.php?operation=5\">Voir la liste des 
logiciels</a>.</p>
+          <p><a href=\"materiels.php?operation=5\">Voir la liste des 
materiels</a>.</p>\n";
+   elseif (PARC_MOI>="r")
+     echo "<p><a href=\"logiciels.php?operation=5\">Voir la liste des 
logiciels de ma structure</a>.</p>
+          <p><a href=\"materiels.php?operation=5\">Voir la liste des materiels 
de ma structure</a>.</p>\n";
+ 
+ 
  function verifiedroits($droit="r")
  {
***************
*** 64,68 ****
            LEFT JOIN materiels ON materiels.id_localisation=localisations.id
            LEFT JOIN logi_mate ON logi_mate.id_materiel=materiels.id
!           WHERE logi_mate.id=\"$id_logiciel\"";
    $res=executeRequete($req);
    if (! $logiciel=mysql_fetch_object($res))
--- 75,79 ----
            LEFT JOIN materiels ON materiels.id_localisation=localisations.id
            LEFT JOIN logi_mate ON logi_mate.id_materiel=materiels.id
!           WHERE logi_mate.id_logiciel=\"$id_logiciel\"";
    $res=executeRequete($req);
    if (! $logiciel=mysql_fetch_object($res))
***************
*** 82,86 ****
  {
  case 11 : // confirmation d'ajout ou mise à jour
!    if (! verifiedroits("w"))
       break;
  
--- 93,102 ----
  {
  case 11 : // confirmation d'ajout ou mise à jour
!    if ($id_logiciel)
!    {
!      if (! verifiedroits("w"))
!        break;
!    }
!    elseif (PARC_MOI<"w" && PARC_AUTRES<"w")
       break;
  
***************
*** 273,277 ****
        $type="";
        while ($log = mysql_fetch_object($res))
!       {                              
          if (verifiedroits("r"))
          {
--- 289,294 ----
        $type="";
        while ($log = mysql_fetch_object($res))
!       {
!         $id_logiciel=$log->id;
          if (verifiedroits("r"))
          {
***************
*** 344,347 ****
--- 361,367 ----
  
  } // switch
+ 
+ if ($operation)
+   echo "<hr>\n";
  
  if (PARC_AUTRES>="r")

Index: materiels.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/materiels.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** materiels.php       31 Jan 2003 21:19:40 -0000      1.7
--- materiels.php       4 Feb 2003 23:31:58 -0000       1.8
***************
*** 22,26 ****
  */
  
! require_once("header.inc.php");      
  if (! defined("FCT_PARC"))
  {
--- 22,26 ----
  */
  
! require_once("header.inc.php");
  if (! defined("FCT_PARC"))
  {
***************
*** 51,62 ****
  require("entete.inc.php");
  
  switch ($operation)
  {
  case 11 : // confirmation d'ajout ou mise à jour
!    if (!$isadmin)
!    {
!       echo "<p>Petit curieux, vous n'avez rien à faire là...</p>\n";
!       break;
!    }
  
     $mes="";
--- 51,100 ----
  require("entete.inc.php");
  
+ if (PARC<="~")
+   echo $pasledroit;
+ else
+   if (PARC_AUTRES>="r")
+     echo "<p><a href=\"logiciels.php?operation=5\">Voir la liste des 
logiciels</a>.</p>
+          <p><a href=\"materiels.php?operation=5\">Voir la liste des 
materiels</a>.</p>\n";
+   elseif (PARC_MOI>="r")
+     echo "<p><a href=\"logiciels.php?operation=5\">Voir la liste des 
logiciels de ma structure</a>.</p>
+          <p><a href=\"materiels.php?operation=5\">Voir la liste des materiels 
de ma structure</a>.</p>\n";
+ 
+ 
+ function verifdroits($droit="r")
+ {
+ global $id_materiel, $id_structure,
+   $pasledroit, $materielintrouvable, $manqueinformateriel;
+   if (!$id_materiel)
+   {
+     echo $manqueinfomateriel;
+     return FALSE;
+   }
+   $req="SELECT id_structure FROM localisations
+           LEFT JOIN materiels ON materiels.id_localisation=localisations.id
+           WHERE materiels.id=\"$id_materiel\"";
+   $res=executeRequete($req);
+   if (! $materiel=mysql_fetch_object($res))
+   {
+     echo $materielintrouvable;
+     return FALSE;
+   }
+   if (!(PARC_AUTRES>=$droit || (PARC_MOI>=$droit && 
$materiel->id_structure==$id_structure)))
+   {
+     echo $pasledroit;
+     return FALSE;
+   }
+   return TRUE;
+ }
+ 
  switch ($operation)
  {
  case 11 : // confirmation d'ajout ou mise à jour
!   if ($id_materiel)
!   {
!     if (! verifdroits("w")) break;
!   }
!   elseif (PARC_MOI<"w" && PARC_AUTRES<"w")
!     break;
  
     $mes="";
***************
*** 123,131 ****
  case 2 : // formulaire d'édition
     // Saisie pour modification d'un enregistrement
!    if (!$isadmin)
!    {
!       echo "<p>C'est un vrai labyrinthe, n'est-ce pas, ce site...</p>\n";
        break;
!    }
     $req = "SELECT * FROM materiels WHERE id=$id_materiel";
     $res = recherche("materiels", "id", $id_materiel);
--- 161,167 ----
  case 2 : // formulaire d'édition
     // Saisie pour modification d'un enregistrement
!    if (verifdroits("w"))
        break;
!    
     $req = "SELECT * FROM materiels WHERE id=$id_materiel";
     $res = recherche("materiels", "id", $id_materiel);
***************
*** 136,144 ****
  case 1 : // formulaire d'ajout
  // Début du fomulaire de saisie d'enregistrement de logiciels
!    if (!$isadmin)
!    {
!       echo "<p>Encore vous, mais que faites-vous là ?..</p>\n";
!       break;
!    }
  
     echo "<form action=\"$PHP_SELF\" method=\"post\">";
--- 172,181 ----
  case 1 : // formulaire d'ajout
  // Début du fomulaire de saisie d'enregistrement de logiciels
!   if ($id_materiel)
!   {
!     if (! verifdroits("w")) break;
!   }
!   elseif (PARC_MOI<"w" && PARC_AUTRES<"w")
!     break;
  
     echo "<form action=\"$PHP_SELF\" method=\"post\">";
***************
*** 179,183 ****
           <tr><td>IP</td><td><input type=\"text\" name=\"ip\" value=\"$ip\" 
size=\"20\" maxlength=\"20\"></td></tr>
           <tr><td>Localisation</td>";
!    choixSalle($id_localisation);
     //<input type=\"text\" name=\"localisation\" value=\"$localisation\" 
size=\"30\" maxlength=\"50\">
     echo "</tr>
--- 216,220 ----
           <tr><td>IP</td><td><input type=\"text\" name=\"ip\" value=\"$ip\" 
size=\"20\" maxlength=\"20\"></td></tr>
           <tr><td>Localisation</td>";
!    choixSalle($id_localisation, TRUE, PARC_AUTRES>="w");
     //<input type=\"text\" name=\"localisation\" value=\"$localisation\" 
size=\"30\" maxlength=\"50\">
     echo "</tr>
***************
*** 187,192 ****
  
     $req = "SELECT * FROM logiciels
!                     LEFT JOIN logi_mate ON logiciels.id=logi_mate.id_logiciel
!                     ORDER BY type,titre,licence";
     $res = executeRequete($req);
     $mat = mysql_fetch_object($res);
--- 224,233 ----
  
     $req = "SELECT * FROM logiciels
!                     LEFT JOIN logi_mate ON 
logiciels.id=logi_mate.id_logiciel";
!    if (! (PARC_AUTRES>="w" && $id_structure))
!     $req.="         LEFT JOIN materiels ON materiels.id=id_materiel
!                     LEFT JOIN localisations ON 
localisations.id=materiels.id_localisation
!                     WHERE (id_structure=\"$id_localisation\" OR 
id_localisation=\"\"";
!    $req.="          ORDER BY type,titre,licence";
     $res = executeRequete($req);
     $mat = mysql_fetch_object($res);
***************
*** 253,271 ****
  
  case 3 : // formulaire de suppression
!    if (!$isadmin)
!    {
!       echo "<p>C'est une erreur, ou c'est volontaire...</p>\n";
!       break;
!    }
!    echo "<p>Attention, tu vas supprimer le materiel et tous les liens avec 
les logiciels.</p>\n";
!    echo "<p><a 
href=\"materiels.php?operation=31&id_materiel=$id_materiel\">Confirmer la 
suppression</a></p>\n";
!    break;
  
  case 31 : // confirmation de suppression
!    if (!$isadmin)
!    {
!       echo "<p>Alors, on visite à où il ne faudrait pas ???</p>\n";
!       break;
!    }
     echo "<p>Le matériel est supprimé</p>\n";
     $req = "DELETE FROM materiels WHERE id=$id_materiel";
--- 294,304 ----
  
  case 3 : // formulaire de suppression
!   if (! verifdroits("w")) break;
!   echo "<p>Attention, tu vas supprimer le materiel et tous les liens avec les 
logiciels.</p>\n";
!   echo "<p><a 
href=\"materiels.php?operation=31&id_materiel=$id_materiel\">Confirmer la 
suppression</a></p>\n";
!   break;
  
  case 31 : // confirmation de suppression
!   if (! verifdroits("w")) break;
     echo "<p>Le matériel est supprimé</p>\n";
     $req = "DELETE FROM materiels WHERE id=$id_materiel";
***************
*** 277,421 ****
  
  case 5 :
!    // Affichage de la liste des materiels
!    if ($isadmin)
!    {
!       $req = "SELECT * FROM materiels ORDER BY type, id_localisation, 
materiel, description";
!       $res = executeRequete($req);
! 
!       echo "<table border=1 align=center>
!             <tr><th>Type de 
matériel</th><th>Localisation</th><th>appellation</th><th>description</th><th>Actions</th></tr>\n";
!       $type="";
!       while ($log = mysql_fetch_object($res))
!       {
!          echo "<tr>\n";
!          if ($type!=$log->type)
!          {
!             echo "<th>$log->type</th>\n";
!             $type=$log->type;
!          }
!          else
!          echo "<td></td>\n";
!          echo "<td>".localisation($log->id_localisation)."</td>
!                <td><b>$log->materiel</b> ($log->specificite)</td>
!                <td>$log->description</td>
!                <td nowrap><a href=\"$PHP_SELF?id_materiel=$log->id\">$info</a>
!                    <a 
href=\"$PHP_SELF?operation=2&id_materiel=$log->id\">$modifier</a>
!                    <a 
href=\"$PHP_SELF?operation=3&id_materiel=$log->id\">$supprimer</a></td></tr>\n";
!       }
!       echo "<tr><td colspan='4'></td><td><a 
href=\"$PHP_SELF?operation=1\">$ajouter</a></td></tr>\n";
!       echo "</table>\n";
!    }
!    else
!       echo "<p>Vous vous êtes encore perdu là où il ne faut pas...</p>\n";
!    break;
  
  default : // affichage détails
!    if ($id_materiel)
!    {
!       // affichage d'un résumé du matériel et des éléments attenants
!       $req1 = "SELECT * FROM materiels WHERE id=$id_materiel";// AND 
type='Unité centrale'";
!       $res1 = executeRequete($req1);
!       if ($materiel=mysql_fetch_object($res1))
!       {
!          echo "<table align=center border=1>
!                <tr><td colspan=2 align=center><h3>$materiel->materiel</h3>";
!          if ($materiel->specificite!="")
!            echo "<p>($materiel->specificite)</p>";
!          if ($materiel->ip!="")
!            echo "<p>($materiel->ip)</p>";
!          echo "</td></tr>\n";
!          echo "<tr><td colspan=2>".nl2br($materiel->description)."</td>";
!          if ($isadmin)
!             echo "<td><a 
href=\"materiels.php?operation=2&id_materiel=$materiel->id&$idu\">$modifier</a>
!                    <a 
href=\"materiels.php?operation=3&id_materiel=$materiel->id&$idu\">$supprimer</a>\n";
!          echo "</tr>\n";
! 
!          echo "<tr><td>Réservable</td><td>";
!          switch ($materiel->reservable)
!          {
!          case "oui" : echo "Oui, un seul utilisateur."; break;
!          case "non" : echo "Non"; break;
!          case "à deux" : echo "Oui, un ou deux utilisateurs"; break;
!          }
!          echo "</td></tr>\n";
!          if ($materiel->localisation!="")
!             echo 
"<tr><td>Localisation</td><td>$materiel->localisation</td></tr>\n";
!          if ($materiel->materiel!="")
!          {
!             echo "<tr><td colspan=2 align=center><b>Liste des éléments 
attachés</b></td></tr>\n";
!             $res2 = recherche ("materiels", "materiel", $materiel->materiel, 
"type");
!             while ($materiel2 = mysql_fetch_object($res2))
!             {
!                echo "<tr><td>$materiel2->type</a>";
!                if ($materiel2->specificite!="")
!                   echo " (".$materiel2->specificite.")";
!                echo "</td><td>".nl2br($materiel2->description)."</td>";
!                if ($isadmin)
!                  echo "<td><a 
href=\"materiels.php?operation=2&id_materiel=$materiel2->id&$idu\">$modifier</a>
!                            <a 
href=\"materiels.php?operation=3&id_materiel=$materiel2->id&$idu\">$supprimer</a>\n";
!                echo "</tr>\n";
!             }
!          // affichage des logiciels attachés à la machine
!             $res2 = recherche ("materiels", "materiel", $materiel->materiel, 
"type");
!             echo "<tr><td colspan=2 align=center><b>Liste des logiciels 
attachés à ce matériel</b></td></tr>\n";
!             while ($materiel2 = mysql_fetch_object($res2))
!             {
!                $req3 = "SELECT * FROM logiciels LEFT JOIN logi_mate ON 
logiciels.id=logi_mate.id_logiciel WHERE id_materiel=$materiel2->id ORDER BY 
type, titre, licence";
!                $res3 = executeRequete($req3);
!                while ($logiciel=mysql_fetch_object($res3)) // il y a des 
logiciels attachés au matériel $id_materiel
!                {
!                   echo "<tr><td>$logiciel->type</td><td>$logiciel->titre";
!                   if ($isadmin & $logiciel->licence!="")
!                     echo "<br>$logiciel->licence";
!                   if ($logiciel->commentaire!="")
!                     echo "<br><i>".nl2br($logiciel->commentaire)."</i>";
!                   echo "</td>";
!                   if ($isadmin)
!                     echo "<td><a 
href=\"logiciels.php?id_logiciel=$logiciel->id\">$info</a>\n";
!                   echo "</tr>\n";
!                }
!             }
!          }
!          else // affichage pour le seul matériel sélectiionné s'il n'a pas de 
nom
!          {
!             $req3 = "SELECT * FROM logiciels LEFT JOIN logi_mate ON 
logiciels.id=logi_mate.id_logiciel WHERE id_materiel=$materiel->id";
!             $res3 = executeRequete($req3);
!             while ($logiciel=mysql_fetch_object($res3)) // il y a des 
logiciels attachés au matériel $id_materiel
!             {
!                echo "<tr><td>$logiciel->type</td><td>$logiciel->titre";
!                if ($logiciel->commentaire!="")
!                  echo "<br><i>".nl2br($logiciel->commentaire)."</i>";
!                echo "</td>";
!                if ($isadmin)
!                  echo "<td><a 
href=\"logiciels.php?id_logiciel=$logiciel->id\">$info</a>\n";
!                echo "</tr>\n";
!             }
!          }
!          // affichage des usages possibles sur cet ordinateur si c'est une UC.
!          if ($materiel->usages!="")
!          {
!             $req4 = "SELECT * FROM usages WHERE id NOT IN ($materiel->usages) 
ORDER BY 'nom'";
!             $res4 = executeRequete($req4);
!             echo "<tr><td colspan=2 align=center><b>Liste des usages 
possibles</b></td></tr>\n<tr><td colspan=2>";
!             while ($usage = mysql_fetch_object($res4)) // il y a des 
logiciels attachés au matériel $id_materiel
!                echo "$usage->nom<br>";
!             echo "</td></tr>\n";
!          }
!          echo "</table>\n";
!       }
!       else
!          echo "<p>Matériel non trouvé dans la base</p>\n";
!    }
!    else
!       echo "<p>Que faites-vous là, vous ne devriez pas vous y trouver 
!</p>\n";
!    break;
  
  } // switch
  
! if ($isadmin)
!    echo "<p><a href=\"materiels.php?operation=5\">Voir la liste des 
materiels</a>.</p>
!          <p><a href=\"logiciels.php?operation=5\">Voir la liste des 
logiciels</a>.</p>\n";
! else
!    echo "<p><a href=\"/\">Retour au bercail.</a>.</p>\n";
  
  require("basdepage.inc.php");
--- 310,454 ----
  
  case 5 :
!   // Affichage de la liste des materiels
!   if (PARC<="~") break;
!   $req = "SELECT * FROM materiels";
!   if (PARC_AUTRES<"r")
!     $req.=" LEFT JOIN localisations ON localisations.id=id_localisations
!             WHERE id_structure=\"$id_structure\"";
!   $req.=" ORDER BY type, id_localisation, materiel, description";
!   $res = executeRequete($req);
! 
!   echo "<table border=1 align=center>
!         <tr><th>Type de 
matériel</th><th>Localisation</th><th>appellation</th><th>description</th><th>Actions</th></tr>\n";
!   $type="";
!   while ($log = mysql_fetch_object($res))
!   {
!     echo "<tr>\n";
!     if ($type!=$log->type)
!     {
!         echo "<th>$log->type</th>\n";
!         $type=$log->type;
!     }
!     else
!     echo "<td></td>\n";
!     echo "<td>".localisation($log->id_localisation)."</td>
!           <td><b>$log->materiel</b> ($log->specificite)</td>
!           <td>$log->description</td>
!           <td nowrap><a href=\"$PHP_SELF?id_materiel=$log->id\">$info</a>";
!     if ((PARC_MOI>="w" && $log->id_structure==$id_structure) || 
PARC_AUTRES>="w")
!       echo "<a 
href=\"$PHP_SELF?operation=2&id_materiel=$log->id\">$modifier</a>
!             <a 
href=\"$PHP_SELF?operation=3&id_materiel=$log->id\">$supprimer</a>";
!     echo "</td></tr>\n";
!   }
!   if (PARC_MOI>="w" || PARC_AUTRES>="w")
!     echo "<tr><td colspan='4'></td><td><a 
href=\"$PHP_SELF?operation=1\">$ajouter</a></td></tr>\n";
!   echo "</table>\n";
!   break;
  
  default : // affichage détails
!    if (! verifdroits("r"))
!      break;
!   // affichage d'un résumé du matériel et des éléments attenants
!   $req1 = "SELECT * FROM materiels WHERE id=$id_materiel";// AND type='Unité 
centrale'";
!   $res1 = executeRequete($req1);
!   if ($materiel=mysql_fetch_object($res1))
!   {
!     echo "<table align=center border=1>
!           <tr><td colspan=2 align=center><h3>$materiel->materiel</h3>";
!     if ($materiel->specificite!="")
!       echo "<p>($materiel->specificite)</p>";
!     if ($materiel->ip!="")
!       echo "<p>($materiel->ip)</p>";
!     echo "</td></tr>\n";
!     echo "<tr><td colspan=2>".nl2br($materiel->description)."</td>";
!     if (verifdroits("w"))
!         echo "<td><a 
href=\"materiels.php?operation=2&id_materiel=$materiel->id&$idu\">$modifier</a>
!               <a 
href=\"materiels.php?operation=3&id_materiel=$materiel->id&$idu\">$supprimer</a>\n";
!     echo "</tr>\n";
! 
!     echo "<tr><td>Réservable</td><td>";
!     switch ($materiel->reservable)
!     {
!     case "oui" : echo "Oui, un seul utilisateur."; break;
!     case "non" : echo "Non"; break;
!     case "à deux" : echo "Oui, un ou deux utilisateurs"; break;
!     }
!     echo "</td></tr>\n";
!     if ($materiel->localisation!="")
!         echo 
"<tr><td>Localisation</td><td>$materiel->localisation</td></tr>\n";
!     if ($materiel->materiel!="")
!     {
!         echo "<tr><td colspan=2 align=center><b>Liste des éléments 
attachés</b></td></tr>\n";
!         $res2 = recherche ("materiels", "materiel", $materiel->materiel, 
"type");
!         while ($materiel2 = mysql_fetch_object($res2))
!         {
!           echo "<tr><td>$materiel2->type</a>";
!           if ($materiel2->specificite!="")
!               echo " (".$materiel2->specificite.")";
!           echo "</td><td>".nl2br($materiel2->description)."</td>";
!           if ($isadmin)
!             echo "<td><a 
href=\"materiels.php?operation=2&id_materiel=$materiel2->id&$idu\">$modifier</a>
!                       <a 
href=\"materiels.php?operation=3&id_materiel=$materiel2->id&$idu\">$supprimer</a>\n";
!           echo "</tr>\n";
!         }
!     // affichage des logiciels attachés à la machine
!         $res2 = recherche ("materiels", "materiel", $materiel->materiel, 
"type");
!         echo "<tr><td colspan=2 align=center><b>Liste des logiciels attachés 
à ce matériel</b></td></tr>\n";
!         while ($materiel2 = mysql_fetch_object($res2))
!         {
!           $req3 = "SELECT * FROM logiciels LEFT JOIN logi_mate ON 
logiciels.id=logi_mate.id_logiciel WHERE id_materiel=$materiel2->id ORDER BY 
type, titre, licence";
!           $res3 = executeRequete($req3);
!           while ($logiciel=mysql_fetch_object($res3)) // il y a des logiciels 
attachés au matériel $id_materiel
!           {
!               echo "<tr><td>$logiciel->type</td><td>$logiciel->titre";
!               if ($isadmin & $logiciel->licence!="")
!                 echo "<br>$logiciel->licence";
!               if ($logiciel->commentaire!="")
!                 echo "<br><i>".nl2br($logiciel->commentaire)."</i>";
!               echo "</td>";
!               echo "<td><a 
href=\"logiciels.php?id_logiciel=$logiciel->id\">$info</a>\n";
!               echo "</tr>\n";
!           }
!         }
!     }
!     else // affichage pour le seul matériel sélectiionné s'il n'a pas de nom
!     {
!         $req3 = "SELECT * FROM logiciels LEFT JOIN logi_mate ON 
logiciels.id=logi_mate.id_logiciel WHERE id_materiel=$materiel->id";
!         $res3 = executeRequete($req3);
!         while ($logiciel=mysql_fetch_object($res3)) // il y a des logiciels 
attachés au matériel $id_materiel
!         {
!           echo "<tr><td>$logiciel->type</td><td>$logiciel->titre";
!           if ($logiciel->commentaire!="")
!             echo "<br><i>".nl2br($logiciel->commentaire)."</i>";
!           echo "</td>";
!           echo "<td><a 
href=\"logiciels.php?id_logiciel=$logiciel->id\">$info</a>\n";
!           echo "</tr>\n";
!         }
!     }
!     // affichage des usages possibles sur cet ordinateur si c'est une UC.
!     if ($materiel->type="Unité centrale")
!     {
!       if ($materiel->usages=="") $materiel->usages="0";
!         $req4 = "SELECT * FROM usages WHERE id NOT IN ($materiel->usages) 
ORDER BY 'nom'";
!         $res4 = executeRequete($req4);
!         echo "<tr><td colspan=2 align=center><b>Liste des usages 
possibles</b></td></tr>\n<tr><td colspan=2>";
!         while ($usage = mysql_fetch_object($res4)) // il y a des logiciels 
attachés au matériel $id_materiel
!           echo "$usage->nom, ";
!         echo "</td></tr>\n";
!     }
!     echo "</table>\n";
!   }
  
  } // switch
  
! if ($operation)
!   echo "<hr>\n";
! 
! if (PARC_AUTRES>="r")
!    echo "<p><a href=\"logiciels.php?operation=5\">Voir la liste des 
logiciels</a>.</p>
!          <p><a href=\"materiels.php?operation=5\">Voir la liste des 
materiels</a>.</p>\n";
! elseif (PARC_MOI>="r")
!    echo "<p><a href=\"logiciels.php?operation=5\">Voir la liste des logiciels 
de ma structure</a>.</p>
!          <p><a href=\"materiels.php?operation=5\">Voir la liste des materiels 
de ma structure</a>.</p>\n";
  
  require("basdepage.inc.php");

Index: mysql.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/mysql.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** mysql.inc.php       5 Jan 2003 20:34:01 -0000       1.2
--- mysql.inc.php       4 Feb 2003 23:31:58 -0000       1.3
***************
*** 43,48 ****
  global $mysql_serveur, $mysql_identifiant, $mysql_motdepasse, $mysql_base;
  
!   @mysql_connect($mysql_serveur,$mysql_identifiant,$mysql_motdepasse) or 
die("Impossible de se connecter au serveur mysql.");
!   @mysql_select_db($mysql_base) or die("Impossible de se connecter à la base 
de données.");
  }
  
--- 43,52 ----
  global $mysql_serveur, $mysql_identifiant, $mysql_motdepasse, $mysql_base;
  
!   @mysql_connect($mysql_serveur,$mysql_identifiant,$mysql_motdepasse)
!     or die("Impossible de se connecter au serveur mysql. 
!             <p><a href=\"config.php?operation=200\">Refaire une 
configuration</a></p>");
!   @mysql_select_db($mysql_base)
!     or die("Impossible de se connecter à la base de données.
!             <p><a href=\"config.php?operation=200\">Refaire une 
configuration</a></p>");
  }
  
***************
*** 66,68 ****
  }
  
! ?>
\ No newline at end of file
--- 70,72 ----
  }
  
! ?>

Index: structures.inc.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/structures.inc.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** structures.inc.php  28 Jan 2003 23:13:45 -0000      1.4
--- structures.inc.php  4 Feb 2003 23:31:58 -0000       1.5
***************
*** 116,137 ****
  
  // Partie de formulaire
! function ChoixSalle($id_localisation, $enable="")
! {
!    if ($enable=="disabled")
!      echo "<input type=\"hidden\" name=\"id_localisation\" 
value=\"$id_localisation\">";
!    echo "<td><select name=\"id_localisation\" $enable>\n";
!    echo "<option></option>\n";
!    $req="SELECT *, localisations.id AS id_localisation FROM localisations
!              LEFT JOIN structures ON localisations.id_structure=structures.id
!              ORDER BY ville, structure, salle";
!    $res = executeRequete($req);
  
!    while ($lieux = mysql_fetch_object($res))
!    {
!       echo "<option value=\"$lieux->id_localisation\"";
!       if ($id_localisation == $lieux->id_localisation) echo " selected";
!       echo ">$lieux->ville - $lieux->structure - $lieux->salle</option>\n";
!    }
!    echo "</select></td>\n";
  }
  
--- 116,143 ----
  
  // Partie de formulaire
! function ChoixSalle($id_localisation, $enable="", $droit=TRUE)
! {   
! global $id_structure;
!   if ($enable=="disabled")
!     echo "<input type=\"hidden\" name=\"id_localisation\" 
value=\"$id_localisation\">";
!   else
!   {
!     echo "<td><select name=\"id_localisation\" $enable>\n";
!     echo "<option></option>\n";
!     $req="SELECT *, localisations.id AS id_localisation FROM localisations
!               LEFT JOIN structures ON 
localisations.id_structure=structures.id";
!     if ($droit && $id_structure)
!       $req.=" WHERE id_structure=\"$id_structure\"";
!     $req.="   ORDER BY ville, structure, salle";
!     $res = executeRequete($req);
  
!     while ($lieux = mysql_fetch_object($res))
!     {
!         echo "<option value=\"$lieux->id_localisation\"";
!         if ($id_localisation == $lieux->id_localisation) echo " selected";
!         echo ">$lieux->ville - $lieux->structure - $lieux->salle</option>\n";
!     }
!     echo "</select></td>\n";
!   }
  }
  

Index: structures.php
===================================================================
RCS file: /cvsroot/epnadmin/epnadmin/structures.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** structures.php      5 Jan 2003 20:34:01 -0000       1.7
--- structures.php      4 Feb 2003 23:31:58 -0000       1.8
***************
*** 23,26 ****
--- 23,32 ----
  
  require_once("header.inc.php");
+ if (! defined("FCT_STRUCTURES"))
+ {
+       echo $fctnonactive;
+       exit;
+ }
+ 
  require_once("constantes.inc.php");             // définition des constantes
  //require_once("fonctions.inc.php");              // concernant des fonctions 
transversales inclassables
***************
*** 43,47 ****
  <?
  $titr = "Gestion des structures partenaires";
! $datemaj="5 janvier 2003";
  require("entete.inc.php");
  
--- 49,53 ----
  <?
  $titr = "Gestion des structures partenaires";
! $datemaj="3 février 2003";
  require("entete.inc.php");
  
***************
*** 49,53 ****
  function affiche_structure($id_structure)
  {
! global $isadmin;
    $res=recherche("structures", "id", $id_structure);
    $structure=mysql_fetch_object($res);
--- 55,60 ----
  function affiche_structure($id_structure)
  {
! global $id_structure, 
!       $pasledroit;
    $res=recherche("structures", "id", $id_structure);
    $structure=mysql_fetch_object($res);
***************
*** 67,292 ****
  }
  
  // Début du contenu de la page
  
! if ($id_structure)
  {
!   if ($isadmin!='super' || !$id_stru)  // si pas super administrateur, on ne 
peut voir que sa propre structure
!     $id_stru=$id_structure;
  
!   switch($operation)
    {
!   case 61 : // Enregistrement du changement de mot de passe de l'usager
      $mes="";
!     if ($motdepasse=="" && ($isadmin!='super' || $id_structure==$id_stru))
!       $mes .= "- le mot de passe actuel n'a pas été saisi<br>";
!     $res=recherche("structures", "id", $id_stru);
!     if (! $structure=mysql_fetch_object($res))
!       $mes.="- la structure est introuvable<br>";
!     // vérifier que l'ancien mot de passe est bien le bon
!     //         uniquement si on n'est pas administrateur
!     if ($isadmin!='super' && $motdepasse!=$structure->motdepasse
!                           && md5($motdepasse)!=$structure->motdepasse) 
$mes.="- le mot de passe actuel n'est pas le bon<br>";
!     if ($motdepasse1=="") $mes .= "- le nouveau mot de passe n'a pas été 
saisi<br>";
!     if ($motdepasse1!=$motdepasse2) $mes .= "- les deux saisies du nouveau 
mot de passe sont différentes<br>";
!     if ($id_stru=="") $mes .= "- problème d'identifiant de la structure<br>";
      if ($mes!="")
-       echo "<p>$mes</p>";
-     else
      {
!       // modification du compte de structure dans la base locale epnadmin
!       echo "<p>Changement de mot de passe dans la base PHP d'epnadmin</p>";
!       $motdepassec=md5($motdepasse1);
!       $query = "UPDATE structures SET motdepasse='$motdepassec' WHERE 
id='$id_stru'";
!       $result = executeRequete($query);
        break;
      }
! 
!   case 6 : // Une structure demande à changer de mot de passe
!       $res=recherche("structures", "id", $id_stru);
!       if ($structure=mysql_fetch_object($res))
!       {
!         echo "<form name=\"form_mp_structure\" method=\"post\" 
action=\"$PHP_SELF\">
              <input type=\"hidden\" name=\"id_stru\" value=\"$id_stru\">
!             <input type=\"hidden\" name=\"operation\" value=\"61\">
!             <table border=\"1\" align=\"center\" 
bgColor=\"".COULEUR_STRUCTURE."\" width=\"60%\">
!             <tr><th align=center colspan=2>Changement de mot de passe de la 
structure ".structure($id_stru)." ($structure->login)</th></tr>";
!       // Si on est administrateur, on ne demande pas le mot de passe en cours
!       if ($isadmin!='super' || $id_stru==$id_structure)
!         echo "<tr><td>Mot de passe actuel*</td><td><input type=\"password\" 
name=\"motdepasse\"></td></tr>";
!       echo "<tr><td>Nouveau mot de passe*</td><td><input type=\"password\" 
name=\"motdepasse1\"></td></tr>
!             <tr><td>Nouveau mot de passe* (confirmation)</td><td><input 
type=\"password\" name=\"motdepasse2\"></td></tr>
!             <tr><td align=center colspan=2><input type=\"submit\" 
value=\"Envoyer\"></td></tr>
!             <tr><td colspan=2>Le mot de passe sera modifié dans la base 
epnadmin, mais ni
!             pour l'identification FTP (site web), ni pour celle de 
l'administration de
!             la messagerie électronique.</td></tr>
!             </table></form>\n";
!       }
!       else
!         echo "<p>Problème : structure non trouvée dans la base.</p>\n";
        break;
  
!     case 3 : // Confirmation d'effacement
!         $res = recherche("sessions", "id_structure", $id_stru);
!         if (mysql_fetch_object($res))
!         {
!             echo "<p>Désolé, mais la structure est utilisés dans des sessions,
!                      il n'est pas possible de la supprimer.</p>\n";
!         }
!         else
!         {
!           echo "<table  bgColor=\"".COULEUR_STRUCTURE."\" align=center>
!                 <form name=\"form\" method=\"post\" action=\"structures.php\">
!                    <input type=\"hidden\" name=\"id_stru\" value=\"$id_stru\">
!                    <input type=\"hidden\" name=\"operation\" value=\"31\">
!                 <tr><td><b>Suis-je sûr(e) de vouloir supprimer le partenaire 
";
!           echo structure($id_stru);
!           echo " ?</b></td></tr>
!                 <tr><td><input type=\"submit\" action=\"structures.php\" 
name=\"Annuler\" value=\"Oui, je supprime le partenaire.\"></td></tr>
!                </form></table>\n";
!         }
!         break;
!     case 31:  // Efface final
!         $query = "DELETE FROM structures WHERE id='$id_stru'";
!         $result = executeRequete($query);
!         echo "<p>Structure effacée.</p>";
!         break;
  
!     case 2:   // Formulaire modification
!         if (0==1 && !$isadmin)
!         {
!           echo "<p>Je crois bien que tu as dû te perdre là où il ne fallait 
pas...</p>";
!           break;
!         }
!         $result = recherche("structures", "id", $id_stru);
!         if (! $u=mysql_fetch_array($result))
!         {
!            echo "<p>Le partenaire n'apparaît pas dans la base !</p>\n";
!            break;
!         }
!         $operation=21;
!         extract($u);
! 
!     case 1:  // Ajoute un nouveau partenaire (ou le modifie)
!        if ($operation==1)
!        {
!          if ($isadmin!='super')
!          {
!            echo "<p>Je crois bien que tu as dû te perdre là où il ne fallait 
pas...</p>";
!            break;
!          }
!          $operation=11;
!        }
!        echo "<table align=center border=1 bgcolor=\"".COULEUR_STRUCTURE."\">
!              <form name=\"modistru\" method=\"post\" 
action=\"structures.php\">\n";
!        if ($operation==21)
!           echo "<input type=\"hidden\" name=\"id_stru\" 
value=\"$id_stru\">\n";
!        echo "<input type=\"hidden\" name=\"operation\" value=\"$operation\">
!              <tr><td>Structure* :</td><td><input type=\"text\" 
name=\"structur\" value=\"$structure\" size=\"32\" maxlength=\"30\"></td></tr>
!              <tr><td>Raison sociale :</td><td><input type=\"text\" 
name=\"raison_sociale\" value=\"$raison_sociale\" size=\"50\" 
maxlength=\"50\"></td></tr>
!              <tr><td>Nom du responsable :</td><td><input type=\"text\" 
name=\"nom_responsable\" value=\"$nom_responsable\" size=\"32\" 
maxlength=\"50\"></td></tr>
!              <tr><td>Identifiant* :</td><td>";
!        if ($operation==11)
!          echo "<input type=\"text\" name=\"login\" value=\"$login\" 
size=\"32\" maxlength=\"30\">";
!        else
!          echo "<i>non modifiable</i>";
!        echo "</td></tr>
!              <tr><td>Mot de passe* :</td><td>";
!        if ($operation==21)
!          echo "<a href=\"$PHP_SELF?operation=6&id_stru=$id_stru\">le 
modifier</a>";
!        else
!          echo "<input type=\"password\" name=\"motdepasse\" value=\"\" 
size=\"32\" maxlength=\"32\"><br>
!                <input type=\"password\" name=\"motdepasse2\" value=\"\" 
size=\"32\" maxlength=\"32\">";
!        echo "</td></tr>
!              <tr><td>Adresse :</td><td><input type=\"text\" name=\"adresse\" 
value=\"$adresse\" size=\"32\" maxlength=\"100\"></td></tr>
!              <tr><td>Ville* :</td><td><input type=\"text\" name=\"ville\" 
value=\"$ville\" size=\"32\" maxlength=\"50\"></td></tr>
!              <tr><td>Courriel :<br>(déjà existant)</td><td><input 
type=\"text\" name=\"courriel\" value=\"$courriel\" size=\"32\" 
maxlength=\"50\"></td></tr>
!              <tr><td>Site web :<br>(déjà existant)</td><td><input 
type=\"text\" name=\"siteweb\" value=\"$siteweb\" size=\"32\" 
maxlength=\"50\"></td></tr>
!              <tr><td>Commentaires :</td><td><textarea name=\"commentaires\" 
rows=\"4\" cols=\"60\">$commentaires</textarea>\n";
!        if ($isadmin=='super')
!        {
!           echo "<tr><td>Héberge ses usagers<br>sur le serveur linux 
:</td><td><input type=\"radio\" name=\"compte_local_linux\" value=\"non\"";
!           if ($compte_local_linux!="oui") echo " checked";
!           echo ">Non <input type=\"radio\" name=\"compte_local_linux\" 
value=\"oui\"";
!           if ($compte_local_linux=="oui") echo " checked";
!           echo ">Oui</td></tr>
!                 <tr><td>Administrateur :</td><td><input type=\"radio\" 
name=\"admin\" value=\"non\"";
!           if ($admin=="non") echo " checked";
!           echo ">Non <input type=\"radio\" name=\"admin\" value=\"oui\"";
!           if ($admin=="oui") echo " checked";
!           echo ">Oui <input type=\"radio\" name=\"admin\" value=\"super\"";
!           if ($admin=="super") echo " checked";
!           echo ">Super</td></tr>";
!        }
!        else
!           echo "<input type=\"hidden\" name=\"compte_local_linux\" 
value=\"$compte_local_linux\">
!                 <input type=\"hidden\" name=\"admin\" value=\"$admin\">";
!        echo "<tr><td align=center colspan=2>
!              <input type=\"submit\" name=\"Envoyer\" value=\"Mettre à jour\">
!              </td></tr></table></form>\n";
!        break;
! 
!     case 11:  // Ajout final
!         if ($isadmin!='super')
!         {
!           echo "<p>Je crois bien que tu as dû te perdre là où il ne fallait 
pas...</p>";
!           break;
!         }
!         // vérification des paramètres
!         $query = "INSERT INTO structures
!                             
(structure,raison_sociale,nom_responsable,login,motdepasse,
!                              adresse,ville,courriel,siteweb,commentaires,
!                              compte_local_linux,admin)
!                      VALUES (\"$structur\", \"$raison_sociale\", 
\"$nom_responsable\",
!                              \"$login\", \"$motdepasse\", \"$adresse\", 
\"$ville\",
!                              \"$courriel\", \"$siteweb\", \"$commentaires\",
!                              \"$compte_local_linux\", \"$admin\")";
!         if (executeRequete($query))
!            echo "<p>Structure ajoutée.</p>";
!         break;
  
!     case 21:  // Modif finale
!         $query = "UPDATE structures SET
!                         structure=\"$structur\", 
raison_sociale=\"$raison_sociale\",
!                         nom_responsable=\"$nom_responsable\",
!                         adresse=\"$adresse\", ville=\"$ville\",
!                         courriel=\"$courriel\", siteweb=\"$siteweb\",
!                         commentaires=\"$commentaires\",
!                         compte_local_linux=\"$compte_local_linux\", 
admin=\"$admin\"
!                      WHERE id=\"$id_stru\"";
!         if ($result = executeRequete($query))
!           echo "<p>Structure modifiée.</p>";
          break;
  
!     case 5 : // liste des structures
!       if ($isadmin='super')
!       {
!         $req = "SELECT * FROM structures ORDER BY structure";
!         $res = executeRequete($req);
!         echo "<table align=center border=1>
!               <tr><td colspan=6><h3 align=center>Liste des 
partenaires</h3></td></tr>\n";
!         while ($u= mysql_fetch_object($res))
!         {
!            echo "<tr><td><b>$u->structure</b><br>$u->raison_sociale</td>
!                      <td>$u->nom_responsable<br>$u->adresse<br><a 
href=\"mailto:$u->courriel\">$u->courriel</a></td>
!                      <td>".nl2br($u->commentaires)."</td>
!                      <td><a 
href=\"structures.php?id_stru=$u->id\">$info</a></td>
!                      <td><a 
href=\"structures.php?operation=2&id_stru=$u->id\">$modifier</a></td>
!                      <td><a 
href=\"structures.php?operation=3&id_stru=$u->id\">$supprimer</a></td></tr>\n";
!         }
!         echo "<tr><td colspan=6 align=right><a 
href=\"structures.php?operation=1\">$ajouter</a></td></tr>\n";
!         echo "</table>\n";
!       }
        break;
  
!     default : // infos sur une structure
!       echo "<table align=center bgcolor=\"".COULEUR_STRUCTURE."\">
!             <tr><td align=center><font size=\"+2\">Informations sur ma 
structure</font></td></tr>
!             <tr><td align=center>\n";
!       affiche_structure($id_stru);
!       echo "</td></tr></table>\n";
        echo "<p align=center><a 
href=\"$PHP_SELF?operation=2&id_stru=$id_stru\">$modifier Modifier des 
informations</a></p>\n";
!       if ($isadmin=='super')
!         echo "<p align=center><a 
href\"".$PHP_SELF."?operation=3&id_stru=$id_stru\">$supprimer Supprimer la 
structure</a></p>\n";
  
        // Affichage des localisations
        $req = "SELECT * FROM localisations";
--- 74,371 ----
  }
  
+ function verifiedroits($acces="r", $id_stru)
+ {
+ global $id_structure,
+       $pasledroit;
+       if (STRUCTURES_MOI>=$acces && $id_stru==$id_structure)
+               return TRUE;
+       if (STRUCTURES_AUTRES>=$acces)
+               return TRUE;
+       echo $pasledroit;
+       return FALSE;
+ }
+ 
  // Début du contenu de la page
  
! if (STRUCTURES<="~")
  {
!   echo $pasledroit;
!   exit;
! }
  
! switch($operation)
! {
! case 61 : // Enregistrement du changement de mot de passe de l'usager
!   if (! verifiedroits("w", $id_stru))
!     break;
!   $mes="";
!   if ($motdepasse=="" && $id_structure==$id_stru)
!     $mes .= "- le mot de passe actuel n'a pas été saisi<br>";
!   $res=recherche("structures", "id", $id_stru);
!   if (! $structure=mysql_fetch_object($res))
!     $mes.="- la structure est introuvable<br>";
!   // vérifier que l'ancien mot de passe est bien le bon
!   //         uniquement si on n'est pas administrateur
!   if ($id_structure==$id_stru && $motdepasse!=$structure->motdepasse
!                         && md5($motdepasse)!=$structure->motdepasse) $mes.="- 
le mot de passe actuel n'est pas le bon<br>";
!   if ($motdepasse1=="") $mes .= "- le nouveau mot de passe n'a pas été 
saisi<br>";
!   if ($motdepasse1!=$motdepasse2) $mes .= "- les deux saisies du nouveau mot 
de passe sont différentes<br>";
!   if ($id_stru=="") $mes .= "- problème d'identifiant de la structure<br>";
!   if ($mes!="")
!     echo "<p>$mes</p>";
!   else
    {
!     // modification du compte de structure dans la base locale epnadmin
!     echo "<p>Changement de mot de passe dans la base PHP d'epnadmin</p>";
!     $motdepassec=md5($motdepasse1);
!     $query = "UPDATE structures SET motdepasse='$motdepassec' WHERE 
id='$id_stru'";
!     $result = executeRequete($query);
!     break;
!   }
! 
! case 6 : // Une structure demande à changer de mot de passe
!   if (! verifiedroits("w", $id_stru))
!     break;
!   $res=recherche("structures", "id", $id_stru);
!   $structure=mysql_fetch_object($res);
!   echo "<form name=\"form_mp_structure\" method=\"post\" action=\"$PHP_SELF\">
!       <input type=\"hidden\" name=\"id_stru\" value=\"$id_stru\">
!       <input type=\"hidden\" name=\"operation\" value=\"61\">
!       <table border=\"1\" align=\"center\" bgColor=\"".COULEUR_STRUCTURE."\" 
width=\"60%\">
!       <tr><th align=center colspan=2>Changement de mot de passe de la 
structure ".structure($id_stru)." ($structure->login)</th></tr>";
!   // Si on est administrateur, on ne demande pas le mot de passe en cours
!   if ($id_structure!=$id_stru)
!     echo "<tr><td>Mot de passe actuel*</td><td><input type=\"password\" 
name=\"motdepasse\"></td></tr>";
!   echo "<tr><td>Nouveau mot de passe*</td><td><input type=\"password\" 
name=\"motdepasse1\"></td></tr>
!         <tr><td>Nouveau mot de passe* (confirmation)</td><td><input 
type=\"password\" name=\"motdepasse2\"></td></tr>
!         <tr><td align=center colspan=2><input type=\"submit\" 
value=\"Envoyer\"></td></tr>
!         <tr><td colspan=2>Le mot de passe sera modifié dans la base epnadmin, 
mais ni
!         pour l'identification FTP (site web), ni pour celle de 
l'administration de
!         la messagerie électronique.</td></tr>
!         </table></form>\n";
!   break;
! 
!   case 3 : // Confirmation d'effacement
!     if (! verifiedroits("w", $id_stru))
!       break;
      $mes="";
!     if ($id_stru==$id_structure)
!       $mes.=$struestmoi;
!     $res = recherche("sessions", "id_structure", $id_stru);
!     if (mysql_fetch_object($res))
!       $mes.=$strusertsession;
!     $res = recherche("localisations", "id_structure", $id_stru);
!     if (mysql_fetch_object($res))
!       $mes.=$strusertlocal;
!     $res = recherche("animateurs", "id_structure_provenance", $id_stru);
!     if (mysql_fetch_object($res))
!       $mes.=$strusertanimateur;
!     $res = recherche("usagers", "id_structure_provenance", $id_stru);
!     if (mysql_fetch_object($res))
!       $mes.=$strusertusagers;
!     $res = recherche("pret_materiel", "id_structure", $id_stru);
!     if (mysql_fetch_object($res))
!       $mes.=$strusertpret;
! 
      if ($mes!="")
      {
!       echo $mes;
        break;
      }
!     echo "<table  bgColor=\"".COULEUR_STRUCTURE."\" align=center>
!           <form name=\"form\" method=\"post\" action=\"structures.php\">
              <input type=\"hidden\" name=\"id_stru\" value=\"$id_stru\">
!             <input type=\"hidden\" name=\"operation\" value=\"31\">
!           <tr><td><b>Suis-je sûr(e) de vouloir supprimer le partenaire ";
!     echo structure($id_stru);
!     echo " ?</b></td></tr>
!           <tr><td><input type=\"submit\" action=\"structures.php\" 
name=\"Annuler\" value=\"Oui, je supprime le partenaire.\"></td></tr>
!         </form></table>\n";
!     break;
! 
!   case 31:  // Efface final
!     if (! verifiedroits("w", $id_stru))
        break;
+     $mes="";
+     $res = recherche("sessions", "id_structure", $id_stru);
+     if (mysql_fetch_object($res))
+       $mes.=$strusertsession;
+     $res = recherche("localisations", "id_structure", $id_stru);
+     if (mysql_fetch_object($res))
+       $mes.=$strusertlocal;
+     $res = recherche("animateurs", "id_structure_provenance", $id_stru);
+     if (mysql_fetch_object($res))
+       $mes.=$strusertanimateur;
+     $res = recherche("usagers", "id_structure_provenance", $id_stru);
+     if (mysql_fetch_object($res))
+       $mes.=$strusertusagers;
+     $res = recherche("pret_materiel", "id_structure", $id_stru);
+     if (mysql_fetch_object($res))
+       $mes.=$struserthebergement;
  
!     if ($mes!="")
!     {
!       echo $mes;
!       break;
!     }
  
!     $query = "DELETE FROM structures WHERE id='$id_stru'";
!     $result = executeRequete($query);
!     echo "<p>Structure effacée.</p>";
! 
!     $query = "DELETE FROM droits WHERE id_structure='$id_stru'";
!     $result = executeRequete($query);
!     echo "<p>Tous les droits aussi.</p>";
! 
!     break;
  
!   case 2:   // Formulaire modification
!     if (! verifiedroits("w", $id_stru))
!       break;
!     $result = recherche("structures", "id", $id_stru);
!     $u=mysql_fetch_array($result);
!     $operation=21;
!     extract($u);
!     // pas de break
! 
!   case 1:  // Ajoute un nouveau partenaire (ou le modifie)
!     if ($operation==1)
!     {
!       if (! verifiedroits("w", $id_stru))
          break;
+       $operation=11; 
+       $structure="";
+       $login="";
+     }
+     echo "<table align=center border=1 bgcolor=\"".COULEUR_STRUCTURE."\">
+           <form name=\"modistru\" method=\"post\" 
action=\"structures.php\">\n";
+     if ($operation==21)
+         echo "<input type=\"hidden\" name=\"id_stru\" value=\"$id_stru\">\n";
+     echo "<input type=\"hidden\" name=\"operation\" value=\"$operation\">
+           <tr><td>Structure* :</td><td><input type=\"text\" name=\"structur\" 
value=\"$structure\" size=\"32\" maxlength=\"30\"></td></tr>
+           <tr><td>Raison sociale :</td><td><input type=\"text\" 
name=\"raison_sociale\" value=\"$raison_sociale\" size=\"50\" 
maxlength=\"50\"></td></tr>
+           <tr><td>Nom du responsable :</td><td><input type=\"text\" 
name=\"nom_responsable\" value=\"$nom_responsable\" size=\"32\" 
maxlength=\"50\"></td></tr>
+           <tr><td>Identifiant* :</td><td>";
+     if ($operation==11)
+       echo "<input type=\"text\" name=\"login\" value=\"$login\" size=\"32\" 
maxlength=\"30\">";
+     else
+       echo "<i>non modifiable</i>";
+     echo "</td></tr>
+           <tr><td>Mot de passe* :</td><td>";
+     if ($operation==21)
+       echo "<a href=\"$PHP_SELF?operation=6&id_stru=$id_stru\">le 
modifier</a>";
+     else
+       echo "<input type=\"password\" name=\"motdepasse\" value=\"\" 
size=\"32\" maxlength=\"32\"><br>
+             <input type=\"password\" name=\"motdepasse2\" value=\"\" 
size=\"32\" maxlength=\"32\">";
+     echo "</td></tr>
+           <tr><td>Adresse :</td><td><input type=\"text\" name=\"adresse\" 
value=\"$adresse\" size=\"32\" maxlength=\"100\"></td></tr>
+           <tr><td>Ville* :</td><td><input type=\"text\" name=\"ville\" 
value=\"$ville\" size=\"32\" maxlength=\"50\"></td></tr>
+           <tr><td>Courriel :<br>(déjà existant)</td><td><input type=\"text\" 
name=\"courriel\" value=\"$courriel\" size=\"32\" maxlength=\"50\"></td></tr>
+           <tr><td>Site web :<br>(déjà existant)</td><td><input type=\"text\" 
name=\"siteweb\" value=\"$siteweb\" size=\"32\" maxlength=\"50\"></td></tr>
+           <tr><td>Commentaires :</td><td><textarea name=\"commentaires\" 
rows=\"4\" cols=\"60\">$commentaires</textarea>\n";
+     /*       if ($isadmin=='super')
+     {
+         echo "<tr><td>Héberge ses usagers<br>sur le serveur linux 
:</td><td><input type=\"radio\" name=\"compte_local_linux\" value=\"non\"";
+         if ($compte_local_linux!="oui") echo " checked";
+         echo ">Non <input type=\"radio\" name=\"compte_local_linux\" 
value=\"oui\"";
+         if ($compte_local_linux=="oui") echo " checked";
+         echo ">Oui</td></tr>
+               <tr><td>Administrateur :</td><td><input type=\"radio\" 
name=\"admin\" value=\"non\"";
+         if ($admin=="non") echo " checked";
+         echo ">Non <input type=\"radio\" name=\"admin\" value=\"oui\"";
+         if ($admin=="oui") echo " checked";
+         echo ">Oui <input type=\"radio\" name=\"admin\" value=\"super\"";
+         if ($admin=="super") echo " checked";
+         echo ">Super</td></tr>";
+     }
+     else
+         echo "<input type=\"hidden\" name=\"compte_local_linux\" 
value=\"$compte_local_linux\">
+               <input type=\"hidden\" name=\"admin\" value=\"$admin\">"; */
+     echo "<tr><td align=center colspan=2>
+           <input type=\"submit\" name=\"Envoyer\" value=\"Mettre à jour\">
+           </td></tr></table></form>\n";
+     break;
  
!   case 11:  // Ajout final
!     if (! verifiedroits("w", $id_stru))
        break;
  
!     // vérification des paramètres
!     $res=recherche("structures", "login", $login);
!     if (mysql_fetch_object($res))
!       $mes.=$logindejapris;
!     // TODO : plein de choses à vérifier...
! 
!     $query = "INSERT INTO structures
!                         
(structure,raison_sociale,nom_responsable,login,motdepasse,
!                         adresse,ville,courriel,siteweb,commentaires,
!                         date )
!                 VALUES (\"$structur\", \"$raison_sociale\", 
\"$nom_responsable\",
!                         \"$login\", \"$motdepasse\", \"$adresse\", \"$ville\",
!                         \"$courriel\", \"$siteweb\", \"$commentaires\",
!                         NOW())";
!     if (executeRequete($query))
!       echo "<p>Structure ajoutée.</p>";
!     break;
! 
!   case 21:  // Modif finale
!     if (! verifiedroits("w", $id_stru))
!       break;
!     $query = "UPDATE structures SET
!                     structure=\"$structur\", 
raison_sociale=\"$raison_sociale\",
!                     nom_responsable=\"$nom_responsable\",
!                     adresse=\"$adresse\", ville=\"$ville\",
!                     courriel=\"$courriel\", siteweb=\"$siteweb\",
!                     commentaires=\"$commentaires\"
!                 WHERE id=\"$id_stru\"";
!     if ($result = executeRequete($query))
!       echo "<p>Structure modifiée.</p>";
!     break;
! 
!   case 5 : // liste des structures
!     if (STRUCTURES_AUTRES<"r")
!     {
!       echo $pasledroit;
!       break;           
!     }
!     $req = "SELECT * FROM structures ORDER BY structure";
!     $res = executeRequete($req);
!     echo "<table align=center border=1>
!           <tr><td colspan=6><h3 align=center>Liste des 
partenaires</h3></td></tr>\n";
!     while ($u= mysql_fetch_object($res))
!     {
!       echo "<tr><td><b>$u->structure</b><br>$u->raison_sociale</td>
!                 <td>$u->nom_responsable<br>$u->adresse<br><a 
href=\"mailto:$u->courriel\">$u->courriel</a></td>
!                 <td>".nl2br($u->commentaires)."</td>
!                 <td><a href=\"structures.php?id_stru=$u->id\">$info</a></td>";
!       if (verifiedroits("w", $u->id)) // on ne peut pas se détruire
!         echo "  <td><a 
href=\"structures.php?operation=2&id_stru=$u->id\">$modifier</a></td>\n";
!       if (verifiedroits("w", $u->id) && $u->id!=$id_structure) // on ne peut 
pas se détruire
!         echo "  <td><a 
href=\"structures.php?operation=3&id_stru=$u->id\">$supprimer</a></td>";
!       echo "</tr>\n";
!     }
!     if (STRUCTURES_AUTRES>="w")
!       echo "<tr><td colspan=6 align=right><a 
href=\"structures.php?operation=1\">$ajouter</a></td></tr>\n";
!     echo "</table>\n";
!     break;
! 
!   default : // infos sur une structure 
!     if (!$id_stru) $id_stru=$id_structure;
!     if (! verifiedroits("r", $id_stru))
!       break;
!     echo "<table align=center bgcolor=\"".COULEUR_STRUCTURE."\">
!           <tr><td align=center><font size=\"+2\">Informations sur une 
structure</font></td></tr>
!           <tr><td align=center>\n";
!     affiche_structure($id_stru);
!     echo "</td></tr></table>\n";
!     if (verifiedroits("w", $id_stru))
        echo "<p align=center><a 
href=\"$PHP_SELF?operation=2&id_stru=$id_stru\">$modifier Modifier des 
informations</a></p>\n";
!     if (STRUCTURES_AUTRES>="w" && $id_structure!=$id_stru)  // On ne peut pas 
se détruire soi même.
!       echo "<p align=center><a 
href=\"$PHP_SELF?operation=3&id_stru=$id_stru\">$supprimer Supprimer la 
structure</a></p>\n";
  
+     if (defined("FCT_LOCALISATIONS")
+         && (  (LOCALISTIONS_MOI>="r" && $id_stru==$id_structure)
+           || LOCALISATIONS_AUTRES>="r"))
+     {
        // Affichage des localisations
        $req = "SELECT * FROM localisations";
***************
*** 301,322 ****
        {
          echo "<tr><td>".localisation($u->id, true)."</td>";
!         if ($isadmin)
            echo "  <td><a 
href=\"localisations.php?operation=2&id_localisation=$u->id\">$modifier</a></td>
!                   <td><a 
href=\"localisations.php?operation=3&id_localisation=$u->id\">$supprimer</a></td></tr>\n";
        }
!       if ($isadmin)
          echo "<tr><td colspan=3 align=right><a 
href=\"localisations.php?operation=1\">$ajouter</a></td></tr>\n";
        echo "</table></td></tr></table>\n";
!       break;
  
!     }  // switch
!     if ($isadmin=='super')
!       echo "<p>Voir la <a href=\"structures.php?operation=5\">liste des 
partenaires</a>.</p>\n";
! } // if
  else
!   echo "<p>Et l'internaute sorti un hyperlien de son chapeau magique... dans 
tes rêves</p>\n";
  
  include("basdepage.inc.php");
  echo "</body></html>\n";
  require("footer.inc.php");
! ?>
\ No newline at end of file
--- 380,403 ----
        {
          echo "<tr><td>".localisation($u->id, true)."</td>";
!         if ((LOCALISATIONS_MOI>="w" && $id_structure==$id_stru) || 
LOCALISATIONS_AUTRES>="w")
            echo "  <td><a 
href=\"localisations.php?operation=2&id_localisation=$u->id\">$modifier</a></td>
!                   <td><a 
href=\"localisations.php?operation=3&id_localisation=$u->id\">$supprimer</a></td>";
!         echo "</tr>\n";
        }
!       if ((LOCALISATIONS_MOI>="w" && $id_structure==$id_stru) || 
LOCALISATIONS_AUTRES>="w")
          echo "<tr><td colspan=3 align=right><a 
href=\"localisations.php?operation=1\">$ajouter</a></td></tr>\n";
        echo "</table></td></tr></table>\n";
!     }
!     break;
! 
!   }  // switch
  
! if (LOCALISATIONS_AUTRES>="w")
!   echo "<p>Voir la <a href=\"structures.php?operation=5\">liste des 
structures</a>.</p>\n";
  else
!   echo "<p>Voir les <a href=\"structures.php\">informations sur ma 
structure</a>.</p>\n";
  
  include("basdepage.inc.php");
  echo "</body></html>\n";
  require("footer.inc.php");
! ?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]