]> granicus.if.org Git - ejabberd/commitdiff
Fixes a bug on the web interface: On user creation screen the user creation was using...
authorMickaël Rémond <mickael.remond@process-one.net>
Tue, 19 Apr 2005 14:25:31 +0000 (14:25 +0000)
committerMickaël Rémond <mickael.remond@process-one.net>
Tue, 19 Apr 2005 14:25:31 +0000 (14:25 +0000)
SVN Revision: 321

src/web/ejabberd_web_admin.erl

index 90d0a9a924391c759163bf6febedbfb79384d0f8..7bd69861cf80dd2b27eeb275a126db07c2738782 100644 (file)
@@ -1143,23 +1143,22 @@ list_users(Query, Lang) ->
 list_users_parse_query(Query) ->
     case lists:keysearch("addnewuser", 1, Query) of
        {value, _} ->
-           {value, {_, User}} =
+           {value, {_, JIDString}} =
                lists:keysearch("newusername", 1, Query),
            {value, {_, Password}} =
                lists:keysearch("newuserpassword", 1, Query),
-           case jlib:nodeprep(User) of
+           case jlib:string_to_jid(JIDString) of
                error ->
                    error;
-               "" ->
-                   error;
-               _ ->
-                   ejabberd_auth:try_register(User, Password),
+               #jid{user = User, server = Server} ->
+                   ejabberd_auth:try_register(User, Server, Password),
                    ok
            end;
        false ->
            nothing
     end.
 
+
 list_users_in_diapason(Diap, Lang) ->
     Users = ejabberd_auth:dirty_get_registered_users(),
     SUsers = lists:sort([{S, U} || {U, S} <- Users]),
@@ -1181,7 +1180,7 @@ list_given_users(Users, Prefix, Lang) ->
               fun(SU = {Server, User}) ->
                       US = {User, Server},
                       QueueLen = length(mnesia:dirty_read({offline_msg, US})),
-                      FQueueLen = [?AC(Prefix ++ "user/" ++ User ++ "/queue/",
+                      FQueueLen = [?AC(Prefix ++ "user/" ++ User ++ "@" ++ Server ++ "/queue/",
                                        integer_to_list(QueueLen))],
                       FLast =
                           case ejabberd_sm:get_user_resources(User, Server) of