[imp] forcing certain settings to look in database

Jan Schneider jan at horde.org
Tue Apr 1 10:04:41 PST 2003


Quoting Vince LaMonica <vjl at uci.edu>:

> On Mon, 31 Mar 2003, Vince LaMonica wrote:
>
> } On Mon, 31 Mar 2003, Vince LaMonica wrote:
> }
> } } On Sat, 29 Mar 2003, Jan Schneider wrote:
> } } } And btw, you don't need 10 installs to host virtual domains unless
> you want
> } } } to provide different version numbers to these domains.
> } }
> } } Is there a FAQ I missed about this? I want/need to keep different
> sets of
> } } prefs for the domains [eg: lock one domain out of changing their
> From_
> } } header, but not another domain].
> }
> } I just found the admin faq:
> } http://www.horde.org/faq/admin/config/index.php#c8
>
> [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.

My config files in virtual domain environments look like this:

require_once 'virtual.php';
require 'standard-conf.php';
@include $_SERVER['SERVER_NAME'] . '-conf.php';

where standard-conf.php is a copy from conf.dist and the files like
www.example.com-conf.php contain _only_ settings that differ from the
global ones.
This way the only code overhead contains of a few lines for each domain (if
at all) and I don't have to change anything in the original code, not even
in the config files.

The same happens witch each configuration/preference/registry file that
needs to be different for different domains.

virtual.php is a very small file with general settings for certain domains
and some helper functions like:

function getVirtualRoot()
{
    return $_SERVER['SERVER_NAME'] .
           substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'],
'/horde')) .
           '/';
}


Jan.

--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft


More information about the imp mailing list