25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

* src/gen_mod.erl: Substitute @HOST@ with hostname in the 'host'

option (thanks to Badlop)
* src/mod_vcard.erl: Likewise
* src/mod_vcard_ldap.erl: Likewise
* src/mod_vcard_odbc.erl: Likewise
* src/mod_muc/mod_muc.erl: Likewise
* src/mod_irc/mod_irc.erl: Likewise
* src/mod_echo.erl: Likewise
* src/mod_pubsub/mod_pubsub.erl: Likewise
* src/mod_proxy65/mod_proxy65_service.erl: Likewise

SVN Revision: 888
This commit is contained in:
Alexey Shchepin 2007-08-25 17:24:00 +00:00
parent 24ff98d50d
commit 5dfa6edda3
10 changed files with 27 additions and 22 deletions

View File

@ -1,3 +1,16 @@
2007-08-25 Alexey Shchepin <alexey@process-one.net>
* src/gen_mod.erl: Substitute @HOST@ with hostname in the 'host'
option (thanks to Badlop)
* src/mod_vcard.erl: Likewise
* src/mod_vcard_ldap.erl: Likewise
* src/mod_vcard_odbc.erl: Likewise
* src/mod_muc/mod_muc.erl: Likewise
* src/mod_irc/mod_irc.erl: Likewise
* src/mod_echo.erl: Likewise
* src/mod_pubsub/mod_pubsub.erl: Likewise
* src/mod_proxy65/mod_proxy65_service.erl: Likewise
2007-08-24 Alexey Shchepin <alexey@process-one.net>
* src/web/ejabberd_web_admin.erl: Moved roster stuff to mod_roster*

View File

@ -3,18 +3,17 @@
%%% Author : Alexey Shchepin <alexey@sevcom.net>
%%% Purpose :
%%% Created : 24 Jan 2003 by Alexey Shchepin <alexey@sevcom.net>
%%% Id : $Id$
%%%----------------------------------------------------------------------
-module(gen_mod).
-author('alexey@sevcom.net').
-vsn('$Revision$ ').
-export([start/0,
start_module/3,
stop_module/2,
get_opt/2,
get_opt/3,
get_opt_host/3,
get_module_opt/4,
loaded_modules/1,
loaded_modules_with_opts/1,
@ -133,6 +132,10 @@ get_module_opt(Host, Module, Opt, Default) ->
get_opt(Opt, Opts, Default)
end.
get_opt_host(Host, Opts, Default) ->
Val = get_opt(host, Opts, Default),
element(2, regexp:gsub(Val, "@HOST@", Host)).
loaded_modules(Host) ->
ets:select(ejabberd_modules,
[{#ejabberd_module{_ = '_', module_host = {'$1', Host}},

View File

@ -3,12 +3,10 @@
%%% Author : Alexey Shchepin <alexey@sevcom.net>
%%% Purpose :
%%% Created : 15 Jan 2003 by Alexey Shchepin <alexey@sevcom.net>
%%% Id : $Id$
%%%----------------------------------------------------------------------
-module(mod_echo).
-author('alexey@sevcom.net').
-vsn('$Revision$ ').
-behaviour(gen_server).
-behaviour(gen_mod).
@ -68,7 +66,7 @@ stop(Host) ->
%% Description: Initiates the server
%%--------------------------------------------------------------------
init([Host, Opts]) ->
MyHost = gen_mod:get_opt(host, Opts, "echo." ++ Host),
MyHost = gen_mod:get_opt_host(Host, Opts, "echo.@HOST@"),
ejabberd_router:register_route(MyHost),
{ok, #state{host = MyHost}}.

View File

@ -78,7 +78,7 @@ init([Host, Opts]) ->
mnesia:create_table(irc_custom,
[{disc_copies, [node()]},
{attributes, record_info(fields, irc_custom)}]),
MyHost = gen_mod:get_opt(host, Opts, "irc." ++ Host),
MyHost = gen_mod:get_opt_host(Host, Opts, "irc.@HOST@"),
update_table(MyHost),
Access = gen_mod:get_opt(access, Opts, all),
DefaultEncoding = gen_mod:get_opt(default_encoding, Opts, "koi8-r"),

View File

@ -144,7 +144,7 @@ init([Host, Opts]) ->
[{ram_copies, [node()]},
{attributes, record_info(fields, muc_online_room)}]),
mnesia:add_table_copy(muc_online_room, node(), ram_copies),
MyHost = gen_mod:get_opt(host, Opts, "conference." ++ Host),
MyHost = gen_mod:get_opt_host(Host, Opts, "conference.@HOST@"),
update_tables(MyHost),
clean_table_from_bad_node(node(), MyHost),
mnesia:add_table_index(muc_registered, nick),

View File

@ -3,7 +3,6 @@
%%% Author : Evgeniy Khramtsov <xram@jabber.ru>
%%% Purpose : SOCKS5 Bytestreams XMPP service.
%%% Created : 12 Oct 2006 by Evgeniy Khramtsov <xram@jabber.ru>
%%% Id : $Id$
%%%----------------------------------------------------------------------
-module(mod_proxy65_service).
@ -175,7 +174,7 @@ iq_vcard(Lang) ->
"Copyright (c) 2003-2006 Alexey Shchepin")}]}].
parse_options(ServerHost, Opts) ->
MyHost = gen_mod:get_opt(host, Opts, "proxy." ++ ServerHost),
MyHost = gen_mod:get_opt_host(ServerHost, Opts, "proxy.@HOST@"),
Port = gen_mod:get_opt(port, Opts, 7777),
ACL = gen_mod:get_opt(access, Opts, all),
Name = gen_mod:get_opt(name, Opts, "SOCKS5 Bytestreams"),
@ -201,4 +200,4 @@ get_proxy_or_domainip(ServerHost, MyHost) ->
{ok, Addr} -> Addr;
{error, _} -> {127,0,0,1}
end
end.
end.

View File

@ -3,12 +3,10 @@
%%% Author : Alexey Shchepin <alexey@sevcom.net>
%%% Purpose : Pub/sub support (JEP-0060)
%%% Created : 4 Jul 2003 by Alexey Shchepin <alexey@sevcom.net>
%%% Id : $Id$
%%%----------------------------------------------------------------------
-module(mod_pubsub).
-author('alexey@sevcom.net').
-vsn('$Revision$ ').
-behaviour(gen_server).
-behaviour(gen_mod).
@ -122,7 +120,7 @@ init([ServerHost, Opts]) ->
mnesia:create_table(pubsub_presence,
[{ram_copies, [node()]},
{attributes, record_info(fields, pubsub_presence)}]),
Host = gen_mod:get_opt(host, Opts, "pubsub." ++ ServerHost),
Host = gen_mod:get_opt_host(ServerHost, Opts, "pubsub.@HOST@"),
update_table(Host),
mnesia:add_table_index(pubsub_node, host_parent),
ServedHosts = gen_mod:get_opt(served_hosts, Opts, []),

View File

@ -3,12 +3,10 @@
%%% Author : Alexey Shchepin <alexey@sevcom.net>
%%% Purpose :
%%% Created : 2 Jan 2003 by Alexey Shchepin <alexey@sevcom.net>
%%% Id : $Id$
%%%----------------------------------------------------------------------
-module(mod_vcard).
-author('alexey@sevcom.net').
-vsn('$Revision$ ').
-behaviour(gen_mod).
@ -71,7 +69,7 @@ start(Host, Opts) ->
gen_iq_handler:add_iq_handler(ejabberd_sm, Host, ?NS_VCARD,
?MODULE, process_sm_iq, IQDisc),
ejabberd_hooks:add(disco_sm_features, Host, ?MODULE, get_sm_features, 50),
MyHost = gen_mod:get_opt(host, Opts, "vjud." ++ Host),
MyHost = gen_mod:get_opt_host(Host, Opts, "vjud.@HOST@"),
Search = gen_mod:get_opt(search, Opts, true),
register(gen_mod:get_module_proc(Host, ?PROCNAME),
spawn(?MODULE, init, [MyHost, Host, Search])).

View File

@ -3,12 +3,10 @@
%%% Author : Alexey Shchepin <alexey@sevcom.net>
%%% Purpose : Support for VCards from LDAP storage.
%%% Created : 2 Jan 2003 by Alexey Shchepin <alexey@sevcom.net>
%%% Id : $Id$
%%%----------------------------------------------------------------------
-module(mod_vcard_ldap).
-author('alexey@sevcom.net').
-vsn('$Revision$ ').
-behaviour(gen_server).
-behaviour(gen_mod).
@ -641,7 +639,7 @@ find_xdata_el1([_ | Els]) ->
find_xdata_el1(Els).
parse_options(Host, Opts) ->
MyHost = gen_mod:get_opt(host, Opts, "vjud." ++ Host),
MyHost = gen_mod:get_opt_host(Host, Opts, "vjud.@HOST@"),
Search = gen_mod:get_opt(search, Opts, true),
Matches = case gen_mod:get_opt(matches, Opts, 30) of
infinity -> 0;

View File

@ -3,12 +3,10 @@
%%% Author : Alexey Shchepin <alexey@sevcom.net>
%%% Purpose : vCard support via ODBC
%%% Created : 2 Jan 2003 by Alexey Shchepin <alexey@sevcom.net>
%%% Id : $Id$
%%%----------------------------------------------------------------------
-module(mod_vcard_odbc).
-author('alexey@sevcom.net').
-vsn('$Revision$ ').
-behaviour(gen_mod).
@ -35,7 +33,7 @@ start(Host, Opts) ->
gen_iq_handler:add_iq_handler(ejabberd_sm, Host, ?NS_VCARD,
?MODULE, process_sm_iq, IQDisc),
ejabberd_hooks:add(disco_sm_features, Host, ?MODULE, get_sm_features, 50),
MyHost = gen_mod:get_opt(host, Opts, "vjud." ++ Host),
MyHost = gen_mod:get_opt_host(Host, Opts, "vjud.@HOST@"),
Search = gen_mod:get_opt(search, Opts, true),
register(gen_mod:get_module_proc(Host, ?PROCNAME),
spawn(?MODULE, init, [MyHost, Host, Search])).