| [ Index ] |
PHP Cross Reference of IEUF |
[Summary view] [Print] [Text view]
1 <?php 2 require 'inc/autorisation.inc.php'; 3 $id_connecte= 0; 4 if (isset ($_SESSION["id_perso"])) 5 $id_connecte= $_SESSION["id_perso"]; 6 else 7 include 'inc/404.php'; 8 ?> 9 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" 10 "http://www.w3.org/TR/html4/strict.dtd"> 11 <html> 12 <head> 13 <meta name="generator" content="HTML Tidy for Windows (vers 12 April 2005), see www.w3.org"> 14 <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> 15 <title> 16 Modification du mot de passe 17 </title> 18 <link rel="stylesheet" href="formulaire.css" type="text/css"> 19 <script language="JavaScript" type="text/JavaScript"> 20 function Controle() { 21 msg=""; 22 if (document.modif_mdp.nouveau1.value.length < 6) msg+="\nLe mot de passe doit faire au moins 6 caractères"; 23 if (document.modif_mdp.nouveau1.value != document.modif_mdp.nouveau2.value) msg+="\nLes 2 mots de passe ne sont pas identiques"; 24 if (msg != "") { 25 alert (msg); 26 return (false); 27 } 28 return (true); 29 } 30 </script> 31 </head> 32 <body> 33 <?php 34 if ($id_connecte!= 0 && isset($_POST['actuel']) && isset($_POST['nouveau1']) && isset($_POST['nouveau2'])) { 35 if (get_magic_quotes_gpc() == 0) 36 foreach ($_POST as $i=>$n) 37 if (is_string($n))$_POST[$i]= addslashes($n); 38 extract($_POST); 39 include "../inclus/connect_bd.inc.php"; 40 $requete="SELECT mdp FROM utilisateur WHERE id_perso='$id_connecte' AND mdp=SHA1('$actuel')"; 41 $res=mysql_query($requete); if ($res === false) die(mysql_error()); 42 if (mysql_numrows($res) == 1) { 43 $requete="UPDATE utilisateur SET mdp=SHA1('$nouveau1') WHERE id_perso='$id_connecte'"; 44 $res=mysql_query($requete); if ($res === false) die(mysql_error()); 45 echo " 46 <script type='text/javascript'> 47 alert ('Votre mot de passe a été changé'); 48 self.close(); 49 </script> 50 "; 51 exit; 52 } 53 echo "<h1 style='color:red'>Le mot de passe actuel est incorrect</h1><br>"; 54 } 55 ?> 56 <h1> 57 Modification du mot de passe 58 </h1> 59 <form method="post" action="#" name="modif_mdp" id="modif_mdp" onsubmit="return Controle()"> 60 <table style="width: 80%; margin-right: auto; margin-left: auto;" border="1" cellpadding="2" 61 cellspacing="2"> 62 <tbody> 63 <tr> 64 <td align="right" width="347"> 65 Votre mot de passe actuel 66 </td> 67 <td width="595"> 68 <input name="actuel" type="password"> 69 </td> 70 </tr> 71 <tr> 72 <td align="right" width="347"> 73 Nouveau mot de passe 74 </td> 75 <td width="595"> 76 <input name="nouveau1" type="password"> 77 </td> 78 </tr> 79 <tr> 80 <td align="right" width="347"> 81 Ressaisir le nouveau mot de passe 82 </td> 83 <td width="595"> 84 <input name="nouveau2" type="password"> 85 </td> 86 </tr> 87 <tr> 88 <td width="347"> 89 <input name="abandon" value="Abandonner" type="button" onclick="self.close()"> 90 </td> 91 <td width="595"> 92 <input name="validation" value="Valider" type="submit"> 93 </td> 94 </tr> 95 </tbody> 96 </table> 97 </form> 98 </body> 99 </html>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Fri Jan 31 19:59:00 2014 | Cross-referenced by PHPXref 0.7.1 |