[prev in list] [next in list] [prev in thread] [next in thread] 

List:       imp
Subject:    [horde] Hooks - from_addr & fullname
From:       "Lee Evans" <horde () leeevans ! org>
Date:       2006-02-28 12:10:03
Message-ID: 003301c63c5f$e81e0900$1407a8c0 () nunwood ! com
[Download RAW message or body]

Hi,

I'm hoping somebody will be able to help me. I've setup horde, imp & turba
to provide a webmail interface to our corporate exchange server.

I've succesfully setup turba to provide the Exchange GAL using LDAP queries
back to our domain controllers.

I have a couple of final changes I need to make to ensure that the users get
a smooth experience - automatically configured from addresses, full names
and signatures. Once I've got one of these working I'm pretty confident I
can work out the others, but at the moment I'm struggling.

I have the following in hooks.php and have configured prefs.php to use the
hook.

function _prefs_hook_fullname($user = null)
     {
         $ldapServer = '192.168.x.x';
         $ldapPort = '389';
         $binddn = 'ldapuser@company.com';
         $bindpw = 'password';
         $searchBase = 'ou=Company Users,cn=company,cn=com';

         $ds = @ldap_connect($ldapServer, $ldapPort);

         if (is_null($user)) {
             $user = Auth::getAuth();
         }
        if (@ldap_bind($ds, $binddn, $bindpw)) {
         $searchResult = @ldap_list($ds, $searchBase, 'mail=' . $user);
        }

        $information = @ldap_get_entries($ds, $searchResult);
        $name = $information[0]['cn'][0];

         ldap_close($ds);

        return $name;
     }


Which isn't working. If I substitue the last $name for an arbitrary string
this is correctly assigned to the fullname so the hook itself is being run -
so I guess it must be the LDAP parts that aren't working. I've tried
different combinations of attributes etc to search for, but without any
luck.

When I setup turba I was able to use the horde.log file to help me to
diagnose any particular LDAP problems but these hooks don't seem to generate
any log entries which isn't really helping.

Can anyone give me any pointers, anything I can do to debug what's happening
or any obvious mistakes in the above. If you could explain what I can expect
Auth:getAuth() to return or how it knows that to do with @ldap_bind that
would be a good start.

Thanks
Lee
-- 
Lee Evans

-- 
Horde mailing list - Join the hunt: http://horde.org/bounties/#horde
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: horde-unsubscribe@lists.horde.org
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic