Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P991
simple_ldap.php
Active
Public
Actions
Authored by
epriestley
on Nov 15 2013, 2:12 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F82124: simple_ldap.php
Nov 15 2013, 2:12 PM
2013-11-15 14:12:27 (UTC+0)
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
edited the content of this paste.
(Show Details)
Nov 15 2013, 2:12 PM
2013-11-15 14:12:27 (UTC+0)
epriestley
changed the title of this paste from untitled to
simple_ldap.php
.
epriestley
updated the paste's language from
autodetect
to
autodetect
.
Log In to Comment