From 23464be59bccb9c7c6d61f783f2ee9d6fdfa9dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Philippe=20Gu=C3=A9rard?= Date: Thu, 29 Dec 2011 20:32:33 +0100 Subject: [PATCH 1/2] Add an option to disable the use of REMOTE_USER --- fonctions.php | 4 ++-- infos_sondage.php | 6 +++--- studs.php | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fonctions.php b/fonctions.php index adc128b..b7cc066 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'])); } @@ -216,4 +216,4 @@ define('NO_POLL_ID', 0x0001000000); define('INVALID_EMAIL', 0x0010000000); define('TITLE_EMPTY', 0x0100000000); define('INVALID_DATE', 0x1000000000); -$err = 0; \ No newline at end of file +$err = 0; diff --git a/infos_sondage.php b/infos_sondage.php index 9c56dea..1384d1a 100644 --- a/infos_sondage.php +++ b/infos_sondage.php @@ -192,7 +192,7 @@ if ($erreur_injection_commentaires) { echo ''."\n"; echo ''. _("Your name*: ") .''; -if (isset($_SERVER['REMOTE_USER'])) { +if (USE_REMOTE_USER && isset($_SERVER['REMOTE_USER'])) { echo ''.stripslashes($_SESSION["nom"]).''."\n"; } else { echo ''."\n"; @@ -207,7 +207,7 @@ if (!$_SESSION["nom"] && issetAndNoEmpty("poursuivre")) { echo ''."\n"; echo ''. _("Your e-mail address *: ") .''; -if (isset($_SERVER['REMOTE_USER'])) { +if (USE_REMOTE_USER && isset($_SERVER['REMOTE_USER'])) { echo ''.$_SESSION["adresse"].''."\n"; } else { echo ''."\n"; @@ -269,4 +269,4 @@ echo ''."\n"; //bandeau de pied bandeau_pied(); echo ''."\n"; -echo ''."\n"; \ No newline at end of file +echo ''."\n"; diff --git a/studs.php b/studs.php index f113838..7a4b0c8 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 @@ -447,7 +447,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 @@ -493,7 +493,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 ''."\n"; echo ''."\n"; if (isset($_SESSION['nom'])) { From 39185e0960ca20c9410a1c5a115fe7525dc76ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Philippe=20Gu=C3=A9rard?= Date: Fri, 30 Dec 2011 01:26:07 +0100 Subject: [PATCH 2/2] =?UTF-8?q?D=C3=A9finition=20de=20l'option=20USE=5FREM?= =?UTF-8?q?OTE=5FUSER?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- variables.php.template | 3 +++ 1 file changed, 3 insertions(+) diff --git a/variables.php.template b/variables.php.template index e37ef0b..72e60af 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'); }