mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Improve ban_account command to work with other DBs than Mnesia (#977)
This commit is contained in:
parent
107569a17d
commit
e7ef65a22d
@ -748,21 +748,7 @@ kick_sessions(User, Server, Reason) ->
|
||||
fun(Resource) ->
|
||||
kick_this_session(User, Server, Resource, Reason)
|
||||
end,
|
||||
get_resources(User, Server)).
|
||||
|
||||
get_resources(User, Server) ->
|
||||
lists:map(
|
||||
fun(Session) ->
|
||||
element(3, Session#session.usr)
|
||||
end,
|
||||
get_sessions(User, Server)).
|
||||
|
||||
get_sessions(User, Server) ->
|
||||
LUser = jid:nodeprep(User),
|
||||
LServer = jid:nameprep(Server),
|
||||
Sessions = mnesia:dirty_index_read(session, {LUser, LServer}, #session.us),
|
||||
true = is_list(Sessions),
|
||||
Sessions.
|
||||
ejabberd_sm:get_user_resources(User, Server)).
|
||||
|
||||
set_random_password(User, Server, Reason) ->
|
||||
NewPass = build_random_password(Reason),
|
||||
|
Loading…
Reference in New Issue
Block a user