Koozali.org: home of the SME Server

How to Limite the LDAP listing in IMP WebMail Address Book

Paul T.C.Fung

How to Limite the LDAP listing in IMP WebMail Address Book
« on: December 13, 2002, 02:22:33 AM »
Dear All,

Just come into a problem and need some advice/help :

I have a 5.5 box sitting in my office, supporting 3 groups of people.  With the IMP webmail in the 5.5 box, once they use "LDAP" list to search for user name, they see all the name on the LDAP list, all 3 groups. (They have different company name setup in the LDAP data)

Is there a way that I can make them only reading their own colleague's name......(As I don't like the idea to stop the LDAP service.....It is useful as a user Auth.Tools.)  As a system admin, If I cannot do it I can only disable the IMP webmail and start looking for other webmail solution...... setting up a seperate webmail for each group sound no a good idea.

I have check out the "horde/imp/config/prefs.php" file but have no idea I can set a filter to it....

Thanks for any idea given......

Best Regards,

Alan Stevens

Re: How to Limite the LDAP listing in IMP WebMail Address Bo
« Reply #1 on: December 13, 2002, 08:22:32 AM »
I had a similar problem.  I removed access to the ldap database as a source in turba.  Here's how:

# mkdir -p /etc/e-smith/templates-custom/home/httpd/html/horde/turba/config/sources.php

# cd /etc/e-smith/templates-custom/home/httpd/html/horde/turba/config/sources.php

# touch 50LocalLDAP

# /sbin/e-smith/expand-template /home/httpd/html/horde/turba/config/sources.php

In the server manager, disable, then re-enable webmail (there's probably a way to do this from the shell, but I don't know it).

Alan--

Paul T.C.Fung

Re: How to Limite the LDAP listing in IMP WebMail Address Bo
« Reply #2 on: December 13, 2002, 10:19:09 PM »
Thanks Alan !!

With the solution, now I have the problem fixed !!

Thanks !!

Best Regards,

Paul

cityexplorer

How to Limite the LDAP listing in IMP WebMail Address Book
« Reply #3 on: October 19, 2006, 10:39:31 PM »
I tried this .. it works on SME v7 as well. but not sure what it does and how to re-enable it..

Any suggestion? Oh well... time to search  again..

Thanks.

Offline raem

  • *
  • 3,972
  • +4/-0
How to Limite the LDAP listing in IMP WebMail Address Book
« Reply #4 on: January 21, 2007, 07:31:32 AM »
cityexplorer

>...it works on SME v7 as well. but not sure what it does and how to re-enable it..

It replaces the template fragment 50LocalLDAP with an empty version of that fragment, so when the template is expended the empty fragment in .../templates-custom/... is read instead of the original fragment in .../templates/...

To undo the changes simply delete the 50LocalLDAP fragment in .../templates-custom/.... and re-expand the template & disable & enable webmail as per above method.

Here is the original code, so work out what it used to do.


if (Util::extensionExists('ldap')) \{

$cfgSources['localldap'] = array(
    'title' => 'Local LDAP',
    'type' => 'ldap',
    'params' => array(
        'server' => 'localhost',
        'port' => 389,
        'tls' => false,
        'root' => '',
        'sizelimit' => 200,
        'dn' => array('cn'),
        'objectclass' => array('top',
                               'person',
                               'organizationalPerson','inetOrgPerson'),
        'scope' => 'one',
        'charset' => 'iso-8859-1',
        // 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' => 'mobiletelephonenumber',
{
        my $hordefreebusy = $horde{'freebusy'} || 'disabled'; return "        \'
homeAddress\' => \'homepostaladdress\'\n        #freebusy is currently not enabl
ed.  To enable - config setprop horde freebusy enabled" unless ($hordefreebusy e
q "enabled");
        $OUT .= '        \'homeAddress\' => \'homepostaladdress\','
                . "\n"
                . '        \'freebusyUrl\' => \'calFBURL\'';
}
    ),
    'search' => array(
        'name',
        'email',
        'homePhone',
        'workPhone',
        'cellPhone',
        'homeAddress'
    ),
    'strict' => array(
        'dn',
    ),
    'export' => true,
    'browse' => true,
);
\}
...