LDAPCompatibility
Created by: Stephan Borg, Last modification: 10 Jul 2005 (06:49 UTC)
What is LDAP?
From http://en.wikipedia.org/wiki/LDAP - Lightweight Directory Access Protocol (LDAP) is a protocol for accessing on-line directory services.Essentially, LDAP directories are online address books, which corporates often use to centralise their contact information. LDAP has been used to perform other functions such as serving DNS, automount directories, authenticating users and many other roles where centralised information is useful.
How does it work?
LDAP stores contacts (people, organisations, departments, etc) using a unique identified called a Distinguished Name (DN). A DN could look like this - cn=Stephan Borg,ou=people,o=bitweaver. DN's must be unique within the directory and are used to segregate contact information on a per department, organisation or any kind of grouping level.With each DN, an unlimited number of attributes can be associated. This allows pieces of information to be added to a contact in a flexible manner. These attributes are determined by a read-only schema, which is controlled through the LDAP server. Some example attributes are:
Address Book Attribute | LDAP Attribute |
Common Name | cn |
Given name | givenName |
Surname | sn |
Organisation | organisationName |
Job Title | title |
Address | postalAddress |
Web Page | labelURI |
Calendar Free/Busy URL | calFBURL |
User ID | uid |
Phone number | telephoneNumber |
Fax number | facsimileTelephoneNumber |
Mobile | mobile |
Pager | pager |
Home Phone | homePhone |
Home Address | homePostalAddress |
Talking to LDAP
When you retrieve information from an LDAP server, you submit the DN and optionally, what attributes you want to retrieve. The output is usually presented in the following format:{CODE()}dn: cn=Stephan Borg,ou=people,o=bitweaver
givenName: Stephan
mobile: 1234 567 890
sn: Borg
uid: wolff_borg
cn: Stephan Borg
o: Bitweaver
mail: me@home.com
mail: me@home2.com
objectClass: top
objectClass: inetOrgPerson
objectClass: person
objectClass: organizationalPerson
objectClass: calEntry
calFBURL: http://bitweaver.org/fb/wolff_borg.ifb{CODE}
You can see from the output above, that there are two mail attributes.
PHP comes with all the functions to talk to and decipher LDAP queries, presenting the information in arrays. One of the goals of the LDAPContactsPackage will be to sub-class LibertyStorage class to communicate with LDAP.