Search LDAP database plugin for SquirrelMail
----------------------------------------------
Version info
------------
Brent Bice, bbice@persistence.com
Ver 1.0, Jun 6 2001 
Ver 1.2, Oct 14 2001
Ver 1.5, Mar 7 2002
Ver 1.6, Apr 10 2002

Tomas Kuliavas <tokul@users.sourceforge.net>
Ver 1.7, 2004-10-24
Ver 1.7.1, 2004-11-01
Ver 2.0rc1, 2005-03-01
Ver 2.0rc2, 2005-03-11
Ver 2.0, 2005-03-20
Ver 2.1rc1, 2006-03-26
Ver 2.1, 2006-04-10

About plugin
------------
Plugin allows users to search the Directory Servers (if any are installed)
by name and see more of the record than just email address. It allows to
lookup phone numbers, addresses, and other data that can be stored in LDAP.

Default plugin configuration is stored in plugins/ldapquery/config_default.php.
Don't modify that file, if you want to preserve your data during updates.
Create config/ldapquery_config.php or plugins/ldapquery/config.php file and
put your site configuration there. If both files exist, plugin will use 
only config/ldapquery_config.php.

Set of used LDAP servers is defined in SquirrelMail configuration. See 
conf.pl -> 6. Address books -> 1. Change LDAP servers options. Plugin should 
work with SquirrelMail 1.4.0 or later version, but some of the features are
available only in SquirrelMail 1.4.3 or later.

There are a few things you need to define in config file. The first is a
variable telling ldapquery if your LDAP server requires authentication or
not.  If so, just set $ldq_authreqd to true and the search form will have
a User DN and Password field as well as the normal fields. Plugin can also
use internal authentication information stored in configuration of 
SquirrelMail 1.4.3 and later versions.

There are also 3 arrays you can define in config file. The $ldq_attributes
array contains the list of attribute names you want the plugin to search
for (things you will permit the user to selectively view in their output).

The $ldq_searchobjs array contains the list of objectclasses that you want 
the user to be able to search for. For instance, the default array contains:

$ldq_searchobjs = array ('person', '*');

Which means the user will be presented with a pull-down list of "Person" and
"Any". If they select "Person", the searches will be limited to only
records with an objectclass of "person".  If "Any", the search is unlimited
since it'll find any record with any objectclass.

The $ldq_searchattrs array is similar but contains a list of attributes to 
let the user search by. This is so you can let user select "Common Name" 
from a pulldown and the plugin will know the filter will be
cn=<something> or they can select "E-mail" and the plugin will know the search
filter will be mail=<something>. Why make this separate from ldq_attributes?
Well, if your LDAP database is really big, and you don't have indexes generated
for every attribute you might not want the user to be able to search by
some attributes. If it is set to empty array, interface uses attributes from
$ldq_attributes.

Configuration also uses $ldq_allow_asterisk_search and $ldq_debug options. 
If $ldq_allow_asterisk_search is set to true, user can use single asterisk (*)
in order to retrieve all records from ldap server. If it is set to false, 
asterisk won't be treated as special search and search results will display
entries that have asterisk symbol in selected attribute entry. If $ldq_debug 
is set to true, plugin displays some debug information about used ldap queries.

LDAP schemas supported by plugin are stored in schema directory. If you want 
to add custom ldap schema, use reserved schema/custom.php name or remember 
to include your schema in functions.php ldq_load_schemas() function.

Plugin translations use ldapquery domain. ldapquery.po and ldapquery.mo files
should be stored in same directory that stores squirrelmail.po and 
squirrelmail.mo files. Translations are maintained by SquirrelMail 
Internationalization Team and are distributed in SquirrelMail locale packages.

