mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-22 17:28:25 +01:00
Changes in registration form to workaround client problems (EJAB-1262)
Changes included: * Remove var in fixed field because Gajim and Tkabber display it to user * Add workaround for Psi's overlap fields * Add var=url attribute, required by Psi to display the field * Provide the image URL as a copy-able form field
This commit is contained in:
parent
9c5f34794a
commit
964b7b6b67
@ -126,15 +126,23 @@ create_captcha_x(SID, To, Lang, HeadEls, TailEls) ->
|
|||||||
[{"xmlns", ?NS_BOB}, {"cid", CID},
|
[{"xmlns", ?NS_BOB}, {"cid", CID},
|
||||||
{"max-age", "0"}, {"type", Type}],
|
{"max-age", "0"}, {"type", Type}],
|
||||||
[{xmlcdata, B64Image}]},
|
[{xmlcdata, B64Image}]},
|
||||||
HelpTxt = io_lib:format(
|
HelpTxt = translate:translate(
|
||||||
translate:translate(
|
Lang,
|
||||||
Lang, "Visit ~s if you don't see the image"),
|
"If you don't see the CAPTCHA image here, "
|
||||||
[get_url(Id ++ "/image")]),
|
"visit the web page."),
|
||||||
|
Imageurl = get_url(Id ++ "/image"),
|
||||||
Captcha =
|
Captcha =
|
||||||
{xmlelement, "x", [{"xmlns", ?NS_XDATA}, {"type", "form"}],
|
{xmlelement, "x", [{"xmlns", ?NS_XDATA}, {"type", "form"}],
|
||||||
[?VFIELD("hidden", "FORM_TYPE", {xmlcdata, ?NS_CAPTCHA}) | HeadEls] ++
|
[?VFIELD("hidden", "FORM_TYPE", {xmlcdata, ?NS_CAPTCHA}) | HeadEls] ++
|
||||||
[{xmlelement, "field", [{"type", "fixed"}],
|
[{xmlelement, "field", [{"type", "fixed"}],
|
||||||
[{xmlelement, "value", [], [{xmlcdata, HelpTxt}]}]},
|
[{xmlelement, "value", [], [{xmlcdata, HelpTxt}]}]},
|
||||||
|
{xmlelement, "field", [{"type", "hidden"}, {"var", "captchahidden"}],
|
||||||
|
[{xmlelement, "value", [], [{xmlcdata, "workaround-for-psi"}]}]},
|
||||||
|
{xmlelement, "field",
|
||||||
|
[{"type", "text-single"},
|
||||||
|
{"label", translate:translate(Lang, "CAPTCHA web page")},
|
||||||
|
{"var", "url"}],
|
||||||
|
[{xmlelement, "value", [], [{xmlcdata, Imageurl}]}]},
|
||||||
?VFIELD("hidden", "from", {xmlcdata, jlib:jid_to_string(To)}),
|
?VFIELD("hidden", "from", {xmlcdata, jlib:jid_to_string(To)}),
|
||||||
?VFIELD("hidden", "challenge", {xmlcdata, Id}),
|
?VFIELD("hidden", "challenge", {xmlcdata, Id}),
|
||||||
?VFIELD("hidden", "sid", {xmlcdata, SID}),
|
?VFIELD("hidden", "sid", {xmlcdata, SID}),
|
||||||
|
@ -217,7 +217,7 @@ process_iq(From, To,
|
|||||||
translate:translate(
|
translate:translate(
|
||||||
Lang,
|
Lang,
|
||||||
"Choose a username and password "
|
"Choose a username and password "
|
||||||
"to register with this server")}]},
|
"to register with this server.")}]},
|
||||||
UField = {xmlelement, "field",
|
UField = {xmlelement, "field",
|
||||||
[{"type", "text-single"},
|
[{"type", "text-single"},
|
||||||
{"label", translate:translate(Lang, "User")},
|
{"label", translate:translate(Lang, "User")},
|
||||||
|
Loading…
Reference in New Issue
Block a user