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:
Holger Weiss 2018-05-03 00:31:33 +02:00
parent 638f2d2e67
commit 410db89167
1 changed files with 4 additions and 2 deletions

View File

@ -545,8 +545,8 @@ db_user_exists(User, Server, Mod) ->
{ok, _} ->
true;
error ->
case Mod:store_type(Server) of
external ->
case {Mod:store_type(Server), use_cache(Mod, Server)} of
{external, true} ->
case ets_cache:lookup(
?AUTH_CACHE, {User, Server},
fun() ->
@ -561,6 +561,8 @@ db_user_exists(User, Server, Mod) ->
error ->
false
end;
{external, false} ->
Mod:user_exists(User, Server);
_ ->
false
end