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.
43 lines
1.3 KiB
43 lines
1.3 KiB
<?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['pseudo_utilisateur'] = $result[0]['utilisateur'];
|
|
$_SESSION['nom_utilisateur'] = $result[0]['nom_complet'];
|
|
$_SESSION['privilege_utilisateur'] = $result[0]['privilege'];
|
|
|
|
if (isset($_SESSION['pseudo_utilisateur']) && !empty($_SESSION['pseudo_utilisateur']) && $_SESSION['privilege_utilisateur']=="administrateur") {
|
|
header ("location: /pages/gestion/administration.php?message=bienvenue&page=alias");
|
|
die();
|
|
}
|
|
elseif (isset($_SESSION['pseudo_utilisateur']) && !empty($_SESSION['pseudo_utilisateur']) && $_SESSION['privilege_utilisateur']=="utilisateur") {
|
|
header ("location: /pages/gestion/administration.php?message=bienvenue&page=alias");
|
|
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();
|
|
}
|
|
|
|
?>
|