[horde] Hooks - from_addr & fullname
Lee Evans
horde at leeevans.org
Tue Mar 14 01:13:32 PST 2006
Hi,
I'm still struggling with the LDAP hook functions below.
I tried following the suggestion and removed the @ symbol but this didn't
seem to produce any more helpful output anywhere
Can anyone offer any further suggestions?
Thanks
Lee
--
Lee Evans
> -----Original Message-----
> From: horde-bounces at lists.horde.org
> [mailto:horde-bounces at lists.horde.org] On Behalf Of Jan Schneider
> Sent: 02 March 2006 13:37
> To: horde at lists.horde.org
> Subject: Re: [horde] Hooks - from_addr & fullname
>
> <snip>
> >
> > 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 at 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.
>
> Start with removing the "@" operator to see error messages returned
> from the ldap functions.
>
> Jan.
More information about the horde
mailing list