Rapide Advanced Adulte
 
 Web|Image|Shop|Video|News|Wmx|Mobile|Wiki|Ajouter ce moteur

     Manuel PHP     
Partager
 
 
Partager
Partager

 

Table :

.ldap 8859 to t61
.ldap add
.ldap bind
.ldap close
.ldap unbind()
.ldap compare
.ldap connect
.ldap count entries
.ldap delete
.ldap dn2ufn
.ldap err2str
.ldap errno
.ldap error
.ldap explode dn
.ldap first attribute
.ldap first entry
.ldap first reference
.ldap free result
.ldap get attributes
.ldap get dn
.ldap get entries
.ldap get option
.ldap get values len
.ldap get values
.ldap list
.ldap mod add
.ldap mod del
.ldap mod replace
.ldap modify
.ldap next attribute
.ldap next entry
.ldap next reference
.ldap parse reference
.ldap parse result
.ldap read
.ldap rename
.ldap sasl bind
.ldap search
.ldap set option
.ldap set rebind proc
.ldap sort
.ldap start tls
.ldap t61 to 8859
.ldap unbind
 
   

  ldap_bind  


ldap_bind

(PHP 3, PHP 4, PHP 5)

ldap_bind -- Authentification au serveur LDAP

Description

bool ldap_bind ( resource link_identifier [, string bind_rdn [, string bind_password]] )

ldap_bind() s'identifie auprès du serveur LDAP link_identifier, avec le nom d'utilisateur bind_rdn et le mot de passe bind_password. Cette fonction retourne TRUE en cas de succès, FALSE en cas d'échec.

ldap_bind() effecute une opération de bind avec le serveur. bind_rdn et bind_password sont optionnels. S'ils sont omis, une connexion anonyme est tentée.

Exemple 1. Identification avec LDAP

<?php

// Eléments d'identification LDAP
$ldaprdn  = 'nom d\'utilisateur';     // DN ou RDN LDAP
$ldappass = 'mot de passe';           // Mot de passe associé

//Connexion au serveur LDAP
$ldapconn = ldap_connect("ldap.example.com")
    or die(
"Impossible de se connecter au serveur LDAP.");

if (
$ldapconn) {

    
//Connexion au serveur LDAP
    
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);

    
// Identification
    
if ($ldapbind) {
        echo
"Connexion LDAP réussie";
    } else {
        echo
"Connexion LDAP échouée";
    }
        
}

?>

Exemple 2. Connexion anonyme à un serveur LDAP

<?php

//Connexion anonyme à un serveur LDAP

//Connexion au serveur LDAP
$ldapconn = ldap_connect("ldap.example.com")
    or die(
"Impossible de se connecter au serveur LDAP.");

if (
$ldapconn) {

    
// identification anonyme
    
$ldapbind = ldap_bind($ldapconn);

    if (
$ldapbind) {
        echo
'Connexion LDAP anonmye réussie';
    } else {
        echo
'Connexion LDAP anonmye échouée';
    }

}
    
?>

    Annonces       
 

 Retour au chapitre Php

 

Top
 

Ajouter JungleKey.fr à votre Explorateur

 
 

About Us | © 2007 JungleKey




iBlack | Mobile | Wiki | Ajouter ce moteur
.