From e7cf0e99f41ab8ba3bab8aed516123c6f4ff3979 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Thu, 5 Jul 2018 00:34:06 +0200 Subject: Version final-03-27-12h --- final/app/profil.php | 56 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 11 deletions(-) (limited to 'final/app/profil.php') diff --git a/final/app/profil.php b/final/app/profil.php index 16d3449..eebc750 100644 --- a/final/app/profil.php +++ b/final/app/profil.php @@ -3,20 +3,37 @@ require('include/ludo/session_verify.inc.php'); require_once('include/ludo/html_elements.inc.php'); require_once('include/connect.inc.php'); require_once('include/ju.inc.php'); +require_once('include/je.inc.php'); +require_once('include/tools.inc.php'); if ( isset($_REQUEST['action']) ) { + if ($_POST['action'] == "maj_profil") { - if (1==1)//Verification auth puis traitement + include('auth_dialog.php'); + if ( authentification(addslashes_if_needed($_POST['loginP']),addslashes_if_needed($_POST['pass']),addslashes_if_needed($_POST['methodeAuth'])) === true ) { $nom_func = 'traiter_formulaire_' . $_REQUEST['action']; - $nom_func(); + $result_fonc = $nom_func(); + } + else + { + $result_fonc = -1; } } } +if (isset($_POST['pre_action']) ) +{ + if (($_POST['pre_action'] == "verif_profil" & ($_POST["oldLogin"] == $_POST["loginP"]) | ($_POST["oldMethodeAuth"] == $_POST["methodeAuth"]))) + { + $nom_func = 'traiter_formulaire_maj_profil'; + $result_fonc = $nom_func(); + } +} generate_html_doctype_and_head("Administration du profil"); echo "\n"; + generate_html_divs_menu(); ?>
@@ -37,29 +54,42 @@ else { $nom = $_SESSION['session_loginP']; } -if (isset($_POST['pre_action']) & $_POST['pre_action']=="verif_profil") +$verif_auth = false; +if (isset($_POST['pre_action']) ) { - + if ($_POST['pre_action']=="verif_profil" & ($_POST["oldLogin"] != $_POST["loginP"]) | ($_POST["oldMethodeAuth"] != $_POST["methodeAuth"])) + { + echo "
\n"; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo "
Confirmer votre authentification
Identifiant : ".$_POST['loginP']."
Identifiant : ".stripslashes_if_needed($_POST['loginP'])."
Mot de passe :
"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "
\n"; + $verif_auth=true; + } } -else +if ($verif_auth==false) { $resultat = mysql_query("SELECT * FROM AWOR_Personne WHERE idP = '".$_SESSION['session_idP']."'"); if($resultat != false) { + if (isset($result_fonc)) + { + if ($result_fonc === true) echo "Les modifications ont été prises en compte."; + if ($result_fonc === false) echo "Erreur de modification de votre compte."; + if ($result_fonc === -1) echo "Erreur, le mot de passe et le login ne sont pas conformes."; + echo "

\n"; + + } $p = mysql_fetch_array($resultat); echo "
\n"; echo "\n"; @@ -71,9 +101,13 @@ else echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
Votre adresse mail :
Votre nom :
Votre prenom :
Votre choix d'apparence :";generate_html_div_css_chooser();echo"
\n"; + echo "\n"; + echo "\n"; echo "\n"; + echo "
\n"; echo "
\n"; } -- cgit v1.2.3