* src/ejabberd_auth.erl: Fixed broken multiple connection with

anonymous login problem (EJAB-107).
* src/ejabberd_auth_anonymous.erl: Likewise.

SVN Revision: 579
This commit is contained in:
Mickaël Rémond 2006-06-13 16:52:38 +00:00
parent b80002a8bb
commit bd276f0b07
3 changed files with 17 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2006-06-13 Mickael Remond <mickael.remond@process-one.net>
* src/ejabberd_auth.erl: Fixed broken multiple connection with
anonymous login problem.
* src/ejabberd_auth_anonymous.erl: Likewise.
2006-06-07 Mickael Remond <mickael.remond@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: Support for pubsub node creation

View File

@ -25,6 +25,7 @@
get_password/2,
get_password_s/2,
is_user_exists/2,
is_user_exists_in_other_modules/3,
remove_user/2,
remove_user/3,
plain_password_required/1,
@ -130,6 +131,14 @@ is_user_exists(User, Server) ->
M:is_user_exists(User, Server)
end, auth_modules(Server)).
%% Check if the user exists in all authentications module except the module
%% passed as parameter
is_user_exists_in_other_modules(Module, User, Server) ->
lists:any(
fun(M) ->
M:is_user_exists(User, Server)
end, auth_modules(Server)--[Module]).
remove_user(User, Server) ->
lists:foreach(
fun(M) ->

View File

@ -149,7 +149,8 @@ check_password(User, Server, Password) ->
check_password(User, Server, _Password, _StreamID, _Digest) ->
%% We refuse login for registered accounts (They cannot logged but
%% they however are "reserved")
case ejabberd_auth:is_user_exists(User, Server) of
case ejabberd_auth:is_user_exists_in_other_modules(?MODULE,
User, Server) of
true -> false;
false -> login(User, Server)
end.