]> granicus.if.org Git - ejabberd/commitdiff
Fix user_resources command, and ejabberd_xmlrpc parsing auth details in call
authorBadlop <badlop@process-one.net>
Mon, 31 Mar 2014 14:51:47 +0000 (16:51 +0200)
committerBadlop <badlop@process-one.net>
Mon, 31 Mar 2014 14:51:47 +0000 (16:51 +0200)
src/ejabberd_sm.erl
src/ejabberd_xmlrpc.erl

index 19ab9cb5af61fa98a178ac2e0b864adfbda2665e..2b704d999dfdc711de0321b9f4c670f281b83a5d 100644 (file)
@@ -800,7 +800,7 @@ commands() ->
                        tags = [session],
                        desc = "List user's connected resources",
                        module = ?MODULE, function = user_resources,
-                       args = [{user, string}, {host, string}],
+                       args = [{user, binary}, {host, binary}],
                        result = {resources, {list, {resource, string}}}}].
 
 -spec connected_users() -> [binary()].
index acda0c7f9c58a86f9bc558d7334b61998dc6be32..76610af8ebfdc1c9e777a2604ae4f34d4940bd64 100644 (file)
@@ -345,14 +345,18 @@ build_fault_response(Code, ParseString, ParseArgs) ->
 do_command(AccessCommands, Auth, Command, AttrL, ArgsF,
           ResultF) ->
     ArgsFormatted = format_args(AttrL, ArgsF),
-    {UserT, ServerT, PasswordT} = Auth,
-    AuthBin = {list_to_binary(UserT), list_to_binary(ServerT), list_to_binary(PasswordT)},
+    AuthBin = convert_auth(Auth),
     Result =
        ejabberd_commands:execute_command(AccessCommands, AuthBin,
                                          Command, ArgsFormatted),
     ResultFormatted = format_result(Result, ResultF),
     {command_result, ResultFormatted}.
 
+convert_auth(noauth) ->
+    noauth;
+convert_auth({UserT, ServerT, PasswordT}) ->
+    {list_to_binary(UserT), list_to_binary(ServerT), list_to_binary(PasswordT)}.
+
 %%-----------------------------
 %% Format arguments
 %%-----------------------------