Query: ldap_bind
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
LDAP_BIND(3) 1 LDAP_BIND(3) ldap_bind - Bind to LDAP directorySYNOPSISbool ldap_bind NULL NULL (resource $link_identifier, [string $bind_rdn], [string $bind_password])DESCRIPTIONBinds to the LDAP directory with specified RDN and password.PARAMETERSo $link_identifier - An LDAP link identifier, returned by ldap_connect(3). o $bind_rdn - o $bind_password - If $bind_rdn and $bind_password are not specified, an anonymous bind is attempted.RETURN VALUESReturns TRUE on success or FALSE on failure.EXAMPLESExample #1 Using LDAP Bind <?php // using ldap bind $ldaprdn = 'uname'; // ldap rdn or dn $ldappass = 'password'; // associated password // connect to ldap server $ldapconn = ldap_connect("ldap.example.com") or die("Could not connect to LDAP server."); if ($ldapconn) { // binding to ldap server $ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass); // verify binding if ($ldapbind) { echo "LDAP bind successful..."; } else { echo "LDAP bind failed..."; } } ?> Example #2 Using LDAP Bind Anonymously <?php //using ldap bind anonymously // connect to ldap server $ldapconn = ldap_connect("ldap.example.com") or die("Could not connect to LDAP server."); if ($ldapconn) { // binding anonymously $ldapbind = ldap_bind($ldapconn); if ($ldapbind) { echo "LDAP bind anonymous successful..."; } else { echo "LDAP bind anonymous failed..."; } } ?>SEE ALSOldap_unbind(3). PHP Documentation Group LDAP_BIND(3)
Related Man Pages |
---|
ldap_kerberos_bind1_s(3) - redhat |
net::ldap::extension::whoami(3) - centos |
net::ldap::extension::whoami(3) - suse |
net::ldap::extension::whoami(3) - osx |
ldap_errno(3) - php |
Similar Topics in the Unix Linux Community |
---|
ldap issue |
LDAP client config. |
LDAP problems |
ldap recovery |
Openldap: getting error as ldap_bind: Invalid credentials (49) |