mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
Fix Dialyzer errors in auth modules
This commit is contained in:
parent
ead2655a62
commit
1a6c162371
@ -393,11 +393,8 @@ remove_user(User, Server) when is_list(User), is_list(Server) ->
|
|||||||
fun(M) ->
|
fun(M) ->
|
||||||
M:remove_user(User, Server)
|
M:remove_user(User, Server)
|
||||||
end, auth_modules(Server)),
|
end, auth_modules(Server)),
|
||||||
case R of
|
ejabberd_hooks:run(remove_user, list_to_binary(exmpp_stringprep:nameprep(Server)),
|
||||||
ok -> ejabberd_hooks:run(remove_user, list_to_binary(exmpp_stringprep:nameprep(Server)),
|
[list_to_binary(User), list_to_binary(Server)]),
|
||||||
[list_to_binary(User), list_to_binary(Server)]);
|
|
||||||
_ -> none
|
|
||||||
end,
|
|
||||||
R.
|
R.
|
||||||
|
|
||||||
%% @spec (User, Server, Password) -> ok | not_exists | not_allowed | bad_request | error
|
%% @spec (User, Server, Password) -> ok | not_exists | not_allowed | bad_request | error
|
||||||
|
@ -201,8 +201,8 @@ register_connection(SID, JID, Info) when ?IS_JID(JID) ->
|
|||||||
%% @doc Remove an anonymous user from the anonymous users table.
|
%% @doc Remove an anonymous user from the anonymous users table.
|
||||||
|
|
||||||
unregister_connection(SID, JID, _) when ?IS_JID(JID) ->
|
unregister_connection(SID, JID, _) when ?IS_JID(JID) ->
|
||||||
LUser = exmpp_jid:prep_node(JID),
|
LUser = exmpp_jid:prep_node_as_list(JID),
|
||||||
LServer = exmpp_jid:prep_domain(JID),
|
LServer = exmpp_jid:prep_domain_as_list(JID),
|
||||||
purge_hook(anonymous_user_exist(LUser, LServer),
|
purge_hook(anonymous_user_exist(LUser, LServer),
|
||||||
LUser, LServer),
|
LUser, LServer),
|
||||||
remove_connection(SID, LUser, LServer).
|
remove_connection(SID, LUser, LServer).
|
||||||
@ -215,7 +215,7 @@ unregister_connection(SID, JID, _) when ?IS_JID(JID) ->
|
|||||||
purge_hook(false, _LUser, _LServer) ->
|
purge_hook(false, _LUser, _LServer) ->
|
||||||
ok;
|
ok;
|
||||||
purge_hook(true, LUser, LServer) when is_list(LUser), is_list(LServer) ->
|
purge_hook(true, LUser, LServer) when is_list(LUser), is_list(LServer) ->
|
||||||
ejabberd_hooks:run(anonymous_purge_hook, LServer, [LUser, LServer]).
|
ejabberd_hooks:run(anonymous_purge_hook, list_to_binary(LServer), [LUser, LServer]).
|
||||||
|
|
||||||
%% ---------------------------------
|
%% ---------------------------------
|
||||||
%% Specific anonymous auth functions
|
%% Specific anonymous auth functions
|
||||||
|
@ -133,13 +133,14 @@ check_password(User, Server, Password, Digest, DigestGen) ->
|
|||||||
%% Password = string()
|
%% Password = string()
|
||||||
|
|
||||||
set_password(User, Server, Password) ->
|
set_password(User, Server, Password) ->
|
||||||
LUser = exmpp_stringprep:nodeprep(User),
|
LUser = (catch exmpp_stringprep:nodeprep(User)),
|
||||||
LServer = exmpp_stringprep:nameprep(Server),
|
LServer = (catch exmpp_stringprep:nameprep(Server)),
|
||||||
US = {LUser, LServer},
|
case {LUser, LServer} of
|
||||||
if
|
{{stringprep, _, invalid_string, _}, _} ->
|
||||||
(LUser == error) or (LServer == error) ->
|
|
||||||
{error, invalid_jid};
|
{error, invalid_jid};
|
||||||
true ->
|
{_, {stringprep, _, invalid_string, _}} ->
|
||||||
|
{error, invalid_jid};
|
||||||
|
US ->
|
||||||
F = fun() ->
|
F = fun() ->
|
||||||
mnesia:write(#passwd{us = US,
|
mnesia:write(#passwd{us = US,
|
||||||
password = Password})
|
password = Password})
|
||||||
@ -154,13 +155,14 @@ set_password(User, Server, Password) ->
|
|||||||
%% Password = string()
|
%% Password = string()
|
||||||
|
|
||||||
try_register(User, Server, Password) ->
|
try_register(User, Server, Password) ->
|
||||||
LUser = exmpp_stringprep:nodeprep(User),
|
LUser = (catch exmpp_stringprep:nodeprep(User)),
|
||||||
LServer = exmpp_stringprep:nameprep(Server),
|
LServer = (catch exmpp_stringprep:nameprep(Server)),
|
||||||
US = {LUser, LServer},
|
case {LUser, LServer} of
|
||||||
if
|
{{stringprep, _, invalid_string, _}, _} ->
|
||||||
(LUser == error) or (LServer == error) ->
|
|
||||||
{error, invalid_jid};
|
{error, invalid_jid};
|
||||||
true ->
|
{_, {stringprep, _, invalid_string, _}} ->
|
||||||
|
{error, invalid_jid};
|
||||||
|
US ->
|
||||||
F = fun() ->
|
F = fun() ->
|
||||||
case mnesia:read({passwd, US}) of
|
case mnesia:read({passwd, US}) of
|
||||||
[] ->
|
[] ->
|
||||||
|
Loading…
Reference in New Issue
Block a user