[horde] Re: Fwd: Re: [IMP] Hook for change IMAP server
José Carlos do Nascimento
josecarlos.nascimento at varig.com
Tue Mar 8 12:46:18 PST 2005
Hi, everybody
Ive solved my proble putting this in imp/config/servers.php
-------------------------------------------------------------------
if (!@is_array($_SESSION['imp_server_info']['imap']) AND
$GLOBALS['conf']['auth']['driver'] == 'ldap') {
//[mailmessagestore] = /home...
$user = Auth::getAuth();
$ds = @ldap_connect($GLOBALS['conf']['auth']['params']['hostspec']);
$sr = @ldap_search($ds, $GLOBALS['conf']['auth']['params']['basedn'],
$GLOBALS['conf']['auth']['params']['uid'].'=' . $user);
$rs = @ldap_get_entries($ds, $sr);
@ldap_close($ds);
$_SESSION['imp_server_info']['imap']['mailhost'] =
$rs[0]['mailhost'][0];
}
----------------------------------------------------------------------
And changed this line in config for imap in this same file.
'server' => $_SESSION['imp_server_info']['imap']['mailhost'],
This solved to me,, but I think that would exist an hook to do it.
Like preauthenticate in horde.
Jose Carlos
>Zitat von Jan Schneider <jan at horde.org>:
>
>
>
>>----- Weitergeleitete Nachricht von josecarlos.nascimento at varig.com -----
>> Datum: Mon, 07 Mar 2005 09:54:59 -0300
>> Von: José Carlos do Nascimento <josecarlos.nascimento at varig.com>
>>Antwort an: José Carlos do Nascimento <josecarlos.nascimento at varig.com>
>> Betreff: Re: [horde] Re: [IMP] Hook for change IMAP server
>> An: Jan Schneider <jan at horde.org>
>>
>>Jan Schneider escreveu:
>>
>>
>>
>>>Zitat von José Carlos do Nascimento <josecarlos.nascimento at varig.com>:
>>>
>>>
>>>
>>>
>>>>I need to create an hook to take "mailhost" attibute from Ldap and
>>>>change $servers['imap'][server] in IMP.
>>>>
>>>>
>>>>
>>>Just add the nessary PHP code to servers.php.
>>>
>>>Jan.
>>>
>>>
>>>
>>>
>>Ok,
>>
>>but do not exists hook to do this ? or can I create an hook ?
>>if yes,, how is its name ?
>>
>>
>
>No, you don't need a hook, because you don't hook into the main code.
>It's configuration file after all, do with it what you want as long as
>it provides the necessary informations and parses.
>
>Jan.
>
>
>
More information about the horde
mailing list