50 lines
1.1 KiB
PHP
Executable File
50 lines
1.1 KiB
PHP
Executable File
<!DOCTYPE html>
|
|
|
|
<?php
|
|
/*
|
|
petite explication : on démarre le systeme de session de php, on inclu notre authentification
|
|
, on appelle la fonction que vérifie le login et role de l'utilisateur (voir source pour la doc)
|
|
si l'utilisateur est logué, on le redirige vers la page d'accueil de l'outil
|
|
*/
|
|
session_start();
|
|
require('autoloader.php');
|
|
|
|
if(isset($_POST['co'])){
|
|
$Auth = new Authentification();
|
|
$Auth->authentification($_POST['username'],$_POST['password']);
|
|
}
|
|
|
|
if(Authentification::checkUser(0)){
|
|
header("Location: http://".$_SERVER['HTTP_HOST']."/Dashboard.php");
|
|
die();
|
|
};
|
|
?>
|
|
|
|
<html>
|
|
<head>
|
|
<title>Connexion</title>
|
|
|
|
<meta charset='utf-8'/>
|
|
<meta name='description' value='Site de test'/>
|
|
<meta name='author' value='{xdrm} & SeekDaSky'/>
|
|
|
|
|
|
<link rel='stylesheet' href='css/login.css'/>
|
|
</head>
|
|
<body>
|
|
|
|
|
|
<?php
|
|
|
|
echo "<form action='#auth' method='POST'>";
|
|
echo "<input type='text' name='username' placeholder='username'>";
|
|
echo "<input type='password' name='password' placeholder='password'>";
|
|
echo "<input type='submit' name='co' value='Me connecter'>";
|
|
echo "</form>";
|
|
|
|
?>
|
|
|
|
|
|
</body>
|
|
</html>
|