//50LocalLDAP
/**
 * A local address book in an LDAP directory. This implements a public
 * (shared) address book.
 *
 * To store distribution lists in the LDAP directory, you'll need to include
 * horde.schema from Horde in your LDAP configuration.
 *
 * To store freebusy information in the LDAP directory, you'll need to include
 * rfc2739.schema from Horde in your LDAP configuration.
 */
$cfgSources['localldap'] = array(
    // Disabled by default
    'disabled' => false,
    'title' => _("Local LDAP Users Address Book"),
    'type' => 'ldap',
    'params' => array(
        'server' => 'localhost',
        'port' => 389,
        'tls' => false,
{
   $OUT .= qq(         'root' => '$basedn',);
}
//         'bind_dn' => 'cn=admin,ou=users,dc=example,dc=com',
//         // For Active Directory:   
//         // 'bind_dn' => 'username@example.com',
//         'bind_password' => '********',
         'sizelimit' => 200,
//         // For Active Directory:  
//         // 'sizelimit' => 0,
         'dn' => array('cn'),
         'objectclass' => array('top',
                                'person',
                                'organizationalPerson',
{
    if (($horde{freebusy} || "disabled") eq "enabled") {
          $OUT =<<HERE;
                                'inetOrgPerson',
                                'calEntry'),
HERE
} else {
          $OUT =<<HERE;      
                                'inetOrgPerson'),
HERE
}
}
                                // Add 'turbaContact' to this array if using
                                // 'turbaType' attribute below, and 'calEntry'
                                // if using 'freebusyUrl'.
           // For Active Directory:
           // 'objectclass' => array('organizationalPerson',
           //                        'user',
           //                        'group',
           //                        'contact'),
         'scope' => 'sub',
           // For Active Directory:
           // 'scope' => 'sub',
         'charset' => 'UTF-8',
           // Consult the LDAP schema to verify that all required attributes for
           // an entry are set and add them if needed.
         'checkrequired' => false,
           // Value used to fill in missing required attributes.
         'checkrequired_string' => ' ',
           // Check LDAP schema for valid syntax. If this is false an address
           // field is assumed to have postalAddress syntax; otherwise the schema
           // is consulted for the syntax to use.
           'checksyntax' => false,
         'version' => 3,
         'filter' => '&(objectClass=inetOrgPerson)(!(mail=admin@{$DomainName}))',

         // For Active Directory you probably want to also set the following
         // parameters:
         // 'deref' => LDAP_DEREF_ALWAYS,
         // 'filter' => '&(SAMAccountName=*)(mail=*)',
         // 'referrals' => 0,
     ),
     'map' => array(
         '__key' => 'dn',

         // Remove this mapping if using Active Directory server:
           '__uid' => 'uid',

         // From horde.schema.  Make sure you have 'turbaContact' objectClass
         // included above:
           '__type' => 'turbaType',
           '__members' => 'turbaMembers',

         'name' => 'cn',
         'email' => 'mail',
         'homePhone' => 'homephone',
         'workPhone' => 'telephonenumber',
         'cellPhone' => 'mobiletelephonenumber',
//         'homeAddress' => 'street',    <-- this is what was used for sme7 before horde 4
         'homeAddress' => 'homepostaladdress',

         // From rfc2739.schema:
{
    if (($horde{freebusy} || "disabled") eq "enabled") {
         $OUT =<<HERE;
         'freebusyUrl\' => 'calFBURL',       
HERE
} else {
         $OUT =<<HERE;  
         #freebusy is currently not enabled.  To enable - config setprop horde freebusy enabled
HERE
}
}
         // For Active Directory servers:
         // 'name' => 'displayname',
         // 'title' => 'title',
         // 'cellPhone' => 'mobile',
         // 'department' => 'department',
         // 'company' => 'company',
     ),
     'search' => array(
         'name',
         'email',
         'homePhone',
         'workPhone',
         'cellPhone',
         'homeAddress'
     ),
     'strict' => array(
         'dn',
     ),
     'approximate' => array(
         'cn',
     ),
//     // For Active Directory servers:
//     // 'approximate' => array(
//     //     'displayname',
//     //     'samaccountname',
//     // ),
     'export' => true,
     'browse' => true,
);

