[imp] Fullname and from_addr hooks

Steve Teti steti at monmouth.com
Fri Jul 1 12:11:39 UTC 2011


On 6/30/2011 9:27 AM, ssri_abo at u-paris2.fr wrote:
> Le 29/06/2011 22:28, Ralf Lang a écrit :
>> Am Mittwoch, 29. Juni 2011, 14:18:08 schrieb ssri_abo at u-paris2.fr:
>>> Hi,
>>>
>>> Does anyone have tried the fullname hook ( Horde 4 ) configured with a
>>> LDAP directory ? It doesn't seem to work. Still get the login uid as
>>> fullname.
>>>
>>> Nevertheless, the from_addr hook works fine with a LDAP directory.

I made the following change to the fullname hook (in config/hooks.php), 
and it works for me with LDAP.

Changed this:

return empty($user)
     ? $username
     : $user;

To this:

return empty($name)
     ? $username
     : $name;

It looks like this part of the sample code was simply copied from the 
from_addr hook without changing the necessary variable names.  I had to 
make some other changes to get it working in my environment as well 
(added an ldap_bind, removed the 'lang-es' stuff).  I think the code in 
hooks.php should be treated as a starting point for your application, 
not a fully-functional solution.

Steve


More information about the imp mailing list