[imp] Fwd: Re: imp_expand_fromaddress with imp 4

Jan Schneider jan at horde.org
Thu Dec 15 05:38:43 PST 2005



----- Weitergeleitete Nachricht von thevenin at utt.fr -----
      Datum: Thu, 15 Dec 2005 14:19:04 +0100 (CET)
        Von: THEVENIN Valerie <thevenin at utt.fr>
Antwort an: THEVENIN Valerie <thevenin at utt.fr>
    Betreff: Re: [imp] imp_expand_fromaddress with imp 4
         An: Jan Schneider <jan at horde.org>

Hello

I changed config/prefs.php like
$_prefs['from_addr'] = array(
      'value' => '',
      'locked' => true,
      'hook' => true,
      'shared' => true,
      'type' => 'text',
      'desc' =>  _("Your From: address:")

and config/hooks.php like

   if (!function_exists('_prefs_hook_from_addr')) {
       function _prefs_hook_from_addr($user = null)
       {
           $ldapServer = 'XXX';
           $ldapPort = '389';
           $searchBase = 'dc=xx,dc=xx';
           $ds = @ldap_connect($ldapServer, $ldapPort);

//$user = thevenin;
               $user = Auth::getAuth();
           $searchResult = @ldap_search($ds, $searchBase, 'uid=' . $user);
           $information = @ldap_get_entries($ds, $searchResult);
               $name = $information[0]['mail'][0];
           ldap_close($ds);

//         return ($name);
//         return (empty($name) ? 'test' : $name);
           return (empty($name) ? $user : $name);
       }
   }

It-is not working. It's not a pb of connexion with ldap server.
When I uncomment the line user=thevenin, it's not working as well (it's
not a problem with AUTH::). When I uncomment  return (empty($name) ?
'test' : $name), I receive as from adress test at utt.fr (so the function is
run)

And I've got some message like Error messages:
Notice: Undefined offset: 0 in hooks.php

I saw some message like this in the archive of the list, but without
answer. Perhaps have you got it ?


Thanks a lot
On Thu, 15 Dec 2005, Jan Schneider wrote:

> Zitat von THEVENIN Valerie <thevenin at utt.fr>:
>
>> With imp 3.2.7  we were using the function imp_expand_fromaddress in
>> the conf.php ( $conf['hooks']['from'] = 'imp_expand_fromaddress';) in
>> order to send message with the mail adress stored in our ldap server
>> (and not by default as login at domain).
>>
>> We've migrated to imp 4 and we are not able to produce the same behaviour.
>>
>> Does anyone know how to do it (without asking users to modify their
>> identity in their option)
>
> With a preference hook for the from_addr preference. See
> config/prefs.php and config/hooks.php.
>
> Jan.
>
>

-- 
Cordialement,
_________________________________________________

Valerie Thevenin
Responsable du Centre de Ressources Informatiques
Université de Technologie de Troyes
_________________________________________________

UTT - C.R.I
12 rue Marie Curie
10010 Troyes Cedex
Tel : +33 325 717 608
Fax : +33 325 718 084
E-Mail : Valerie.Thevenin at utt.fr

----- Ende der weitergeleiteten Nachricht -----


Jan.

-- 
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/


More information about the imp mailing list