25
1
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:
Badlop 2010-10-25 19:00:52 +02:00
parent 9c5f34794a
commit 964b7b6b67
2 changed files with 13 additions and 5 deletions

View File

@ -126,15 +126,23 @@ create_captcha_x(SID, To, Lang, HeadEls, TailEls) ->
[{"xmlns", ?NS_BOB}, {"cid", CID},
{"max-age", "0"}, {"type", Type}],
[{xmlcdata, B64Image}]},
HelpTxt = io_lib:format(
translate:translate(
Lang, "Visit ~s if you don't see the image"),
[get_url(Id ++ "/image")]),
HelpTxt = translate:translate(
Lang,
"If you don't see the CAPTCHA image here, "
"visit the web page."),
Imageurl = get_url(Id ++ "/image"),
Captcha =
{xmlelement, "x", [{"xmlns", ?NS_XDATA}, {"type", "form"}],
[?VFIELD("hidden", "FORM_TYPE", {xmlcdata, ?NS_CAPTCHA}) | HeadEls] ++
[{xmlelement, "field", [{"type", "fixed"}],
[{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", "challenge", {xmlcdata, Id}),
?VFIELD("hidden", "sid", {xmlcdata, SID}),

View File

@ -217,7 +217,7 @@ process_iq(From, To,
translate:translate(
Lang,
"Choose a username and password "
"to register with this server")}]},
"to register with this server.")}]},
UField = {xmlelement, "field",
[{"type", "text-single"},
{"label", translate:translate(Lang, "User")},