diff --git a/admin/deco.php b/admin/deco.php new file mode 100644 index 0000000..079036f --- /dev/null +++ b/admin/deco.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/admin/enigma.php b/admin/enigma.php new file mode 100644 index 0000000..86afd23 --- /dev/null +++ b/admin/enigma.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/admin/gestion_des_acces.php b/admin/gestion_des_acces.php new file mode 100644 index 0000000..159fbb6 --- /dev/null +++ b/admin/gestion_des_acces.php @@ -0,0 +1,65 @@ +prepare("SELECT id FROM admin WHERE pseudo = ?"); + $req->execute(array($pseudo)); + $pseudo_exist = $req->rowCount(); + if ($pseudo_exist == 0) { + $req = $db->prepare("INSERT INTO admin(pseudo, mdp, perm) VALUES(?, ?, ?)"); + $req->execute(array($pseudo, password_hash($mdp, PASSWORD_DEFAULT), $perm)); + } else { + $error = "pseudo déja utilisé"; + } + } else { + $error = "le pseudo ne doit pas dépasser 50 char"; + } + } else { + $error = "Tout les champs doivent être complétés"; + } +} +?> + + + + + + Admin / Accès + + +
+ + + + +
+ ".$error.""; + } + ?> +

+ query('SELECT id, pseudo, perm FROM admin'); + while($admin = $req->fetch()) { + ?> + || || + + + + + \ No newline at end of file diff --git a/admin/index.php b/admin/index.php new file mode 100644 index 0000000..e6760ce --- /dev/null +++ b/admin/index.php @@ -0,0 +1,55 @@ +prepare("SELECT id, mdp FROM admin WHERE pseudo = ?"); + $req->execute(array($pseudo)); + $user_exist = $req->rowcount(); + if ($user_exist == 1) { + while ($user_login = $req->fetch()) { + $passwd = $user_login['mdp']; + if ((password_verify($password, $passwd)) == 1) { + $_SESSION['id'] = $user_login['id']; + header('Refresh:0'); + } else { + $error = "Mot de passe invalide !"; + } + } + } else { + $error = "Identifiant invalide !"; + } + } else { + $error = "Tout les champs doivent être complétés"; + } +} +?> + + + + + + Admin / index + + + +
+ + + +
+ ".$error.""; + } + ?> + + \ No newline at end of file diff --git a/admin/planning.php b/admin/planning.php new file mode 100644 index 0000000..bf9c89f --- /dev/null +++ b/admin/planning.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/admin/script.php b/admin/script.php new file mode 100644 index 0000000..97a98d4 --- /dev/null +++ b/admin/script.php @@ -0,0 +1,50 @@ +prepare("SELECT pseudo, perm FROM admin WHERE id = ?"); + $req_user->execute(array($_SESSION['id'])); + $user_exist = $req_user->rowcount(); + $user = $req_user->fetch(); +} else { + $user_exist = 0; +} + + +if($user_exist != 1) { + if($page != "index") { + header('Location: index.php'); + } +} else { + switch ($user['perm']) { + case 0: + ?> + Index
+ Stats
+ Se déconnecter
+ + Index
+ Planning
+ Stats
+ Se déconnecter
+ + Index
+ Gestion des accès
+ Enigma
+ Planning
+ Stats
+ Vacances
+ Se déconnecter
+ \ No newline at end of file diff --git a/admin/stats.php b/admin/stats.php new file mode 100644 index 0000000..3e23ed7 --- /dev/null +++ b/admin/stats.php @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/admin/t.htaccess b/admin/t.htaccess new file mode 100644 index 0000000..9d9e63b --- /dev/null +++ b/admin/t.htaccess @@ -0,0 +1,4 @@ +AuthName "Vous ne passerez pas (sauf si vous passez)" +AuthType Basic +AuthUserFile ".htpasswd" +Require valid-user \ No newline at end of file diff --git a/admin/t.htpasswd b/admin/t.htpasswd new file mode 100644 index 0000000..6a113f0 --- /dev/null +++ b/admin/t.htpasswd @@ -0,0 +1 @@ +on_est_les_admine:$apr1$sl6wtfnm$kglXQc9t3n0DnNO0dbM./1 \ No newline at end of file diff --git a/admin/vacances.php b/admin/vacances.php new file mode 100644 index 0000000..86afd23 --- /dev/null +++ b/admin/vacances.php @@ -0,0 +1,7 @@ + \ No newline at end of file