mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
"remove_user" hook actualized to expect binary arguments.
Fix webadmin code that performs addition / removal of users. SVN Revision: 1892
This commit is contained in:
parent
edc0a9ac87
commit
e989d41d50
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2009-02-20 Pablo Polvorin <pablo.polvorin@process-one.net>
|
||||||
|
|
||||||
|
* src/mod_offline_odbc.erl, src/mod_privacy_odbc.erl,
|
||||||
|
src/ejabberd_auth.erl, src/mod_vcard_odbc.erl,
|
||||||
|
src/mod_private_odbc.erl, src/mod_roster_odbc.erl: remove_user hook
|
||||||
|
actualized to expect binary arguments.
|
||||||
|
|
||||||
|
* src/web/ejabberd_web_admin.erl: Fix add / remove users.
|
||||||
|
|
||||||
|
|
||||||
2009-02-19 Christophe Romain <christophe.romain@process-one.net>
|
2009-02-19 Christophe Romain <christophe.romain@process-one.net>
|
||||||
|
|
||||||
* src/mod_pubsub/mod_pubsub.erl: fix nodetree plugin resolver
|
* src/mod_pubsub/mod_pubsub.erl: fix nodetree plugin resolver
|
||||||
|
@ -198,7 +198,7 @@ try_register(User, Server, Password)
|
|||||||
end, {error, not_allowed}, auth_modules(Server)),
|
end, {error, not_allowed}, auth_modules(Server)),
|
||||||
case Res of
|
case Res of
|
||||||
{atomic, ok} ->
|
{atomic, ok} ->
|
||||||
ejabberd_hooks:run(register_user, Server,
|
ejabberd_hooks:run(register_user, list_to_binary(Server),
|
||||||
[User, Server]),
|
[User, Server]),
|
||||||
{atomic, ok};
|
{atomic, ok};
|
||||||
_ -> Res
|
_ -> Res
|
||||||
@ -370,7 +370,8 @@ remove_user(User, Server) when is_list(User), is_list(Server) ->
|
|||||||
M:remove_user(User, Server)
|
M:remove_user(User, Server)
|
||||||
end, auth_modules(Server)),
|
end, auth_modules(Server)),
|
||||||
case R of
|
case R of
|
||||||
ok -> ejabberd_hooks:run(remove_user, jlib:nameprep(Server), [User, Server]);
|
ok -> ejabberd_hooks:run(remove_user, list_to_binary(exmpp_stringprep:nameprep(Server)),
|
||||||
|
[list_to_binary(User), list_to_binary(Server)]);
|
||||||
_ -> none
|
_ -> none
|
||||||
end,
|
end,
|
||||||
R.
|
R.
|
||||||
@ -393,7 +394,8 @@ remove_user(User, Server, Password)
|
|||||||
M:remove_user(User, Server, Password)
|
M:remove_user(User, Server, Password)
|
||||||
end, error, auth_modules(Server)),
|
end, error, auth_modules(Server)),
|
||||||
case R of
|
case R of
|
||||||
ok -> ejabberd_hooks:run(remove_user, jlib:nameprep(Server), [User, Server]);
|
ok -> ejabberd_hooks:run(remove_user, list_to_binary(exmpp_stringprep:nameprep(Server)),
|
||||||
|
[list_to_binary(User), list_to_binary(Server)]);
|
||||||
_ -> none
|
_ -> none
|
||||||
end,
|
end,
|
||||||
R.
|
R.
|
||||||
|
@ -279,8 +279,8 @@ pop_offline_messages(Ls, User, Server)
|
|||||||
remove_user(User, Server)
|
remove_user(User, Server)
|
||||||
when is_binary(User), is_binary(Server) ->
|
when is_binary(User), is_binary(Server) ->
|
||||||
try
|
try
|
||||||
LUser = exmpp_stringprep:nodeprep(User),
|
LUser = binary_to_list(exmpp_stringprep:nodeprep(User)),
|
||||||
LServer = exmpp_stringprep:nameprep(Server),
|
LServer = binary_to_list(exmpp_stringprep:nameprep(Server)),
|
||||||
Username = ejabberd_odbc:escape(LUser),
|
Username = ejabberd_odbc:escape(LUser),
|
||||||
odbc_queries:del_spool_msg(LServer, Username)
|
odbc_queries:del_spool_msg(LServer, Username)
|
||||||
catch
|
catch
|
||||||
|
@ -679,7 +679,7 @@ is_type_match(Type, Value, JID, Subscription, Groups) ->
|
|||||||
remove_user(User, Server) ->
|
remove_user(User, Server) ->
|
||||||
LUser = exmpp_stringprep:nodeprep(User),
|
LUser = exmpp_stringprep:nodeprep(User),
|
||||||
LServer = exmpp_stringprep:nameprep(Server),
|
LServer = exmpp_stringprep:nameprep(Server),
|
||||||
sql_del_privacy_lists(LUser, LServer).
|
sql_del_privacy_lists(binary_to_list(LUser), binary_to_list(LServer)).
|
||||||
|
|
||||||
|
|
||||||
updated_list(_,
|
updated_list(_,
|
||||||
|
@ -171,8 +171,8 @@ end.
|
|||||||
|
|
||||||
remove_user(User, Server) when is_binary(User), is_binary(Server) ->
|
remove_user(User, Server) when is_binary(User), is_binary(Server) ->
|
||||||
try
|
try
|
||||||
LUser = exmpp_stringprep:nodeprep(User),
|
LUser = binary_to_list(exmpp_stringprep:nodeprep(User)),
|
||||||
LServer = exmpp_stringprep:nameprep(Server),
|
LServer = binary_to_list(exmpp_stringprep:nameprep(Server)),
|
||||||
Username = ejabberd_odbc:escape(LUser),
|
Username = ejabberd_odbc:escape(LUser),
|
||||||
odbc_queries:del_user_private_storage(LServer, Username)
|
odbc_queries:del_user_private_storage(LServer, Username)
|
||||||
catch
|
catch
|
||||||
|
@ -627,8 +627,8 @@ in_auto_reply(_, _, _) -> none.
|
|||||||
|
|
||||||
remove_user(User, Server) when is_binary(User), is_binary(Server) ->
|
remove_user(User, Server) when is_binary(User), is_binary(Server) ->
|
||||||
try
|
try
|
||||||
LUser = exmpp_stringprep:nodeprep(User),
|
LUser = binary_to_list(exmpp_stringprep:nodeprep(User)),
|
||||||
LServer = exmpp_stringprep:nameprep(Server),
|
LServer = binary_to_list(exmpp_stringprep:nameprep(Server)),
|
||||||
Username = ejabberd_odbc:escape(LUser),
|
Username = ejabberd_odbc:escape(LUser),
|
||||||
odbc_queries:del_user_roster_t(LServer, Username),
|
odbc_queries:del_user_roster_t(LServer, Username),
|
||||||
ok
|
ok
|
||||||
|
@ -612,9 +612,9 @@ make_val(Match, Field, Val) ->
|
|||||||
% mnesia:transaction(F).
|
% mnesia:transaction(F).
|
||||||
|
|
||||||
|
|
||||||
remove_user(User, Server) when is_binary(User), is_binary(server) ->
|
remove_user(User, Server) when is_binary(User), is_binary(Server) ->
|
||||||
LUser = exmpp_stringprep:nodeprep(User),
|
LUser = binary_to_list(exmpp_stringprep:nodeprep(User)),
|
||||||
LServer = exmpp_stringprep:nameprep(Server),
|
LServer = binary_to_list(exmpp_stringprep:nameprep(Server)),
|
||||||
Username = ejabberd_odbc:escape(LUser),
|
Username = ejabberd_odbc:escape(LUser),
|
||||||
ejabberd_odbc:sql_transaction(
|
ejabberd_odbc:sql_transaction(
|
||||||
LServer,
|
LServer,
|
||||||
|
@ -1364,8 +1364,8 @@ list_users_parse_query(Query, Host) ->
|
|||||||
lists:keysearch("newuserpassword", 1, Query),
|
lists:keysearch("newuserpassword", 1, Query),
|
||||||
try
|
try
|
||||||
JID = exmpp_jid:parse_jid(Username++"@"++Host),
|
JID = exmpp_jid:parse_jid(Username++"@"++Host),
|
||||||
User = exmpp_jid:node(JID),
|
User = exmpp_jid:node_as_list(JID),
|
||||||
Server = exmpp_jid:domain(JID),
|
Server = exmpp_jid:domain_as_list(JID),
|
||||||
case ejabberd_auth:try_register(User, Server, Password) of
|
case ejabberd_auth:try_register(User, Server, Password) of
|
||||||
{error, _Reason} ->
|
{error, _Reason} ->
|
||||||
error;
|
error;
|
||||||
|
Loading…
Reference in New Issue
Block a user