game/onyx/hb_game/jeu/options_change.php

37 lines
1.3 KiB
PHP
Raw Normal View History

2008-11-18 11:00:00 +00:00
<?php
if(!defined('INDEX')) { header('Location: ../'); exit; }
$titre = 'Changement des options';
if (isset($_GET['auth'])) {
if (!empty($queryUser['mdpNOUV']) && !empty($queryUser['mdpNOUV']) && sha1($queryUser['mdpNOUV']) == $_GET['auth']) {
2008-11-04 11:00:00 +00:00
$bdd->connexion();
$bdd->query("UPDATE user SET mdp = mdpNOUV, mdpNOUV = '', mailNOUV = '' WHERE id = '$id_user';");
$bdd->deconnexion();
2008-11-18 11:00:00 +00:00
$template->assign('message','Votre nouveau mot de passe est en place.');
$template->assign('couleur','green');
$template->display('game/erreur.tpl');
exit;
}
elseif (!empty($queryUser['mailNOUV']) && !empty($queryUser['mailNOUV']) && sha1($queryUser['mailNOUV']) == $_GET['auth']) {
2008-11-04 11:00:00 +00:00
$bdd->connexion();
$bdd->query("UPDATE user SET mail = mailNOUV, mailNOUV = '', mdpNOUV = '' WHERE id = '$id_user';");
$bdd->deconnexion();
2008-11-18 11:00:00 +00:00
$template->assign('message','Votre nouvelle adresse électronique est en place.');
$template->assign('couleur','green');
$template->display('game/erreur.tpl');
exit;
}
else {
$template->assign('message','Impossible d\'authentifier le lien !');
$template->assign('couleur','red');
$template->display('game/erreur.tpl');
exit;
}
}
else {
$template->assign('message','Le lien est incomplet !');
$template->assign('couleur','red');
$template->display('game/erreur.tpl');
exit;
}
?>