You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.4 KiB
47 lines
1.4 KiB
4 years ago
|
<?php
|
||
|
require_once($_SERVER["DOCUMENT_ROOT"]."/services/utilisateurs/authentification.php");
|
||
|
|
||
|
if (isset($_POST['identifiant']) && isset($_POST['mdp']) && !empty($_POST['identifiant']) && !empty($_POST['mdp'])) {
|
||
|
|
||
|
/**
|
||
|
* Vérification des informations entrées par l'utilisateur.
|
||
|
*/
|
||
|
$result = validationIdentifiants($pdo,$_POST['identifiant'],$_POST['mdp']);
|
||
|
|
||
|
if($result){
|
||
|
session_start();
|
||
|
$_SESSION['id_utilisateur'] = $result[0]['id'];
|
||
|
$_SESSION['identifiant_utilisateur'] = $result[0]['utilisateur'];
|
||
|
$_SESSION['nom_utilisateur'] = $result[0]['nom_complet'];
|
||
|
$_SESSION['privilege_utilisateur'] = $result[0]['privilege'];
|
||
|
|
||
|
echo "<a href=\"/pages/formulaire_accueil.php?succes=1\">Déconnexion</a>";
|
||
|
|
||
|
if (isset($_SESSION['identifiant_utilisateur']) && !empty($_SESSION['identifiant_utilisateur']) && $_SESSION['privilege_utilisateur']=="administrateur"){
|
||
|
//header ("location: /pages/form_c2r.php");
|
||
|
echo "Administrateur";
|
||
|
die();
|
||
|
}
|
||
|
elseif (isset($_SESSION['identifiant_utilisateur']) && !empty($_SESSION['identifiant_utilisateur']) && $_SESSION['privilege_utilisateur']=="utilisateur"){
|
||
|
//header ("location: /pages/mon_compte/gestion.php");
|
||
|
echo "Utilisateur";
|
||
|
die();
|
||
|
}
|
||
|
else {
|
||
|
echo "Ça ne devrai pas arriver.";
|
||
|
die();
|
||
|
}
|
||
|
|
||
|
}
|
||
|
else {
|
||
|
header('Location: /services/utilisateurs/echec_auth.php');
|
||
|
die();
|
||
|
}
|
||
|
}
|
||
|
else {
|
||
|
header('Location: /services/utilisateurs/echec_auth.php');
|
||
|
die();
|
||
|
}
|
||
|
|
||
|
?>
|