25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Don't render CAPTCHA whitelist when CAPTCHA is not configured

Fixes #2970
This commit is contained in:
Evgeny Khramtsov 2019-07-31 12:35:06 +03:00
parent a2fa52a192
commit 48bed43902

View File

@ -3527,11 +3527,15 @@ get_config(Lang, StateData, From) ->
{pubsub, Config#config.pubsub}] {pubsub, Config#config.pubsub}]
++ ++
case ejabberd_captcha:is_feature_available() of case ejabberd_captcha:is_feature_available() of
true -> [{captcha_protected, Config#config.captcha_protected}]; true ->
false -> [] [{captcha_protected, Config#config.captcha_protected},
end ++ {captcha_whitelist,
[{captcha_whitelist, lists:map(
lists:map(fun jid:make/1, ?SETS:to_list(Config#config.captcha_whitelist))}] fun jid:make/1,
?SETS:to_list(Config#config.captcha_whitelist))}];
false ->
[]
end
++ ++
case mod_muc_log:check_access_log(StateData#state.server_host, From) of case mod_muc_log:check_access_log(StateData#state.server_host, From) of
allow -> [{enablelogging, Config#config.logging}]; allow -> [{enablelogging, Config#config.logging}];