Add an option to disable the use of REMOTE_USER

This commit is contained in:
Jean-Philippe Guérard 2011-12-29 20:32:33 +01:00
parent 63837ebd55
commit 23464be59b
3 changed files with 8 additions and 8 deletions

View File

@ -111,7 +111,7 @@ function is_error($cerr)
function is_user() function is_user()
{ {
return isset($_SERVER['REMOTE_USER']) || (isset($_SESSION['nom'])); return ( USE_REMOTE_USER && isset($_SERVER['REMOTE_USER']) ) || (isset($_SESSION['nom']));
} }

View File

@ -192,7 +192,7 @@ if ($erreur_injection_commentaires) {
echo '</tr>'."\n"; echo '</tr>'."\n";
echo '<tr><td>'. _("Your name*: ") .'</td><td>'; 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"; echo '<input type="hidden" name="nom" size="40" maxlength="40" value="'.$_SESSION["nom"].'">'.stripslashes($_SESSION["nom"]).'</td>'."\n";
} else { } else {
echo '<input type="text" name="nom" size="40" maxlength="40" value="'.stripslashes($_SESSION["nom"]).'"></td>'."\n"; 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>'."\n";
echo '<tr><td>'. _("Your e-mail address *: ") .'</td><td>'; 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"; echo '<input type="hidden" name="adresse" size="40" maxlength="64" value="'.$_SESSION["adresse"].'">'.$_SESSION["adresse"].'</td>'."\n";
} else { } else {
echo '<input type="text" name="adresse" size="40" maxlength="64" value="'.$_SESSION["adresse"].'"></td>'."\n"; echo '<input type="text" name="adresse" size="40" maxlength="64" value="'.$_SESSION["adresse"].'"></td>'."\n";

View File

@ -136,7 +136,7 @@ if (!is_error(NO_POLL) && (isset($_POST["boutonp"]) || isset($_POST["boutonp_x"]
$err |= NAME_EMPTY; $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 = ''; $nouveauchoix = '';
for ($i=0;$i<$nbcolonnes;$i++) { for ($i=0;$i<$nbcolonnes;$i++) {
// Si la checkbox est enclenchée alors la valeur est 1 // Si la checkbox est enclenchée alors la valeur est 1
@ -447,7 +447,7 @@ while ($data = $user_studs->FetchNextObject(false)) {
$ensemblereponses = $data->reponses; $ensemblereponses = $data->reponses;
// ligne d'un usager pré-authentifié // 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; $user_mod |= $mod_ok;
// pour chaque colonne // pour chaque colonne
@ -493,7 +493,7 @@ while ($data = $user_studs->FetchNextObject(false)) {
} }
// affichage de la ligne pour un nouvel utilisateur // 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 '<tr class="ajout_reponse">'."\n";
echo '<td class="nom">'."\n"; echo '<td class="nom">'."\n";
if (isset($_SESSION['nom'])) { if (isset($_SESSION['nom'])) {