[horde] Check on Horde prefs.d/prefs-servername.php Implementation & capability
Andy Dorman
adorman at ironicdesign.com
Thu May 23 14:28:43 UTC 2013
On 05/23/2013 06:36 AM, Jan Schneider wrote:
>
> Zitat von Andy Dorman <adorman at ironicdesign.com>:
>
>> This query is about Horde 5.04 (the latest debian package release)
>>
>> We are trying to set different default theme for different domains
>> BEFORE someone logs in.
>>
>> Our horde - conf.php has vhosts enabled.
>> $conf['vhosts'] = true;
>>
>> We have set up additional themes as described in
>> http://wiki.horde.org/Doc/Dev/ThemesH5. For this example the theme
>> directories are named "bulldogs-ABC/", "bulldogs-XYZ/", and
>> "bulldogs-default/"
>>
>> We finally added prefs-servername.php entries for the base servername
>> and a couple of specific server hostnames that look like these:
>>
>> prefs-abc.bulldogs.com.php
>> ----------------------------
>> <?php
>>
>> // default theme for abc.bulldogs.com
>> $_prefs['theme']['value'] = 'bulldogs-ABC';
>>
>> prefs-xyz.bulldogs.com.php
>> ----------------------------
>> <?php
>>
>> // default theme for xyz.bulldogs.com
>> $_prefs['theme']['value'] = 'bulldogs-XYZ';
>>
>> prefs-bulldogs.com.php
>> ----------------------------
>> <?php
>>
>> // default theme for bulldogs.com
>> $_prefs['theme']['value'] = 'bulldogs-default';
>>
>>
>> In testing we have found the results to be hit-or-miss. We do not see
>> the Horde default theme when calling these different servernames, but
>> rarely do we see the correct servername theme either. I suspect
>> caching is the cause of our inconsistent results, we are still
>> checking that.
>>
>> I just wanted to confirm a couple of things and make sure we are doing
>> this correctly...
>>
>> 1. Default servername themes WILL work BEFORE login.
>
> They should.
>
>> 2. You can specify hostnames to as many levels as necessary in the
>> prefs.d filenames, ie, both prefs-beta.abc.bulldogs.com.php, or simply
>> prefs-bulldogs.com.php will work.
>
> Yes, as long as it matches exactly the host name that the browser is
> sending. The vhost-specific files shouldn't go into the prefs.d/
> directory though, but right into config/.
>
>> Out of curiosity, does anyone know what will happen if we have defined
>> a theme in prefs-bulldogs.com and someone requests www.bulldogs.com ?
>> Will we get a basic match on the tld and get the bulldogs.com theme?
>> Of course we can set up Apache/Nginx to redirect www requests, just
>> wondering if we need to.
>
> No, they would just get the default theme.
Thank you Jan. Your reply was very helpful.
I had to turn off PHP apc to test it, but config/prefs-servername.php
works very nicely BEFORE login with apc disabled. I expect we can
enable apc when we go to production.
Regards,
--
Andy Dorman
FanMail.com
Ironic Design, Inc.
AnteSpam.com, HomeFreeMail.com, ComeHome.net
CONFIDENTIALITY NOTICE: This message is for the named person's use only.
It may contain confidential, proprietary or legally privileged
information. No confidentiality or privilege is waived or lost by any
erroneous transmission. If you receive this message in error, please
immediately destroy it and notify the sender. You must not, directly or
indirectly, use, disclose, distribute, or copy any part of this message
if you are not the intended recipient.
More information about the horde
mailing list