[imp] forcing certain settings to look in database

eculp at encontacto.net eculp at encontacto.net
Mon Mar 31 14:51:49 PST 2003


Quoting Vince LaMonica <vjl at uci.edu>:


| [egad; replying to myself twice in one day..baaaad karma]
|
| The FAQ above doesn't explain how to use multiple settings with virtual
| domains [other than changing return addresses]. I want to be able to lock
| down certain features with certain domains [including not enabling the
| calendar and/or passwd changing for certain domains]. The only way I've
| been able to do that so far is multiple installations.
|

Vince, I think that may be an overkill ;-).  There are a couple of bad
solutions that I've used.  I think it depends on how many settings and
for how many domains and how often they will change.  I really don't
change that many.  I have created a configuration file that I include
with variables assigned.  It is far from an optimal solution and could
be more maintenance intensive than it should, but it works.

Sniplets from my files:

/* This is an additional file in horde/config/ to set the variables */

$vdomain = strtolower(eregi_replace('^mail\.|^www\.|^www\.mail\.', '', \
$_SERVER['HTTP_HOST']));

switch ( $vdomain ) {
        case "insourcery.net" :
                $default_theme='royal';
                $default_lock=true;
                break;

Then in prefs.php for theme I have:

// color theme
$_prefs['theme'] = array(
    'value' => $default_theme,
    'locked' => $default_lock,
    'shared' => true,

I actually have about 15 definitions per domain.  I'm not sure that I would
want any more.  I'm sure there is a much better way of doing this.  I guess
that since this works, I've been too lazy to find a better mousetrap.



-------------------------------------------------



More information about the imp mailing list