correction et ajout du snipet d'authentification pour le Dashboard
This commit is contained in:
parent
bd75baa7bc
commit
c66e7e7dc9
|
@ -1,4 +1,9 @@
|
|||
<?php session_start(); ?>
|
||||
<?php session_start();
|
||||
require('autoloader.php');
|
||||
if(!Authentification::checkUser(0)){
|
||||
header("Location: http://".$_SERVER['HTTP_HOST']."/index.php");
|
||||
die();
|
||||
};?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
@ -38,4 +43,4 @@
|
|||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
22
index.php
22
index.php
|
@ -29,30 +29,14 @@ if(Authentification::checkUser(0)){
|
|||
<meta name='author' value='{xdrm} & SeekDaSky'/>
|
||||
|
||||
|
||||
<link rel='stylesheet' href='globalstylesheet.css'/>
|
||||
<link rel='stylesheet' href='css/login.css'/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<?php /* [1] AFFICHAGE DIFFÉRÉ SI CONNECTÉ
|
||||
==============================================*/
|
||||
<?php
|
||||
|
||||
echo "<form action='#auth' method='POST'>";
|
||||
|
||||
/* AFFICHAGE D'ERREURS */
|
||||
if( $postVariablesAreSet ){ // si formulaire soumis
|
||||
if( !$postVariablesNEmpty )
|
||||
echo '<span class=error>Certains champs requis sont vides.</span>';
|
||||
elseif( !$usernameCheck )
|
||||
echo '<span class=error>Nom d\'utilisateur incorrect. (3 car. min)</span>';
|
||||
elseif( !$mailCheck )
|
||||
echo '<span class=error>Adresse mail incorrecte.</span>';
|
||||
elseif( !$passwordCheck )
|
||||
echo '<span class=error>Mot de passe incorrect. (8 car. min)</span>';
|
||||
elseif( connected($user) )
|
||||
echo '<span class=success>Vous êtes connectés.</span>';
|
||||
}
|
||||
|
||||
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'>";
|
||||
|
@ -62,4 +46,4 @@ if(Authentification::checkUser(0)){
|
|||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue