[turba] Restrict access to an addressbook by LDAP group

Murray Trainer mtrainer at central-data.net
Wed Apr 27 23:35:25 PDT 2005


Hi,

I have the latest versions of Horde/IMP/Turba working fine with LDAP
addressbooks.  We have one addressbook we would like to restrict to
members of an LDAP group.  Is there any way of doing this currently?  My
Turba sources.php code for the addressbook is included below.

Thanks

Murray


/* Get userid for authentication to LDAP directories */

$uid = Auth::getAuth();
if (preg_match('/(^.*)@/', $uid, $matches)) {
    $uid = $matches[1];
}

/* Group Addressbook Users */
$basedn = 'dc=somewhere,dc=net';
$cfgSources['group-addressbook'] = array(
    'title' => _("Group Addressbook"),
    'type' => 'ldap',
    'params' => array(
        'server' => 'ldap.somewhere.net',
        'port' => 389,
        'tls' => false,
        'root' => 'ou=users,' . $basedn,
        'bind_dn' => 'uid=' . $uid . ',ou=users' .
',dc=somewhere,dc=net',
        'bind_password' => Auth::getCredential('password'),
        'sizelimit' => 200,
        'dn' => array('dn'),
        'objectclass' => array('top', 'person',
'organizationalPerson','inetOrgPerson'),
        'charset' => 'utf-8',
        // check if all required attributes for an entry are set and add
them
        // if needed.
        'checkrequired' => false,
        // string to put in missing required attributes.
        'checkrequired_string' => ' ',
        'version' => 3
    ),
    'map' => array(
        '__key' => 'dn',
        '__uid' => 'uid',
        'name' => 'cn',
        'email' => 'mail',
        'homePhone' => 'homephone',
        'workPhone' => 'telephonenumber',
        'cellPhone' => 'mobile',
        'homeAddress' => 'homepostaladdress'
        // 'freebusyUrl' => 'calFBURL'
    ),
    'search' => array(
        'name',
        'email',
        'homePhone',
        'workPhone',
        'cellPhone',
        'homeAddress'
    ),
    'strict' => array(
        'dn',
    ),
    'public' => true,
    'readonly' => true,
    'admin' => array(),
    'export' => true
);




More information about the turba mailing list