note 45939 deleted from ref.ldap by aidan
| From: | aidan@php.net | Date: | Fri, 24 Sep 2004 04:42:42 +0000 |
| Subject: | note 45939 deleted from ref.ldap by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77294@lists.php.net to get a copy of this message | ||
Note Submitter: tscott at as dot edu dot au
----
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";
}
}
}