61 lines
1.9 KiB
PHP
Executable File
61 lines
1.9 KiB
PHP
Executable File
<?php
|
|
session_start();
|
|
header('P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"');
|
|
if(isset($_SESSION['Admin']) and $_SESSION['Admin']==3 and isset($_SESSION['Id'])) {
|
|
$id_cap=$_SESSION['Id'];
|
|
?>
|
|
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Language" content="fr">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
|
|
<title>LE SERVEUR VOCAL DE RESERVATION DES SALLES DE TENNIS</title>
|
|
<link rel="stylesheet" href="style.css" type="text/css">
|
|
</head>
|
|
|
|
<body>
|
|
<div id="tout">
|
|
<?php
|
|
include("enTete.php");
|
|
include("menu.php");
|
|
include("conf.php");
|
|
|
|
echo "<div id='contenu'>";
|
|
echo "<center><h1>Modification du mot de passe</h1></center><br />";
|
|
|
|
$anc_mdp=md5($_POST['anc_mdp']);
|
|
$nouv_mdp=md5($_POST['nouv_mdp']);
|
|
$nouv_mdp2=md5($_POST['nouv_mdp2']);
|
|
|
|
$requete="SELECT mdp FROM capitaines WHERE id_capitaine='$id_cap'";
|
|
$reponse=mysqli_query($db_connection, $requete) or die ("Erreur no".mysqli_errno($db_connection)()." : ".mysqli_error($db_connection)()."<br>");
|
|
$mot_passe=mysqli_fetch_object($reponse);
|
|
if($mot_passe->mdp==$anc_mdp) {
|
|
if($nouv_mdp==$nouv_mdp2) {
|
|
$requete="UPDATE capitaines SET mdp='$nouv_mdp' WHERE id_capitaine='$id_cap'";
|
|
$reponse=mysqli_query($db_connection, $requete) or die ("Erreur no".mysqli_errno($db_connection)()." : ".mysqli_error($db_connection)()."<br>");
|
|
echo "Le mot de passe a été modifié avec succès. Cliquez sur retour pour revenir au menu principal.";
|
|
}
|
|
else {
|
|
echo "Vos deux nouveaux mots de passe ne correspondent pas. Cliquez <a href='modif_mdp_cap.php'>ici</a> pour recommencer.";
|
|
|
|
}
|
|
}
|
|
else {
|
|
echo "Votre ancien mot de passe ne correspond pas avec le mot de passe actuel. Cliquez <a href='modif_mdp_cap.php'>ici</a> pour recommencer.";
|
|
}
|
|
|
|
|
|
echo "<br /><br />";
|
|
include("deco_champ.php");
|
|
include("piedDePage.php");
|
|
}
|
|
else {
|
|
echo("Non autorisé - Redirection vers la page d'identification dans 2 secondes");
|
|
sleep(2);
|
|
include("login_champ.php");
|
|
}
|
|
|
|
?>
|