[horde] Trailer Text per instance

Michael J Rubinsky mrubinsk at horde.org
Mon Mar 13 17:02:35 UTC 2017


Quoting David Cunningham <dcunningham at additionnetworks.net>:

>> On Mar 13, 2017, at 12:46 PM, Michael J Rubinsky <mrubinsk at horde.org> wrote:
>>
>>
>> Quoting David Cunningham <dcunningham at additionnetworks.net>:
>>
>>>> On Mar 13, 2017, at 12:23 PM, Michael J Rubinsky  
>>>> <mrubinsk at horde.org> wrote:
>>>>
>>>>
>>>> Quoting David Cunningham <dcunningham at additionnetworks.net>:
>>>>
>>>>> Hi All,
>>>>>
>>>>> I am having a hard time figuring out the syntax of a hooks-url.php
>>>>
>>>> The correct syntax is hooks-servername.php. However, I don't  
>>>> remember off-hand if hooks are handled this way since the file is  
>>>> a class definition. You may have to just use  
>>>> $conf['server']['name] or something from the $_SERVER super  
>>>> global and add some logic to the trailer hook.
>>>>
>>>
>>> Yes, the class thing is exactly the problem I am having.  I am  
>>> getting an error that I cannot define that class again.
>>
>> Yeah, thought that was the case. You can't load hooks this way.  
>> You'll have to use logic in the hook itself to sniff out the  
>> domain/host/whatever you are switching on.
>>
>
>
> Any advice on syntax?  This is far beyond my skills.

I'm not in front of my laptop, or the code, but assuming that  
$GLOBALS['conf']['server']['name'] contains the servername you want to  
switch on, something like:

if ($GLOBALS['conf']['server']['name'] == 'mail.example.com') {
    return 'Example trailer text';
}
if ($GLOBALS['conf']['server']['name'] == 'mail.some-other-example.com') {
    return 'Some other example trailer text';
}

If the servername isn't the value you need, you'll have to figure out  
where to get the value you want. The hooks contains some examples for  
getting it from the HTTP_HOST env. variable, as an example.


>
>>
>>>
>>>>
>>>>> entry to set the trailer text based on the url being used.  For  
>>>>> example, I need one url to have no trailer added, one url to  
>>>>> have one text added and another to have a different text added.
>>>>>
>>>>> Thanks for your help!
>>>>> --
>>>>> Horde mailing list
>>>>> Frequently Asked Questions: http://horde.org/faq/
>>>>> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>>>>
>>>>
>>>>
>>>> --
>>>> mike
>>>> The Horde Project
>>>> http://www.horde.org
>>>> https://www.facebook.com/hordeproject
>>>> https://www.twitter.com/hordeproject
>>>> --
>>>> Horde mailing list
>>>> Frequently Asked Questions: http://horde.org/faq/
>>>> To unsubscribe, mail: horde-unsubscribe at lists.horde.org
>>
>>
>>
>> --
>> mike
>> The Horde Project
>> http://www.horde.org
>> https://www.facebook.com/hordeproject
>> https://www.twitter.com/hordeproject



-- 
mike
The Horde Project
http://www.horde.org
https://www.facebook.com/hordeproject
https://www.twitter.com/hordeproject
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3282 bytes
Desc: S/MIME Signature
URL: <https://lists.horde.org/archives/horde/attachments/20170313/a3ee8e27/attachment-0001.bin>


More information about the horde mailing list