Improving MSU’s people search

21 January, 2011 § 1 Comment

In the summer of 2006, I had an idea. I would often use the Michigan State University website to look up email addresses and phone numbers of others at the university. The search mechanism on the website required the last name of individuals, with the first name optional.

But sometimes I didn’t know the last name of the person I was looking for. Like any good computer science student, I decided to write my own “MSU People Search”.

Like many large institutions, Michigan State University uses what is called an LDAP directory. LDAP directories can be used as a sort-of white pages for an institution. They can store information about people and tangible items like computers.

Most likely you have used one of these LDAP directories when setting up a local email client. When using Microsoft Outlook at work, I can type in the real name of a recipient in the “To:” address field. As I’m typing the email, Outlook will perform an LDAP search for a user with the provided name and update the “To:” address field to the user’s email address.

It’s not too hard to make your own LDAP search website. The most common parameters you are going to need are the LDAP server’s hostname, the “Base Distinguished Name” (otherwise known as a Base DN), and some attribute fields to request.

With the php-ldap library, you can write your own LDAP search website in PHP. Simply

  1. Call ldap_connect to open a connection
  2. ldap_search to perform your search
    • Optionally call ldap_sort to sort your entries
  3. ldap_get_entries to turn your results into an associative array
  4. Then iterate through your associate array and you’re done.

Feel free to take a look at my implementation and provide any feedback you have.

Tagged: , ,

§ One Response to Improving MSU’s people search

  • A.J. says:

    It works — I was able to locate Jared Adam Wein🙂 But really I think this very useful! I am able to find people who go to MSU quickly! I should get acquainted with LDAP because I don’t have much knowledge of it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Improving MSU’s people search at JAWS.

meta