mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
ejabberd_auth: Don't use cache if it's disabled
Don't let the check whether a user exists use the cache if caching was disabled in the configuration.
This commit is contained in:
parent
638f2d2e67
commit
410db89167
@ -545,8 +545,8 @@ db_user_exists(User, Server, Mod) ->
|
|||||||
{ok, _} ->
|
{ok, _} ->
|
||||||
true;
|
true;
|
||||||
error ->
|
error ->
|
||||||
case Mod:store_type(Server) of
|
case {Mod:store_type(Server), use_cache(Mod, Server)} of
|
||||||
external ->
|
{external, true} ->
|
||||||
case ets_cache:lookup(
|
case ets_cache:lookup(
|
||||||
?AUTH_CACHE, {User, Server},
|
?AUTH_CACHE, {User, Server},
|
||||||
fun() ->
|
fun() ->
|
||||||
@ -561,6 +561,8 @@ db_user_exists(User, Server, Mod) ->
|
|||||||
error ->
|
error ->
|
||||||
false
|
false
|
||||||
end;
|
end;
|
||||||
|
{external, false} ->
|
||||||
|
Mod:user_exists(User, Server);
|
||||||
_ ->
|
_ ->
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user