mirror of
https://github.com/processone/ejabberd.git
synced 2024-09-27 14:30:55 +02:00
When checking captcha setup, try to generate image only when captcha is enabled in order to avoid logging of confusing error
This commit is contained in:
parent
f7d532f2f7
commit
7bc879c6f4
@ -559,15 +559,16 @@ is_feature_available() ->
|
|||||||
end.
|
end.
|
||||||
|
|
||||||
check_captcha_setup() ->
|
check_captcha_setup() ->
|
||||||
AbleToGenerateCaptcha = case create_image() of
|
case is_feature_available() of
|
||||||
{ok, _, _, _} -> true;
|
|
||||||
_Error -> false
|
|
||||||
end,
|
|
||||||
case is_feature_available() andalso not AbleToGenerateCaptcha of
|
|
||||||
true ->
|
true ->
|
||||||
|
case create_image() of
|
||||||
|
{ok, _, _, _} ->
|
||||||
|
ok;
|
||||||
|
_Err ->
|
||||||
?CRITICAL_MSG("Captcha is enabled in the option captcha_cmd, "
|
?CRITICAL_MSG("Captcha is enabled in the option captcha_cmd, "
|
||||||
"but it can't generate images.", []),
|
"but it can't generate images.", []),
|
||||||
throw({error, captcha_cmd_enabled_but_fails});
|
throw({error, captcha_cmd_enabled_but_fails})
|
||||||
|
end;
|
||||||
false ->
|
false ->
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user