correction et ajout du snipet d'authentification pour le Dashboard

This commit is contained in:
SeekDaSky 2015-12-03 10:02:40 +01:00
parent bd75baa7bc
commit c66e7e7dc9
2 changed files with 10 additions and 21 deletions

View File

@ -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> <!DOCTYPE html>
<html> <html>

View File

@ -29,30 +29,14 @@ if(Authentification::checkUser(0)){
<meta name='author' value='{xdrm} & SeekDaSky'/> <meta name='author' value='{xdrm} & SeekDaSky'/>
<link rel='stylesheet' href='globalstylesheet.css'/> <link rel='stylesheet' href='css/login.css'/>
</head> </head>
<body> <body>
<?php /* [1] AFFICHAGE DIFFÉRÉ SI CONNECTÉ <?php
==============================================*/
echo "<form action='#auth' method='POST'>"; 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='text' name='username' placeholder='username'>";
echo "<input type='password' name='password' placeholder='password'>"; echo "<input type='password' name='password' placeholder='password'>";
echo "<input type='submit' name='co' value='Me connecter'>"; echo "<input type='submit' name='co' value='Me connecter'>";