Re: Ldap question
From: Marcin Dobrucki (Marcin.Dobrucki_at_TAKETHISAWAY.nokia.com)
Date: 02/17/05
- Next message: Guillaume Mahieu: "Share a scanner in a network server with Debian Linux"
- Previous message: harv: "Re: securely access to application logs"
- In reply to: Administrateur de systemes: "Ldap question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 17 Feb 2005 12:30:39 GMT
Administrateur de systemes wrote:
> I have openldap 2.2.10 on solaris 9 Generic_117171-07 .
> We are just using it as an adressbook .
>
> Is there already a cgi or php script to make some queries to an Ldap
> server to get phone number or email adress trough the web interface . No
> add/modify is needed.
Well, it really depends on your schema, but something like this:
...
$ldap = @ldap_connect("ldap://ldap.yoursite.com");
if (!ldap_bind($ldap)) {
print "LDAP bind failed: " . ldap_error($ldap);
return false;
}
else {
$ldap_search_result =
ldap_search($ldap,$your_ldap_base,"something to search for");
$ldap_entries = ldap_get_entries($ldap,$ldap_search_result);
...
ldap_close($ldap);
}
...
And your $ldap_entries should now contain whatever the search returned
(as an associative array).
You, ofcourse, need to make sure your php is compiled with LDAP
support enabled.
/Marcin
- Next message: Guillaume Mahieu: "Share a scanner in a network server with Debian Linux"
- Previous message: harv: "Re: securely access to application logs"
- In reply to: Administrateur de systemes: "Ldap question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|