summaryrefslogtreecommitdiff
path: root/beta_accents/app/auth_dialog.php
diff options
context:
space:
mode:
authorLudovic Pouzenc <ludovic@pouzenc.fr>2018-07-05 00:25:51 +0200
committerLudovic Pouzenc <ludovic@pouzenc.fr>2018-07-05 00:25:51 +0200
commitac54f5224d4470de9d8ae088e1338dea52668c9d (patch)
tree7f77b2a8176343e6632fbd99ff431c21974ef482 /beta_accents/app/auth_dialog.php
parent9738017972a6d4fea655926525b3c67dd85740cf (diff)
download2007-AWOR-ac54f5224d4470de9d8ae088e1338dea52668c9d.tar.gz
2007-AWOR-ac54f5224d4470de9d8ae088e1338dea52668c9d.tar.bz2
2007-AWOR-ac54f5224d4470de9d8ae088e1338dea52668c9d.zip
Renommage beta_accents -> final pour diffs
Diffstat (limited to 'beta_accents/app/auth_dialog.php')
-rw-r--r--beta_accents/app/auth_dialog.php121
1 files changed, 0 insertions, 121 deletions
diff --git a/beta_accents/app/auth_dialog.php b/beta_accents/app/auth_dialog.php
deleted file mode 100644
index 234b092..0000000
--- a/beta_accents/app/auth_dialog.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
- // R&eacute;cup&eacute;ration des param&egrave;tres
- if ( isset($_GET['retour']) && $_GET['retour']!='' )
- { $retour=addslashes( $_GET['retour'] ); } else { $retour='index.php'; }
-
- // Si le formulaire &agrave; &eacute;t&eacute; envoy&eacute;, on le traite ici
- if ( isset($_POST['envoi']) && $_POST['envoi'] === '1' )
- {
- if ( ! ( isset($_POST['loginP']) && isset($_POST['pass']) ) )
- {
- $errmsg = 'Param&egrave;tres incorrects';
- }
- else
- {
- $loginP=addslashes( $_POST['loginP'] );
-
-
- include 'include/ludo/auth.inc.php';
-
- // Code v&eacute;rifiant que la personne qui tente de se connecter est bien r&eacute;f&eacute;renc&eacute;e dans notre base
- include 'include/ludo/fonctions.inc.php';
- // Connexion &agrave; la base et s&eacute;lection de la database
- include 'include/connect.inc.php';
- include 'include/ludo/config.inc.php';
-
- // Requete SQL
- $query = "SELECT idP, loginP, nomP, prenomP, methodeAuth FROM AWOR_Personne WHERE loginP='$loginP';";
- if ( ! $result = @mysql_query($query) )
- {
- // Cas d'erreur
- $errmsg =mysql_generate_errmsg();
- }
- else
- {
- // Initialisation par d&eacute;faut
- $methodeAuth='';
- // Chargement des pr&eacute;f&eacute;rences d'authentification de l'utilisateur
- if ( mysql_num_rows($result) === 1)
- {
- list($idP, $loginP, $nomP, $prenomP, $methodeAuth) = mysql_fetch_row($result);
- }
- // Si le script est lanc&eacute; en local, on saute l'authentification
- if ( ($CONFIG['AUTH']['bypass_if_local'] === true )
- && ( ($_SERVER['REMOTE_ADDR'] == 'localhost') || ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') ) )
- {
- $methodeAuth='bypass';
- }
-
- $auth_is_ok=false;
- switch ( $methodeAuth )
- {
- case 'webetud':
- // TODO
- break;
- // Vous pouvez ajouter d'autres mode d'authentification ici !
- case 'bypass':
- $auth_is_ok=true;
- break;
- default:
- // Tentative d'authentification POP
- if ( ($errno = pop3_auth_simple($loginP, $_POST['pass']) ) != 0 )
- {
- // Authentification &eacute;chou&eacute;e
- $errmsg=pop3_generate_errmsg($errno);
- }
- else
- {
- $auth_is_ok=true;
- }
- break;
- }
- if ( $auth_is_ok === true )
- {
- // Authentification r&eacute;ussie
- session_start();
- $_SESSION['session_loginP']=$loginP;
- $_SESSION['session_nomP']=$nomP;
- $_SESSION['session_prenomP']=$prenomP;
- $_SESSION['session_idP']=$idP;
- require('include/ludo/redir.inc.php');
- html_redir($retour);
- }
- }
- }
- }
-require_once('include/ludo/html_elements.inc.php');
-generate_html_doctype_and_head("Identification");
-?>
-<body onload="javascript:document.forms['auth'].elements['loginP'].focus()">
-<div id="titre"><h2>AWOR</h2></div>
-
-<?php
-generate_html_div_help();
-?>
-<div id="page_accueil">
- <h1>Application Web d'Organisation de R&eacute;union</h1>
- <h2>Veuillez vous identifier</h2>
- <?php echo '<form id="auth" method="post" action="' . $_SERVER['PHP_SELF'] . '">' . "\n"; ?>
- <input type="hidden" name="envoi" value="1" />
- <?php echo '<input type="hidden" name="retour" value="' . $retour . '" />' . "\n" ; ?>
- <div class="aligned">
- <div>
- <span class="label">Votre identifiant :</span>
- <span class="field"><input name="loginP" type="text" size="20" tabindex="1" /></span>
- </div>
- <div>
- <span class="label">Votre mot de passe :</span>
- <span class="field"><input name="pass" type="password" size="20" tabindex="2" /></span>
- </div>
- <div>
- <span class="label"><input type="reset" value="Vider" /></span>
- <span class="field"><input type="submit" value="Valider" /></span>
- </div>
- </div>
-<?php if ( isset ($debug) ) { echo ' <input type="hidden" name="debug" value="true" />' . "\n"; } ?>
- </form>
-</div>
-<?php if ( isset ($errmsg) ) { generate_html_div_errmsg($errmsg); }
-generate_html_div_footer(); ?>
-</body>
-</html>