diff options
author | polo <ordipolo@gmx.fr> | 2021-08-14 01:32:59 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2021-08-14 01:32:59 +0200 |
commit | 07e0291bfad8ef3a8b37bf0d0ebf20df936e7b7f (patch) | |
tree | 81fa397b2482984554c2d559e8cca7e08dfec312 /controller/visitor.php | |
parent | cd4cffac62363c132d5ce98680b0303dd9b4d4f9 (diff) | |
download | melaine-07e0291bfad8ef3a8b37bf0d0ebf20df936e7b7f.zip |
password
Diffstat (limited to 'controller/visitor.php')
-rw-r--r-- | controller/visitor.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/controller/visitor.php b/controller/visitor.php index 16f9c40..539df1f 100644 --- a/controller/visitor.php +++ b/controller/visitor.php | |||
@@ -87,6 +87,7 @@ function connexion($secret) | |||
87 | if($_SESSION['admin'] == 1) | 87 | if($_SESSION['admin'] == 1) |
88 | { | 88 | { |
89 | header('Location: index.php?page=' . $_GET['from']); | 89 | header('Location: index.php?page=' . $_GET['from']); |
90 | exit(); | ||
90 | } | 91 | } |
91 | 92 | ||
92 | // Ajouter une sécurité par cpatcha avec un "input" supplémentaire | 93 | // Ajouter une sécurité par cpatcha avec un "input" supplémentaire |
@@ -105,14 +106,15 @@ function connexion($secret) | |||
105 | { | 106 | { |
106 | $_SESSION['admin'] = 1; | 107 | $_SESSION['admin'] = 1; |
107 | header('Location: index.php?page=' . $_GET['from']); | 108 | header('Location: index.php?page=' . $_GET['from']); |
108 | exit (); | 109 | exit(); |
109 | } | 110 | } |
110 | 111 | ||
111 | // mauvaise mot de passe | 112 | // mauvais mot de passe |
112 | elseif(isset ($_POST["motdepasse"]) AND $_POST["motdepasse"] != $secret) | 113 | elseif(isset ($_POST["motdepasse"]) AND $_POST["motdepasse"] != $secret) |
113 | { | 114 | { |
114 | // défense aux attaques par force brute | 115 | // défense aux attaques par force brute |
115 | // pas parfait, ne marche pas si l'attaquant multiplie les connexions au site | 116 | // pas parfait, ne marche pas si l'attaquant multiplie les connexions au site |
117 | echo($erreurMDP); | ||
116 | sleep(1); | 118 | sleep(1); |
117 | echo($formulaireConnexion); | 119 | echo($formulaireConnexion); |
118 | } | 120 | } |
@@ -124,4 +126,4 @@ function connexion($secret) | |||
124 | } | 126 | } |
125 | 127 | ||
126 | echo($footer); | 128 | echo($footer); |
127 | } \ No newline at end of file | 129 | } |