diff --git a/fonctions.php b/fonctions.php index 0088e007aa4eec506e1d7b49f05ffe08ba798357..db738a42b921bb09b6aa4a80377a3e4d795134ad 100644 --- a/fonctions.php +++ b/fonctions.php @@ -111,7 +111,7 @@ function is_error($cerr) function is_user() { - return isset($_SERVER['REMOTE_USER']) || (isset($_SESSION['nom'])); + return ( USE_REMOTE_USER && isset($_SERVER['REMOTE_USER']) ) || (isset($_SESSION['nom'])); } diff --git a/infos_sondage.php b/infos_sondage.php index 9c56deaae5c5a45968e69bdeb15338d042b80e22..1384d1a1257327ca8848a0ddf74c72f18ab5cfff 100644 --- a/infos_sondage.php +++ b/infos_sondage.php @@ -192,7 +192,7 @@ if ($erreur_injection_commentaires) { echo '</tr>'."\n"; echo '<tr><td>'. _("Your name*: ") .'</td><td>'; -if (isset($_SERVER['REMOTE_USER'])) { +if (USE_REMOTE_USER && isset($_SERVER['REMOTE_USER'])) { echo '<input type="hidden" name="nom" size="40" maxlength="40" value="'.$_SESSION["nom"].'">'.stripslashes($_SESSION["nom"]).'</td>'."\n"; } else { echo '<input type="text" name="nom" size="40" maxlength="40" value="'.stripslashes($_SESSION["nom"]).'"></td>'."\n"; @@ -207,7 +207,7 @@ if (!$_SESSION["nom"] && issetAndNoEmpty("poursuivre")) { echo '</tr>'."\n"; echo '<tr><td>'. _("Your e-mail address *: ") .'</td><td>'; -if (isset($_SERVER['REMOTE_USER'])) { +if (USE_REMOTE_USER && isset($_SERVER['REMOTE_USER'])) { echo '<input type="hidden" name="adresse" size="40" maxlength="64" value="'.$_SESSION["adresse"].'">'.$_SESSION["adresse"].'</td>'."\n"; } else { echo '<input type="text" name="adresse" size="40" maxlength="64" value="'.$_SESSION["adresse"].'"></td>'."\n"; @@ -269,4 +269,4 @@ echo '</form>'."\n"; //bandeau de pied bandeau_pied(); echo '</body>'."\n"; -echo '</html>'."\n"; \ No newline at end of file +echo '</html>'."\n"; diff --git a/studs.php b/studs.php index fd89460dd39f6301b4ca7a1567b644699e4c834c..190b52a6de5a8b7ec93b0d5f132f007a529b9c67 100644 --- a/studs.php +++ b/studs.php @@ -136,7 +136,7 @@ if (!is_error(NO_POLL) && (isset($_POST["boutonp"]) || isset($_POST["boutonp_x"] $err |= NAME_EMPTY; } - if(!is_error(NAME_EMPTY) && (!isset($_SERVER['REMOTE_USER']) || $_POST["nom"] == $_SESSION["nom"])) { + if(!is_error(NAME_EMPTY) && (! ( USE_REMOTE_USER && isset($_SERVER['REMOTE_USER']) ) || $_POST["nom"] == $_SESSION["nom"])) { $nouveauchoix = ''; for ($i=0;$i<$nbcolonnes;$i++) { // Si la checkbox est enclenchée alors la valeur est 1 @@ -444,7 +444,7 @@ while ($data = $user_studs->FetchNextObject(false)) { $ensemblereponses = $data->reponses; // ligne d'un usager pré-authentifié - $mod_ok = !isset($_SERVER['REMOTE_USER']) || ($nombase == $_SESSION['nom']); + $mod_ok = !( USE_REMOTE_USER && isset($_SERVER['REMOTE_USER']) ) || ($nombase == $_SESSION['nom']); $user_mod |= $mod_ok; // pour chaque colonne @@ -490,7 +490,7 @@ while ($data = $user_studs->FetchNextObject(false)) { } // affichage de la ligne pour un nouvel utilisateur -if (!isset($_SERVER['REMOTE_USER']) || !$user_mod) { +if (! ( USE_REMOTE_USER && isset($_SERVER['REMOTE_USER']) ) || !$user_mod) { echo '<tr class="ajout_reponse">'."\n"; echo '<td class="nom">'."\n"; if (isset($_SESSION['nom'])) { diff --git a/variables.php.template b/variables.php.template index 7a1214cef21c052249bcfc76a3d79c6350d5227c..28471259ba5561bb0760d0c1c300687d7aea443e 100644 --- a/variables.php.template +++ b/variables.php.template @@ -81,6 +81,9 @@ define('URL_PROPRE', false); // Activation de Google Analytics (false si inactif, l'identifiant sinon) define('GOOGLE_ANALYTICS_ID', false); +// Utilisation de l'identité (REMOTE_USER) fournie par le serveur web +define('USE_REMOTE_USER', true); + if (@file_exists('variables.local.php')) { include('variables.local.php'); }