par
myself_o » 11 févr. 2008, 17:17
<?php
/*************************************************************************************
Page permettant l'autentification grace au serveur ldap
**************************************************************************************/
session_start();
header("Pragma: no-cache");
header("Cache-Control: no-cache");
$server = '127.0.0.1';
$port = 389;
$rootdn = 'uid='.$_POST['identifiant'].',ou=Users,dc=fpc';
$rootpw = $_POST[mot_de_passe];
// connexion au serveur LDAP
$ldapconn=ldap_connect($server) or die ("Impossible de se connecter au serveur LDAP");
ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);
// identification sur le serveur LDAP
if ($ldapconn!=FALSE)
{
$ldapbind = @ldap_bind($ldapconn, $rootdn, $rootpw);
ldap_close($ldapconn);
if ($ldapbind){
$_SESSION['user'] = $_POST['identifiant'] ;
header("Location: http://192.168.0.222/mapage.php?login=".$_POST['identifiant']);
}
else {
header("Location: http://192.168.0.222/agenda/index.php?err=1");
}
}
?>
Voili voilou, i don't understand...
[php]<?php
/*************************************************************************************
Page permettant l'autentification grace au serveur ldap
**************************************************************************************/
session_start();
header("Pragma: no-cache");
header("Cache-Control: no-cache");
$server = '127.0.0.1';
$port = 389;
$rootdn = 'uid='.$_POST['identifiant'].',ou=Users,dc=fpc';
$rootpw = $_POST[mot_de_passe];
// connexion au serveur LDAP
$ldapconn=ldap_connect($server) or die ("Impossible de se connecter au serveur LDAP");
ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);
// identification sur le serveur LDAP
if ($ldapconn!=FALSE)
{
$ldapbind = @ldap_bind($ldapconn, $rootdn, $rootpw);
ldap_close($ldapconn);
if ($ldapbind){
$_SESSION['user'] = $_POST['identifiant'] ;
header("Location: http://192.168.0.222/mapage.php?login=".$_POST['identifiant']);
}
else {
header("Location: http://192.168.0.222/agenda/index.php?err=1");
}
}
?> [/php]
Voili voilou, i don't understand...