Files
keliopanel-v1/0.8.0/module/compte/changepasswd.php
2016-02-21 01:33:05 +01:00

37 lines
1.3 KiB
PHP
Executable File

<h3>Modification mot de passe</h3>
<p>Vous pouvez modifier à partir de cette page le mot de passe d'accès au panel.</p>
<?php
if ( (VerifPOST("pass-new", "#^[a-z0-9]+$#", 5, 9) == "ChaineValide" AND VerifPOST("pass-new-confirm", "#^[a-z0-9]+$#", 5, 9) == "ChaineValide") AND ($_POST['pass-new'] == $_POST['pass-new-confirm']))
{
$pass = md5(md5($_POST['pass-new']));
$MajPanel = $MySql->Update ("utilisateur", "Password", "$pass", "Utilisateur='".$_SESSION['Utilisateur']."'");
if ( $MajPanel != FALSE )
{
echo '<p>Mot de passe modifié avec succès</p>';
$_SESSION['Hash'] = $pass;
}
else
{
echo '<p>Une erreur est survenue</p>';
}
}
else
{
echo '<div style="width: 500px; margin: auto">
<form action="Page-Compte-MotdePasse.html" method="post">
<table width="500" cellpadding="5">
<tr>
<td style="width:170px">Nouveau mot de passe :</td>
<td><input name="pass-new" type="password" style="border: 0; border-bottom: #006633 1px solid; width:50%" maxlength="9" /></td>
</tr>
<tr>
<td>Confirmation :</td>
<td><input name="pass-new-confirm" type="password" style="border: 0; border-bottom: #006633 1px solid; width:50%" maxlength="9" /></td>
</tr>
</table>
<div style="text-align: center; width: 100%; margin-top: 20px;">
<input type="submit" name="Submit" value="Valider" style=" border: #006633 1px solid; " />
</div>
</form>
</div>';
} ?>