summaryrefslogtreecommitdiff
path: root/final/app/profil.php
diff options
context:
space:
mode:
Diffstat (limited to 'final/app/profil.php')
-rw-r--r--final/app/profil.php65
1 files changed, 46 insertions, 19 deletions
diff --git a/final/app/profil.php b/final/app/profil.php
index bd88afd..16d3449 100644
--- a/final/app/profil.php
+++ b/final/app/profil.php
@@ -5,8 +5,14 @@ require_once('include/connect.inc.php');
require_once('include/ju.inc.php');
if ( isset($_REQUEST['action']) )
{
- $nom_func = 'traiter_formulaire_' . $_REQUEST['action'];
- $nom_func();
+ if ($_POST['action'] == "maj_profil")
+ {
+ if (1==1)//Verification auth puis traitement
+ {
+ $nom_func = 'traiter_formulaire_' . $_REQUEST['action'];
+ $nom_func();
+ }
+ }
}
generate_html_doctype_and_head("Administration du profil");
@@ -31,27 +37,48 @@ else
{
$nom = $_SESSION['session_loginP'];
}
-$resultat = mysql_query("SELECT * FROM AWOR_Personne WHERE idP = '".$_SESSION['session_idP']."'");
-if($resultat != false)
+if (isset($_POST['pre_action']) & $_POST['pre_action']=="verif_profil")
{
- $p = mysql_fetch_array($resultat);
- echo "<form method=\"post\" action=\"profil.php\" onSubmit=\"return verifProfil()\" >\n";
- echo "<table summary=\"Formulaire permettant de modifier le profil de l'utilisateur\" >\n";
- echo "<tr><td>Methode d'authentification : </td><td>\n<select name=\"methodeAuth\">\n";
- if($p["methodeAuth"] == "webetud") echo "<option value=\"webetud\" selected=\"selected\">Webetud</option>\n"; else echo "<option value=\"webetud\">Webetud</option>\n";
- if($p["methodeAuth"] == "pop") echo "<option value=\"pop\" selected=\"selected\">POP3</option>\n"; else echo "<option value=\"pop\">POP3</option>\n";
- echo "</select></td></tr>\n";
- echo "<tr><td>Votre login :</td><td><input type=\"text\" name=\"loginP\" id=\"loginP\" value=\"".htmlentities($p["loginP"], ENT_QUOTES)."\"/></td></tr>\n";
- echo "<tr><td>Votre adresse mail :</td><td><input type=\"text\" name=\"courrielP\" id=\"courrielP\" value=\"".htmlentities($p["courrielP"], ENT_QUOTES)."\"/></td></tr>\n";
- echo "<tr><td>Votre nom :</td><td><input type=\"text\" name=\"nomP\" id=\"nomP\" value=\"".htmlentities($p["nomP"], ENT_QUOTES)."\"/></td></tr>\n";
- echo "<tr><td>Votre prenom :</td><td><input type=\"text\" name=\"prenomP\" id=\"prenomP\" value=\"".htmlentities($p["prenomP"], ENT_QUOTES)."\"/></td></tr>\n";
- echo "<tr><td colspan=\"2\"><input type=\"submit\" /></td></tr>\n";
- echo "</table>\n";
+
+ echo "<form method=\"post\" action=\"profil.php\" >\n";
+ echo "<table><tr><th>Confirmer votre authentification</th></tr>";
+ echo "<tr><td>Identifiant : ".$_POST['loginP']."</td></tr>";
+ echo "<tr><td>Mot de passe : <input name=\"pass\" type=\"password\" size=\"20\" /></td></tr>";
+ echo "<tr><td><input type=\"submit\" /></td></tr>";
+ echo "</table>";
+ echo "<input type=\"hidden\" name=\"loginP\" value=\"".$_POST['loginP']."\"/>\n";
+ echo "<input type=\"hidden\" name=\"courrielP\" value=\"".$_POST['courrielP']."\"/>\n";
+ echo "<input type=\"hidden\" name=\"nomP\" value=\"".$_POST['nomP']."\"/>\n";
+ echo "<input type=\"hidden\" name=\"methodeAuth\" value=\"".$_POST['methodeAuth']."\"/>\n";
+ echo "<input type=\"hidden\" name=\"prenomP\" value=\"".$_POST['prenomP']."\"/>\n";
echo "<input type=\"hidden\" name=\"action\" value=\"maj_profil\" />\n";
echo "</form>\n";
- echo "</div>\n";
}
-if ( isset ($errmsg) ) generate_html_div_errmsg($errmsg);
+else
+{
+
+ $resultat = mysql_query("SELECT * FROM AWOR_Personne WHERE idP = '".$_SESSION['session_idP']."'");
+ if($resultat != false)
+ {
+ $p = mysql_fetch_array($resultat);
+ echo "<form method=\"post\" action=\"profil.php\" onSubmit=\"return verifProfil()\" >\n";
+ echo "<table summary=\"Formulaire permettant de modifier le profil de l'utilisateur\" >\n";
+ echo "<tr><td>Methode d'authentification : </td><td>\n<select name=\"methodeAuth\">\n";
+ if($p["methodeAuth"] == "webetud") echo "<option value=\"webetud\" selected=\"selected\">Webetud</option>\n"; else echo "<option value=\"webetud\">Webetud</option>\n";
+ if($p["methodeAuth"] == "pop") echo "<option value=\"pop\" selected=\"selected\">POP3</option>\n"; else echo "<option value=\"pop\">POP3</option>\n";
+ echo "</select></td></tr>\n";
+ echo "<tr><td>Votre login :</td><td><input type=\"text\" name=\"loginP\" id=\"loginP\" value=\"".htmlentities($p["loginP"], ENT_QUOTES)."\"/></td></tr>\n";
+ echo "<tr><td>Votre adresse mail :</td><td><input type=\"text\" name=\"courrielP\" id=\"courrielP\" value=\"".htmlentities($p["courrielP"], ENT_QUOTES)."\"/></td></tr>\n";
+ echo "<tr><td>Votre nom :</td><td><input type=\"text\" name=\"nomP\" id=\"nomP\" value=\"".htmlentities($p["nomP"], ENT_QUOTES)."\"/></td></tr>\n";
+ echo "<tr><td>Votre prenom :</td><td><input type=\"text\" name=\"prenomP\" id=\"prenomP\" value=\"".htmlentities($p["prenomP"], ENT_QUOTES)."\"/></td></tr>\n";
+ echo "<tr><td colspan=\"2\"><input type=\"submit\" /></td></tr>\n";
+ echo "</table>\n";
+ echo "<input type=\"hidden\" name=\"pre_action\" value=\"verif_profil\" />\n";
+ echo "</form>\n";
+ echo "</div>\n";
+ }
+ if ( isset ($errmsg) ) generate_html_div_errmsg($errmsg);
+}
?>
<div id="msg"></div>
<?php generate_html_div_footer() ?>