mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
* src/mod_last.erl: Added remove_user/1 function
* src/mod_configure.erl: Removing of user's stuff moved to ejabberd_auth * src/ejabberd_auth.erl: Likewise SVN Revision: 167
This commit is contained in:
parent
8a52d7cad1
commit
36157e41c9
@ -1,3 +1,11 @@
|
|||||||
|
2003-11-01 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
|
* src/mod_last.erl: Added remove_user/1 function
|
||||||
|
|
||||||
|
* src/mod_configure.erl: Removing of user's stuff moved to
|
||||||
|
ejabberd_auth
|
||||||
|
* src/ejabberd_auth.erl: Likewise
|
||||||
|
|
||||||
2003-10-31 Alexey Shchepin <alexey@sevcom.net>
|
2003-10-31 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
* src/mod_irc/mod_irc_connection.erl: Updated to work more
|
* src/mod_irc/mod_irc_connection.erl: Updated to work more
|
||||||
|
@ -202,7 +202,12 @@ remove_user(User) ->
|
|||||||
F = fun() ->
|
F = fun() ->
|
||||||
mnesia:delete({passwd, LUser})
|
mnesia:delete({passwd, LUser})
|
||||||
end,
|
end,
|
||||||
mnesia:transaction(F).
|
mnesia:transaction(F),
|
||||||
|
catch mod_roster:remove_user(User),
|
||||||
|
catch mod_offline:remove_user(User),
|
||||||
|
catch mod_last:remove_user(User),
|
||||||
|
catch mod_vcard:remove_user(User),
|
||||||
|
catch mod_private:remove_user(User).
|
||||||
|
|
||||||
remove_user(User, Password) ->
|
remove_user(User, Password) ->
|
||||||
LUser = jlib:nodeprep(User),
|
LUser = jlib:nodeprep(User),
|
||||||
@ -218,6 +223,13 @@ remove_user(User, Password) ->
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
case mnesia:transaction(F) of
|
case mnesia:transaction(F) of
|
||||||
|
{atomic, ok} ->
|
||||||
|
catch mod_roster:remove_user(User),
|
||||||
|
catch mod_offline:remove_user(User),
|
||||||
|
catch mod_last:remove_user(User),
|
||||||
|
catch mod_vcard:remove_user(User),
|
||||||
|
catch mod_private:remove_user(User),
|
||||||
|
ok;
|
||||||
{atomic, Res} ->
|
{atomic, Res} ->
|
||||||
Res;
|
Res;
|
||||||
_ ->
|
_ ->
|
||||||
|
@ -671,11 +671,7 @@ set_form(["config", "remusers"], Lang, XData) ->
|
|||||||
jlib:make_jid(Var, "", ""),
|
jlib:make_jid(Var, "", ""),
|
||||||
{xmlelement, "broadcast", [],
|
{xmlelement, "broadcast", [],
|
||||||
[{exit, "User removed"}]}},
|
[{exit, "User removed"}]}},
|
||||||
catch ejabberd_auth:remove_user(Var),
|
catch ejabberd_auth:remove_user(Var);
|
||||||
catch mod_roster:remove_user(Var),
|
|
||||||
catch mod_offline:remove_user(Var),
|
|
||||||
catch mod_vcard:remove_user(Var),
|
|
||||||
catch mod_private:remove_user(Var);
|
|
||||||
_ ->
|
_ ->
|
||||||
ok
|
ok
|
||||||
end
|
end
|
||||||
@ -805,10 +801,6 @@ set_sm_form(User, [], Lang, XData) ->
|
|||||||
{xmlelement, "broadcast", [],
|
{xmlelement, "broadcast", [],
|
||||||
[{exit, "User removed"}]}},
|
[{exit, "User removed"}]}},
|
||||||
catch ejabberd_auth:remove_user(User),
|
catch ejabberd_auth:remove_user(User),
|
||||||
catch mod_roster:remove_user(User),
|
|
||||||
catch mod_offline:remove_user(User),
|
|
||||||
catch mod_vcard:remove_user(User),
|
|
||||||
catch mod_private:remove_user(User),
|
|
||||||
{result, []};
|
{result, []};
|
||||||
_ ->
|
_ ->
|
||||||
{error, ?ERR_BAD_REQUEST}
|
{error, ?ERR_BAD_REQUEST}
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
stop/0,
|
stop/0,
|
||||||
process_local_iq/3,
|
process_local_iq/3,
|
||||||
process_sm_iq/3,
|
process_sm_iq/3,
|
||||||
on_presence_update/1]).
|
on_presence_update/1,
|
||||||
|
remove_user/1]).
|
||||||
|
|
||||||
-include("ejabberd.hrl").
|
-include("ejabberd.hrl").
|
||||||
-include("jlib.hrl").
|
-include("jlib.hrl").
|
||||||
@ -112,3 +113,9 @@ on_presence_update(LUser) ->
|
|||||||
mnesia:transaction(F).
|
mnesia:transaction(F).
|
||||||
|
|
||||||
|
|
||||||
|
remove_user(User) ->
|
||||||
|
LUser = jlib:nodeprep(User),
|
||||||
|
F = fun() ->
|
||||||
|
mnesia:delete({last_activity, LUser})
|
||||||
|
end,
|
||||||
|
mnesia:transaction(F).
|
||||||
|
Loading…
Reference in New Issue
Block a user