summaryrefslogtreecommitdiff
path: root/src/ejabberd_piefxis.erl
diff options
context:
space:
mode:
authorBadlop <badlop@process-one.net>2009-11-23 18:34:36 +0000
committerBadlop <badlop@process-one.net>2009-11-23 18:34:36 +0000
commit51594b60118c93f2e0f125feddd0d333746f7811 (patch)
tree83b69d33ce5775237f791ce6d648c1181da9564e /src/ejabberd_piefxis.erl
parentShow informative webpage when browsing the HTTP-Poll page (EJAB-1106) (diff)
Generate main XML file also when exporting only a vhost (EJAB-1098)
SVN Revision: 2753
Diffstat (limited to 'src/ejabberd_piefxis.erl')
-rw-r--r--src/ejabberd_piefxis.erl23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/ejabberd_piefxis.erl b/src/ejabberd_piefxis.erl
index 4cc391fb..db50c163 100644
--- a/src/ejabberd_piefxis.erl
+++ b/src/ejabberd_piefxis.erl
@@ -212,7 +212,7 @@ add_user(El, Domain, User, Password) ->
El),
ok;
{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]),
io:format(""),
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
-export_server(Dir) ->
+%% @spec (Dir::string(), Hosts::[string()]) -> ok
+export_hosts(Dir, Hosts) ->
try_start_exmpp(),
FnT = make_filename_template(),
@@ -430,7 +430,6 @@ export_server(Dir) ->
print(Fd, make_piefxis_xml_head()),
print(Fd, make_piefxis_server_head()),
- Hosts = ?MYHOSTS,
FilesAndHosts = [{make_host_filename(FnT, Host), Host} || Host <- Hosts],
[print(Fd, make_xinclude(FnH)) || {FnH, _Host} <- FilesAndHosts],
@@ -443,14 +442,20 @@ export_server(Dir) ->
ok.
%%%==================================
+%%%% Export server
+
+%% @spec (Dir::string()) -> ok
+export_server(Dir) ->
+ Hosts = ?MYHOSTS,
+ export_hosts(Dir, Hosts).
+
+%%%==================================
%%%% Export host
%% @spec (Dir::string(), Host::string()) -> ok
export_host(Dir, Host) ->
- try_start_exmpp(),
- FnT = make_filename_template(),
- FnH = make_host_filename(FnT, Host),
- export_host(Dir, FnH, Host).
+ Hosts = [Host],
+ export_hosts(Dir, Hosts).
%% @spec (Dir::string(), Fn::string(), Host::string()) -> ok
export_host(Dir, FnH, Host) ->