note 45939 added to ref.ldap
| From: | tscott at as dot edu dot au | Date: | Fri, 24 Sep 2004 04:31:03 +0000 |
| Subject: | note 45939 added to ref.ldap | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77293@lists.php.net to get a copy of this message | ||
LDAP Authentication Code for Panther Server OS X
function auth_user($user,$pass) {
$ldapserver = 'ldap://xxx.xxx.xxx.xxx/';
$ds=ldap_connect($ldapserver);
if ($ds) {
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
$dn="uid=$user,cn=users,dc=as,dc=edu,dc=au";
$r=ldap_bind($ds,$dn,$pass);
if ($r) { echo "logged in";
} else {
echo "sorry";
}
}
}
----
Manual Page -- http://www.php.net/manual/en/ref.ldap.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45939
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45939&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45939&report=yes
Search -- http://master.php.net/manage/user-notes.php