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

Fix some exmpp calls

This commit is contained in:
Badlop 2010-06-18 16:04:46 +02:00
parent 63032e1397
commit cab6ee9d86

View File

@ -1402,9 +1402,7 @@ set_form(_From, Host, ["running nodes", ENode, "modules", "start"], _Lang, XData
end; end;
_ -> _ ->
{error, 'bad-request'} {error, 'bad-request'}
end; end
_ ->
{error, 'bad-request'}
end end
end; end;
@ -1663,17 +1661,15 @@ set_form(From, Host, ?NS_ADMINL("change-user-password"), _Lang, XData) ->
set_form(From, Host, ?NS_ADMINL("get-user-lastlogin"), Lang, XData) -> set_form(From, Host, ?NS_ADMINL("get-user-lastlogin"), Lang, XData) ->
AccountString = get_value("accountjid", XData), AccountString = get_value("accountjid", XData),
JID = exmpp_jid:parse(AccountString), JID = exmpp_jid:parse(AccountString),
User = [_|_] = exmpp_jid:prep_node_as_list(JID), User = [_|_] = exmpp_jid:prep_node(JID),
Server = exmpp_jid:prep_domain_as_list(JID), Server = exmpp_jid:prep_domain(JID),
true = (Server == Host) orelse (get_permission_level(From) == global), true = (Server == Host) orelse (get_permission_level(From) == global),
%% Code copied from web/ejabberd_web_admin.erl %% Code copied from web/ejabberd_web_admin.erl
%% TODO: Update time format to XEP-0202: Entity Time %% TODO: Update time format to XEP-0202: Entity Time
FLast = FLast =
case ejabberd_sm:get_user_resources(exmpp_jid:prep_node(User), case ejabberd_sm:get_user_resources(User, Server) of
exmpp_jid:prep_domain(Server)) of
[] -> [] ->
_US = {User, Server},
case get_last_info(User, Server) of case get_last_info(User, Server) of
not_found -> not_found ->
?T(Lang, "Never"); ?T(Lang, "Never");
@ -1715,7 +1711,7 @@ set_form(From, Host, ?NS_ADMINL("user-stats"), Lang, XData) ->
exmpp_jid:prep_domain(JID), exmpp_jid:prep_domain(JID),
[], [],
[{list_to_binary(User), list_to_binary(Server)}]), [{list_to_binary(User), list_to_binary(Server)}]),
Rostersize = integer_to_list(erlang:length(Items)), Rostersize = list_to_binary(integer_to_list(erlang:length(Items))),
{result, [#xmlel{ns = ?NS_DATA_FORMS, name = 'x', children = {result, [#xmlel{ns = ?NS_DATA_FORMS, name = 'x', children =
[?HFIELD(), [?HFIELD(),