diff options
author | Badlop <badlop@process-one.net> | 2008-03-04 10:36:57 +0000 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2008-03-04 10:36:57 +0000 |
commit | 735b34e7b7793342fcde3242196871876c4e1009 (patch) | |
tree | f43a49e4edf99448b27289ae5d378784d8f93c9b /src | |
parent | * doc/guide.tex: mod_announce recommends, but doesn't require (diff) |
* doc/guide.tex: Improve documentation of host_config
add (EJAB-544)
* doc/guide.html: Likewise
* src/ejabberd.cfg.example: Likewise
* src/ejabberd_config.erl: Likewise
SVN Revision: 1219
Diffstat (limited to 'src')
-rw-r--r-- | src/ejabberd.cfg.example | 37 | ||||
-rw-r--r-- | src/ejabberd_config.erl | 9 |
2 files changed, 44 insertions, 2 deletions
diff --git a/src/ejabberd.cfg.example b/src/ejabberd.cfg.example index fd04c163b..575ba386b 100644 --- a/src/ejabberd.cfg.example +++ b/src/ejabberd.cfg.example @@ -341,6 +341,15 @@ %%{acl, test, {user_regexp, "^test"}}. %%{acl, test, {user_glob, "test*"}}. +%% +%% Define specific ACLs in a virtual host. +%% +%%{host_config, "localhost", +%% [ +%% {acl, admin, {user, "bob-local", "localhost"}} +%% ] +%%}. + %%% ============ %%% ACCESS RULES @@ -381,6 +390,16 @@ %% Everybody can create pubsub nodes {access, pubsub_createnode, [{allow, all}]}. +%% +%% Define specific Access rules in a virtual host. +%% +%%{host_config, "localhost", +%% [ +%% {access, c2s, [{allow, admin}, {deny, all}]}, +%% {access, register, [{deny, all}]} +%% ] +%%}. + %%% ================ %%% DEFAULT LANGUAGE @@ -390,6 +409,13 @@ %% {language, "en"}. +%% +%% Set a different language in a virtual host. +%% +%%{host_config, "localhost", +%% [{language, "ru"}] +%%}. + %%% ======= %%% MODULES @@ -448,6 +474,17 @@ {mod_version, []} ]}. +%% +%% Enable modules with custom options in a specific virtual host +%% +%%{host_config, "localhost", +%% [{{add, modules}, +%% [ +%% {mod_echo, [{host, "mirror.localhost"}]} +%% ] +%% } +%% ]}. + %%% $Id$ diff --git a/src/ejabberd_config.erl b/src/ejabberd_config.erl index e78ca3fea..0222cc367 100644 --- a/src/ejabberd_config.erl +++ b/src/ejabberd_config.erl @@ -211,11 +211,16 @@ add_option(Opt, Val, State) -> end end. -compact(Opt, Val, [], Os) -> +compact({OptName, Host} = Opt, Val, [], Os) -> + ?WARNING_MSG("The option '~p' is defined for the host ~p using host_config " + "before the global '~p' option. This host_config option may get overwritten.", [OptName, Host, OptName]), [#local_config{key = Opt, value = Val}] ++ Os; +%% Traverse the list of the options already parsed compact(Opt, Val, [O | Os1], Os2) -> - case O#local_config.key of + case catch O#local_config.key of + %% If the key of a local_config matches the Opt that wants to be added Opt -> + %% Then prepend the new value to the list of old values Os2 ++ [#local_config{key = Opt, value = Val++O#local_config.value} ] ++ Os1; |