Skip to content

Commit

Permalink
Improve ban_account command to work with other DBs than Mnesia (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
badlop committed Mar 21, 2016
1 parent 107569a commit e7ef65a
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/mod_admin_extra.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit e7ef65a

Please sign in to comment.