mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-30 16:36:29 +01:00
Additional fixes for previous captcha commits related to exmpp
This commit is contained in:
parent
32868e534e
commit
48dcc5180a
@ -265,7 +265,7 @@ create_captcha_x(SID, To, Lang, HeadEls, TailEls) ->
|
||||
value = <<"text-single">>
|
||||
},
|
||||
#xmlattr{name = 'label',
|
||||
value = translate:translate(Lang, "CAPTCHA web page")
|
||||
value = list_to_binary(translate:translate(Lang, "CAPTCHA web page"))
|
||||
},
|
||||
#xmlattr{name = 'var',
|
||||
value = <<"url">>
|
||||
@ -525,7 +525,7 @@ process(_Handlers, #request{method='POST', q=Q, lang=Lang, path=[_, Id]}) ->
|
||||
% }]},
|
||||
#xmlel{name = 'p',
|
||||
children = [
|
||||
#xmlcdata{cdata = translate:translate(Lang, "The captcha is valid.")}
|
||||
#xmlcdata{cdata = list_to_binary(translate:translate(Lang, "The captcha is valid."))}
|
||||
]
|
||||
},
|
||||
ejabberd_web:make_xhtml([Form]);
|
||||
|
@ -48,6 +48,7 @@
|
||||
-include("ejabberd.hrl").
|
||||
|
||||
-record(ejabberd_module, {module_host, opts}).
|
||||
%% module_host = {Module::atom(), Host::string()}
|
||||
|
||||
behaviour_info(callbacks) ->
|
||||
[{start, 2},
|
||||
|
@ -96,7 +96,7 @@ process_iq(From, To,
|
||||
#iq{type = Type, lang = Lang, payload = SubEl, id = ID} = IQ_Rec,
|
||||
Source) ->
|
||||
IsCaptchaEnabled = case gen_mod:get_module_opt(
|
||||
exmpp_jid:domain(To), ?MODULE, captcha_protected, false) of
|
||||
exmpp_jid:domain_as_list(To), ?MODULE, captcha_protected, false) of
|
||||
true ->
|
||||
true;
|
||||
_ ->
|
||||
@ -504,7 +504,7 @@ write_time({{Y,Mo,D},{H,Mi,S}}) ->
|
||||
[Y, Mo, D, H, Mi, S]).
|
||||
|
||||
process_xdata_submit(El) ->
|
||||
case xml:get_subtag(El, "x") of
|
||||
case exmpp_xml:get_element(El, x) of
|
||||
false ->
|
||||
error;
|
||||
Xdata ->
|
||||
@ -519,7 +519,7 @@ process_xdata_submit(El) ->
|
||||
end.
|
||||
|
||||
is_strong_password(Server, Password) ->
|
||||
LServer = jlib:nameprep(Server),
|
||||
LServer = exmpp_stringprep:nameprep(Server),
|
||||
case gen_mod:get_module_opt(LServer, ?MODULE, password_strength, 0) of
|
||||
Entropy when is_number(Entropy), Entropy >= 0 ->
|
||||
if Entropy == 0 ->
|
||||
|
Loading…
Reference in New Issue
Block a user