Amélioration de la gestion des encodages.
[auf_paf.git] / index_pwd.php
1 <?php
2 error_reporting (E_ALL ^ E_NOTICE); //------pour &eacute;viter les notices sur les variables---------------
3 session_start();
4 $admin=$_SESSION["adminAUFPPKH"];
5 $UserName=$_SESSION["UserNamePAF"];
6 $Password=$_SESSION["PasswordPAF"];
7 include("includes/redirect.php");
8 if(!($admin == "y")){
9 redirect("index.php");
10 }
11
12 ?>
13 <?php
14 header("Content-type: text/html; charset=utf-8");
15 ?>
16 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
17 <html xmlns="http://www.w3.org/1999/xhtml">
18 <head>
19 <title>P A F -- AUF Phnom Penh, Cambodge</title>
20 <link rel="shortcut icon" type="image/ico" href="images/paf.ico" />
21 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
22 <link href="includes/styles/style.css" rel="stylesheet" type="text/css" />
23 </head>
24 <?php
25 include("includes/connection.php");
26 include("includes/functions.php");
27 $kompler = "{%#bb^csr%#}";
28 //----------------Sauvegarder les informations-------------------------------
29 if($_REQUEST["cmdSave"]){
30 include("includes/tclyit_cam_pc.php");
31 /*$txtMDP = $_REQUEST["txtMotdepasse"]; echo $txtMDP;
32 $txtMDPC = $_REQUEST["txtMotdepasseconfirmer"]; echo $txtMDPC;*/
33 if($_REQUEST["txtMotdepasse"] != $_REQUEST["txtMotdepasseconfirmer"]){
34 $ErrorMotPasse = "<img src='images/error.png' title='Votre mot de passe confirm&eacute; n`est pas correct.'>";
35 }elseif($_REQUEST["txtMotdepasse"]==""){
36 $ErrorMDP = "<img src='images/error.png' title='Veuillez saisire votre mot de passe.'>";
37 if($_REQUEST["txtMotdepasseconfirmer"]==""){
38 $ErrorMDPC = "<img src='images/error.png' title='Veuillez saisire votre mot de passe confirm&eacute;.'>";
39 }
40 }elseif($_REQUEST["txtMotdepasseconfirmer"]==""){
41 $ErrorMDPC = "<img src='images/error.png' title='Veuillez saisire votre mot de passe confirm&eacute;.'>";
42 if($_REQUEST["txtMotdepasse"]==""){
43 $ErrorMDP = "<img src='images/error.png' title='Veuillez saisire votre mot de passe.'>";
44 }
45 }else{
46 //----------Sauvegarder les informations ---------------
47 $Str = "Update tblinscrit set motdepasse='".encrptPwd(strtolower($_REQUEST["txtMotdepasse"]),$kompler)."' Where id=".substr($_SESSION["UserNamePAF"],1);
48 @mysql_query($Str) or die("Veuillez contacter l'administrateur. On ne peut pas sauvgarder ces informations (modifier mot de passe).");
49 exit;
50 }
51 }
52 ?>
53 <body class="oneColLiqCtrHdr">
54 <form name="PAF" method="post" enctype="application/x-www-form-urlencoded">
55 <div id="container">
56 <div id="header">
57 <table width="100%" cellpadding="0" cellspacing="0">
58 <tr><td colspan="2"><a href="http://www.auf.org/" title="AUF" target="_blank"><img src="images/auf.gif" width="155" height="110" border="0" /></a></td>
59 <td width="39%" align="right"><h1 class="oneColLiqCtrHdr">P A F</h1></td>
60 <td width="41%" valign="bottom" align="right" style="padding-bottom:15px; padding-right:10px;">
61 <?php echo $Rows['1']." ".$Rows['2']; ?> &nbsp; <?php echo $Deconnexion; ?></td>
62 </tr>
63 </table>
64 <!-- end #header --></div>
65 <div id="mainContent">
66 <table width="100%" cellpadding="3" cellspacing="3" border="0" style="border-collapse:collapse;">
67 <tr><td colspan="2"><h2>Modifier vote mot de passe</h2></td>
68 <tr><td width="26%">Nouveau mot de passe :</td>
69 <td width="74%"><input type="password" name="txtMotdepasse" size="25" />&nbsp;&nbsp;<?php echo $ErrorMDP ; ?></td></tr>
70 <tr><td>Confirmer :</td><td><input type="password" name="txtMotdepasseconfirmer" size="25" />&nbsp;&nbsp;<?php echo $ErrorMDPC." ".$ErrorMotPasse; ?></td></tr>
71 <tr><td></td><td><input type="submit" name="cmdSave" value="Sauvegarder" />
72 &nbsp; <?php if($_REQUEST["msg"]=="0"){ echo "<font style='color:#F00F00;'>Connexion &eacute;chou&eacute;e....</font>"; }else{ echo $Message; } ?></td></tr>
73 <tr><td></td><td style="padding-top:10px;"></td></tr>
74 </table>
75 <!-- end #mainContent --></div>
76 <div id="footer">
77 <table cellpadding="0" cellspacing="0" border="0" height="40" width="100%">
78 <tr><td width="80%">Agence Universitaire de la Francophonie -- Antenne de Phnom Penh, Cambodge</td>
79 <td width="20%" align="center">Administrateur</td>
80 </tr>
81 </table>
82 <!-- end #footer --></div>
83 <!-- end #container --></div>
84 </form>
85 </body>
86 </html>