forked from halo-battle/game
Version 0.7
This commit is contained in:
parent
e0f55450e1
commit
c117da6d77
148 changed files with 1914 additions and 801 deletions
|
|
@ -6,6 +6,7 @@ require('../connectBDD.php');
|
|||
$x = mysql_query("SELECT * FROM user WHERE id='".$id."'");
|
||||
$donnees = mysql_fetch_array($x);
|
||||
|
||||
$pseudo = $donnees['pseudo'];
|
||||
$mail = $donnees['mail'];
|
||||
$mdp = $donnees['mdp'];
|
||||
|
||||
|
|
@ -15,33 +16,39 @@ if (isset($_POST['ancien_mdp']) && isset($_POST['nouveau_mdp']) && isset($_POST[
|
|||
$password = htmlspecialchars($_POST['nouveau_mdp']);
|
||||
$password = sha1(strtoupper($pseudo).':'.$password);
|
||||
mysql_query("UPDATE `user` SET mdp='$password' WHERE ID='$id'");
|
||||
$okmdp = true;
|
||||
header('Location: options.php?ok=2');
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
header('Location: options.php?erreur=2');
|
||||
exit;
|
||||
}
|
||||
else echo "Validation du mot de passe faux";
|
||||
}
|
||||
else echo "Ancien mot de passe faux";
|
||||
else {
|
||||
header('Location: options.php?erreur=3');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isset($_POST['nouveau_mail']) && $_POST['nouveau_mail']!='')
|
||||
{
|
||||
if (preg_match("#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#", $_POST['nouveau_mail']))
|
||||
{
|
||||
|
||||
$result = mysql_query("SELECT mail FROM user WHERE mail='".$_POST["nouveau_mail"]."'");
|
||||
if(mysql_num_rows($result)>=1)
|
||||
{echo "Cette adresse mail est déja utilisé";
|
||||
}
|
||||
else
|
||||
{ $mail=htmlspecialchars($_POST['nouveau_mail']);
|
||||
mysql_query("UPDATE `user` SET mail='".$mail."' WHERE ID='".$id."'"); }
|
||||
if(mysql_num_rows($result)>=1) header('Location: options.php?erreur=1');
|
||||
else {
|
||||
$mail=htmlspecialchars($_POST['nouveau_mail']);
|
||||
mysql_query("UPDATE `user` SET mail='".$mail."' WHERE ID='".$id."'");
|
||||
if (isset($okmdp)) header('Location: options.php?ok=3');
|
||||
else header('Location: options.php?ok=1');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ echo "L'adresse " . $_POST['nouveau_mail'] . " n'est pas valide";}
|
||||
else {
|
||||
header('Location: options.php?erreur=4');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
mysql_close();
|
||||
@header("Location:options.php");
|
||||
|
||||
header('Location: options.php');
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue