Skip to end of metadata
Go to start of metadata

Background pre-2008

The existing person finder has grown on-demand over the last few years. Its look and feel were updated some time ago, although the underlying code remains lacking in structure and very difficult to maintain. With the new LDAP schema implementation considerable modifications are required to make it work post-rollout and this is a sensible time to improve the code base to make it easier to maintain and develop as this will allow added functionality to be developed for use in CMS pages.

Technical Stuff

New person finder (of 2008) has been developed in PHP using a basic MVC pattern. There is a Trac instance - the code is in the trunk.

Search page functionality:

  • Search does not strip diacritics from search terms, but matches against both diacritic sensitive and insensitive fields for names. Hence a diacritic or non-diacritic search should return your match, but term with incorrect diacritics will not
  • First Name field will match both actual name and known as
  • All fields can take the wildcard (*) search option
  • Multiple * characters together are replaced with a single *
  • LDAP special characters and other regex characters are stripped out (list of characters - specialcharlist variable)
  • Some fields have wildcards built (see table below)

Default performance of text searches, searching ou=people where objectclass=bathperson and !(exdirectory=TRUE)


LDAP Search Performed

Last Name

( sn = $input * )

First Name

( cn = $input * )


( uid = $input )

Job / Course

( titleall = * $input * )


( roomnumberall = $input * )


( telephonenumberall = $input )

Note the anomaly in expected behaviour - first name searches the full name field in LDAP

External specific behavior:

  • Search returns a negative statement if no text (cannot get full department listings)
  • At least one of the search terms must contain a minimum of 2 characters (prevents a* searches)
  • If nothing in the Surname field, sets filter to Staff (can only list staff by title alone)

Search page options:

Result page options:

Additional options:

Additional bits of information can be gathered from personfinder/dataquery/ (called from inside the firewall only)


all details means the same fields as appear on the detailed person pages of personfinder - take care not to put internal information visible to the outside world

All groups of people are in alphabetical order by surname, first name then username. Default format is json. Adding the parameter type to the url changes this:

  • xml
  • json (same as default)
  • yaml (not yet implemented)
  • debug (print_r of the object being converted to format)


Apache bindings for live personfinder:

from /opt/www/apache2/conf/aliases.conf on sole

Also in /opt/www/apache2/conf/httpd-accesslocal.conf

The live search code wasn't working for users off campus, and would also have needed tweaking to return non-internal only data (for information security purposes). This restriction stops the live search from even working, but the default Person Finder functionality of submitting the form to Person Finder itself still works.

Apache bindings for dev personfinder:

dev personfinder can be found in /www/vhosts/bath-dev/personfinder/

Additionally, the livesearch javascript on the basic search page should be portable.


  • No labels