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]),
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