Commit bb2e626f authored by Romain Benit's avatar Romain Benit 🥇
Browse files

Ajout de mot de passe crypté

parent 3d7cb3d4
......@@ -80,8 +80,9 @@ session_start();
exit;
}
if ( $pass_topic != $pass_bdd ) {
// Si nous avons pas d'érreurs à la requête SQL, nous testons le mot de passe
// Vérification du mot de passe hashé
if (!password_verify($pass_topic, $pass_bdd)) {
//if ( $pass_topic != $pass_bdd ) {
?>
<form class="error" action="accueil.php">
<p>Erreur sur le mot de passe entré.</p>
......
......@@ -19,7 +19,7 @@
$req = $connexion->prepare('INSERT INTO topics(topics, password) VALUES(:topics, :password)');
$req->execute(array(
'topics' => $nom_topic,
'password' => $passwd
'password' => password_hash($passwd, PASSWORD_DEFAULT)
));
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment