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