forked from halo-battle/game
Version 1.10c
This commit is contained in:
parent
4c9814a99c
commit
2a066a7498
148 changed files with 2174 additions and 134960 deletions
|
|
@ -11,8 +11,9 @@ if (!empty($_GET['i']) && isset($_GET['n'])) {
|
|||
$bdd->connexion();
|
||||
$bdd->escape($Un);
|
||||
$bdd->escape($Ui);
|
||||
$user = $bdd->unique_query("SELECT * FROM user WHERE pseudo = '$Un' AND mdpNOUV = '$Ui';");
|
||||
if ($user && $bdd->unique_query("UPDATE user SET mdp = mdpNOUV, mdpNOUV = '' WHERE pseudo = '$Un'")) {
|
||||
$user = $bdd->unique_query("SELECT * FROM $table_user WHERE pseudo = '$Un' AND mdpNOUV = '$Ui';");
|
||||
if ($user) {
|
||||
$bdd->query("UPDATE user SET mdp = mdpNOUV, mdpNOUV = '' WHERE pseudo = '$Un'");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('message','Votre mot de passe a été réinitialisé avec succès.');
|
||||
$template->assign('script','<script type="text/javascript">setTimeout(\'document.location.href="?index";\', 3500);</script>');
|
||||
|
|
@ -29,19 +30,29 @@ if (!empty($_GET['i']) && isset($_GET['n'])) {
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['HB_pseudo']) && isset($_POST['HB_mail']) && isset($_POST['HB_captcha'])) {
|
||||
if ((isset($_POST['HB_pseudo']) && isset($_POST['HB_mail']) && isset($_POST['HB_captcha'])) || (isset($_GET['ps']) && isset($_GET['m']) && isset($_GET['a']))) {
|
||||
$ok = true;
|
||||
if (empty($_POST['HB_pseudo']) || empty($_POST['HB_mail'])) {
|
||||
if ((empty($_POST['HB_pseudo']) || empty($_POST['HB_mail'])) && (empty($_GET['ps']) || empty($_GET['m']))) {
|
||||
$ok = false;
|
||||
$erreur .= '<p style="color: #FF0000"><b>Pseudo ou adresse électronique vide :</b><br />Veuillez compléter tous les champs de ce formulaire avant de le valider.</p><br />';
|
||||
}
|
||||
if (strtolower($_POST['HB_captcha']) != strtolower($_SESSION['aleat_nbr'])) {
|
||||
|
||||
if (isset($_GET['m']) && is_numeric('0x'.$_GET['m'])) $_GET['m'] = cxor(hexstr($_GET['m']), date('WYDj'));
|
||||
if (!isset($_POST['HB_captcha'])) $_POST['HB_captcha'] = '';
|
||||
if (strtolower($_POST['HB_captcha']) != strtolower($_SESSION['aleat_nbr']) && gpc('a') != hash_var($_GET['ps'].'☻♫☼'.date('W!Y¨D@j').'Ņ♂↨'.$_GET['m'], "sha512")) {
|
||||
$ok = false;
|
||||
$erreur .= '<p style="color: #FF0000"><b>Code de vérification incorrect :</b><br />Le texte que vous avez recopier ne correspondait pas au texte de l\'image, veuillez recommencer.</p><br />';
|
||||
}
|
||||
if ($ok) {
|
||||
$HB_pseudo = $_POST['HB_pseudo'];
|
||||
$HB_mail = $_POST['HB_mail'];
|
||||
if (strtolower($_POST['HB_captcha']) == strtolower($_SESSION['aleat_nbr'])) {
|
||||
$HB_pseudo = gpc('HB_pseudo', 'post');
|
||||
$HB_mail = gpc('HB_mail', 'post');
|
||||
}
|
||||
else {
|
||||
$HB_pseudo = gpc('ps');
|
||||
$HB_mail = gpc('m');
|
||||
}
|
||||
|
||||
$bdd->connexion();
|
||||
$bdd->escape($HB_pseudo);
|
||||
$bdd->escape($HB_mail);
|
||||
|
|
@ -49,7 +60,7 @@ if (isset($_POST['HB_pseudo']) && isset($_POST['HB_mail']) && isset($_POST['HB_c
|
|||
if ($user) {
|
||||
$liste = "abcdefghijklmnopqrstuvwxyz123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
$code = '';
|
||||
while(strlen($code) != 8) {
|
||||
while(strlen($code) <= 8) {
|
||||
$code .= $liste[rand(0,60)];
|
||||
}
|
||||
$passNOUV = mdp($HB_pseudo, $code, $user['mdp_var']);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue