25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-26 16:26:24 +01:00

Generate main XML file also when exporting only a vhost (EJAB-1098)

SVN Revision: 2753
This commit is contained in:
Badlop 2009-11-23 18:34:36 +00:00
parent 58425ba45d
commit 51594b6011

View File

@ -212,7 +212,7 @@ add_user(El, Domain, User, Password) ->
El), El),
ok; ok;
{atomic, exists} -> {atomic, exists} ->
?INFO_MSG("User ~p@~p already exists, using stored profile...~n", io:format("Account ~s@~s already exists, updating it...~n",
[User, Domain]), [User, Domain]),
io:format(""), io:format(""),
ok = exmpp_xml:foreach( ok = exmpp_xml:foreach(
@ -417,10 +417,10 @@ to_list(B) when is_atom(B) -> atom_to_list(B).
%%%================================== %%%==================================
%%%% Export server %%%% Export hosts
%% @spec (Dir::string()) -> ok %% @spec (Dir::string(), Hosts::[string()]) -> ok
export_server(Dir) -> export_hosts(Dir, Hosts) ->
try_start_exmpp(), try_start_exmpp(),
FnT = make_filename_template(), FnT = make_filename_template(),
@ -430,7 +430,6 @@ export_server(Dir) ->
print(Fd, make_piefxis_xml_head()), print(Fd, make_piefxis_xml_head()),
print(Fd, make_piefxis_server_head()), print(Fd, make_piefxis_server_head()),
Hosts = ?MYHOSTS,
FilesAndHosts = [{make_host_filename(FnT, Host), Host} || Host <- Hosts], FilesAndHosts = [{make_host_filename(FnT, Host), Host} || Host <- Hosts],
[print(Fd, make_xinclude(FnH)) || {FnH, _Host} <- FilesAndHosts], [print(Fd, make_xinclude(FnH)) || {FnH, _Host} <- FilesAndHosts],
@ -442,15 +441,21 @@ export_server(Dir) ->
ok. ok.
%%%==================================
%%%% Export server
%% @spec (Dir::string()) -> ok
export_server(Dir) ->
Hosts = ?MYHOSTS,
export_hosts(Dir, Hosts).
%%%================================== %%%==================================
%%%% Export host %%%% Export host
%% @spec (Dir::string(), Host::string()) -> ok %% @spec (Dir::string(), Host::string()) -> ok
export_host(Dir, Host) -> export_host(Dir, Host) ->
try_start_exmpp(), Hosts = [Host],
FnT = make_filename_template(), export_hosts(Dir, Hosts).
FnH = make_host_filename(FnT, Host),
export_host(Dir, FnH, Host).
%% @spec (Dir::string(), Fn::string(), Host::string()) -> ok %% @spec (Dir::string(), Fn::string(), Host::string()) -> ok
export_host(Dir, FnH, Host) -> export_host(Dir, FnH, Host) ->