Commit 52048f20 authored by Cellophile's avatar Cellophile 🎨
Browse files

Replace password.php

parent 88c4fedb
<?php
session_start();
include "config.php";
$lecturetest = "okay";
if (isset($_GET['redirect']) !== FALSE) {
$redirect = $_GET['redirect'];
$chemin = "d/".$redirect.".php";
include $chemin;
if (file_exists($chemin)) {
include $chemin;
}else {
header("location: password.php?echec=404");
exit();
}
if (isset($_POST["mdpaverifier"]) !== FALSE) {
if (password_verify($_POST["mdpaverifier"], $mdpstock))
{
if (password_verify($_POST["mdpaverifier"], $mdpstock)) {
header('Status: 301 Moved Permanently', false, 301);
header('Location: '.$urlredirect.'');
exit();
}
else
{
}else{
$erreurpassword = 1;
}
}
}elseif (isset($_GET['echec']) !== FALSE) {
if ($_GET['echec'] == "404") {
$echec = 1;
}else{
header("location: index.php?echec=404");
exit();
}
}else{
header("location: index.php?echec=404");
exit();
exit();
}
?>
<!doctype html>
<html>
<html lang="fr">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>PersonaLink</title>
<title><? echo $titre ?></title>
<link rel="stylesheet" href="/css/style.css" type="text/css">
<link rel="stylesheet" media="only screen and (max-width: 760px)" href="/css/mobile.css" type="text/css">
</head>
......@@ -41,12 +52,14 @@ if (isset($_GET['redirect']) !== FALSE) {
<body>
<div id="conteneur">
<div id="header">
<h1><? echo $titre ?></h1>
<a href="<? echo $urlsite ?>">
<img src="logo-1lientop-min.jpg" class="logo" alt="logo 1lien.top"></a>
</div>
<p>Le lien que vous voulez suivre est protégé par un mot de passe.<p>
<form class="form" role="form" method="post" action="password.php?redirect=<? echo $redirect; ?>">
<form class="form" method="post" action="password.php?redirect=<? echo $redirect; ?>">
<div id="form">
<input class="form-options-champs" type="password" name="mdpaverifier" required="">
<label for="password" style="display: none;">Mot de passe</label>
<input id="password" class="form-options-champs" type="password" name="mdpaverifier" required="">
<div id="bouton-valid-password">
<input class="bouton" type="submit" value="Allons-y !">
</div>
......@@ -59,8 +72,17 @@ if (isset($_GET['redirect']) !== FALSE) {
Mot de passe incorrect.
</div>';
}
if (!empty($_GET['echec'])){
if ($echec == 1){
echo '
<div id="reponse-negative">
Ce lien court n\'existe pas ou a expiré.
</div>';
}
}
?>
<p><a href="<?echo $urlsite?>">Revenir à la page d'accueil</a></p>
<p><a href="<?echo $urlsite?>">Revenir à la page d'accueil</a><br><br></p>
<p><?php echo $version; ?> — © Théophile Bellintani — Licence <a href="licence.php">TROC</a>, <a href="https://framagit.org/Cellophile/personalink">Opensource</a> et gratuit !</p>
</div>
</body>
......
Supports Markdown
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