[horde] Virtualhost context for hooks

Jan Schneider jan at horde.org
Fri Jan 12 11:28:13 UTC 2018


Zitat von Nels Lindquist <nlindq at maei.ca>:

> Hi, Jan.
>
> On 2018/01/09 2:09 PM, Jan Schneider wrote:
>>
>> Zitat von Nels Lindquist <nlindq at maei.ca>:
>>
>>> Hi there.
>>>
>>> I'm using a preauthenticate hook to normalize login IDs against
>>> an LDAP server.  In each virtualhost configuration file I've
>>> defined different LDAP search bases, but my hook functions appear
>>> to be using the root Horde search base rather than the
>>> virtualhost's overridden configuration.
>>>
>>> I'm referincing "global $conf" within my hook functions in order
>>> to access $conf['auth']['params']['basedn']; should I be
>>> incorporating something else to get the virtualhost overrides?
>>
>> No. But you didnt explain how exactly your setup looks like. And
>> how about vhost-specific settings used anywhere else than
>> hooks.php.
>
> I have Horde Groupware Webmail Edition 5.2.22 installed.  IMP is
> configured to connect to Cyrus IMAPD on the local host.
> Authentication is through LDAP, using OpenLDAP as the backend.
>
> I'm using vhost-specific settings to define a different database,
> administrator ID, cache prfix and authentication base DN for each
> domain, as well as default mail domain (for imp) and different LDAP
> base DNs for each vhost's turba shared directory.
>
> Note that I'm using a common hooks.php file for all virtual domains
> since it's the same function performing the normalization regardless.
>  Should there be vhost-specific hooks-*.php files as well?

No, you should indeed have a single hooks.php file only, and make any  
necessary vhost distinctions inside your hook code.

-- 
Jan Schneider
The Horde Project
https://www.horde.org/



More information about the horde mailing list