Page MenuHomePhabricator
Paste P991

simple_ldap.php
ActivePublic

Authored by epriestley on Nov 15 2013, 2:12 PM.
Tags
None
Referenced Files
F82124: simple_ldap.php
Nov 15 2013, 2:12 PM
Subscribers
None
<?php
if (!($conn = ldap_connect('127.0.0.1'))) {
die("ldap_connect failed!\n");
}
if (!ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3)) {
die("ldap_set_option failed!\n");
}
if (!ldap_bind($conn, 'sn=ldapuser,ou=People,dc=aphront,dc=com', 'password')) {
die("ldap_bind failed!\n");
}
if (!($results = ldap_search($conn, 'ou=People,dc=aphront,dc=com', 'sn=ldapuser'))) {
die("ldap_search failed!\n");
}
var_dump(ldap_get_entries($conn, $results));

Event Timeline

epriestley changed the title of this paste from untitled to simple_ldap.php.
epriestley updated the paste's language from autodetect to autodetect.