1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| include("../planning/conn3.php");
include("../planning/verif.php");
//PROTECTION DU LOGIN
if (isset($_POST['login']))
{
$_SESSION['login'] = strtolower(logsecure($_POST['login']));
}
//PROTECTION DU MOT PASSE
if (isset($_POST['mdp']))
{
$_SESSION['pass'] = pwdsecure($_POST['mdp']);
}
//VERIFICATION DE L'EXISTENCE DU LOGIN ET DU MOT DE PASSE
if((strlen($_SESSION['login']) > 0) && (strlen($_SESSION['pass']) > 0))
{
//RECUPERATION DES VARIABLES DANS LA BDD ACTIVE DIRECTORY
$filter = "(DN=" . $_SESSION['login'] . ")";
$restriction = array("mail", "userPassword", "uid", "ou", "buildingName");
$info = ldap_search($id, $racine, $filter, $restriction);
if ($info == FALSE)
{
echo "ERROR! ^^";
exit (1);
}
$user = ldap_first_entry($id, $info);
if ($user == FALSE)
{
echo "ERROR! : P";
exit (1);
} |
Partager