include "../lib/sql.php";
include "../lib/class.php";
include "../lib/fonctions.php";
session_start();
$ERR = "";
$OK = "";
if(isset($_POST["ENVOI"]))
{
if(!$_POST["LOGIN"]) $ERR .= "Vous devez renseigner l'identifiant de connection
";
if(!$_POST["PASSWD"]) $ERR .= "Vous devez renseigner le mot de passe
";
if(!$ERR)
{
if(is_object($Utilisateur = Utilisateur::connectUtilisateur($mySQL, $_POST["LOGIN"], $_POST["PASSWD"])))
{
if($Utilisateur->valid)
{
$_SESSION["UTILISATEUR"] = $Utilisateur;
if($_POST["LOGIN"] == "camilo")
{
$_SESSION["CONSULTATION"] = true;
$_SESSION["NO_MENU"] = true;
header("Location: plannings_occupation.php");
exit();
}
elseif($_POST["LOGIN"] == "victor")
{
$_SESSION["CONSULTATION"] = true;
$_SESSION["NO_MENU"] = true;
header("Location: seo.php");
exit();
}
//header("Location: accueil.php");
header("Location: commandes.php");
exit();
}
else
{
$ERR .= "Une erreur s'est produite. Identification impossible !
";
}
}
else
{
$ERR .= "Identifiant et/ou mot de passe incorrect !
";
}
}
$LOGIN = $_POST["LOGIN"];
$PASSWD = $_POST["PASSWD"];
}
?>