From 033718b9f42cb8587bcd37bf433f602b9bd62c48 Mon Sep 17 00:00:00 2001 From: SimpleTest Date: Wed, 26 Aug 2026 03:35:14 +0300 Subject: [PATCH] Require explicit support request confirmation --- assets/js/app.js | 8 ++ lib/who_need_help/content_removal.ex | 2 +- lib/who_need_help/content_removal/notifier.ex | 2 +- lib/who_need_help/support.ex | 2 +- lib/who_need_help/support/notifier.ex | 2 +- .../controllers/content_removal_controller.ex | 15 ++++ .../content_removal_html/verify.html.heex | 44 +++++++++++ .../controllers/support_controller.ex | 15 ++++ .../controllers/support_html/verify.html.heex | 39 ++++++++++ lib/who_need_help_web/router.ex | 6 +- priv/gettext/default.pot | 68 +++++++++++++---- priv/gettext/en/LC_MESSAGES/default.po | 74 ++++++++++++++----- priv/gettext/ru/LC_MESSAGES/default.po | 74 ++++++++++++++----- priv/gettext/uk/LC_MESSAGES/default.po | 74 ++++++++++++++----- .../support_and_content_removal_test.exs | 11 ++- .../controllers/support_controller_test.exs | 53 +++++++++++-- 16 files changed, 404 insertions(+), 85 deletions(-) create mode 100644 lib/who_need_help_web/controllers/content_removal_html/verify.html.heex create mode 100644 lib/who_need_help_web/controllers/support_html/verify.html.heex diff --git a/assets/js/app.js b/assets/js/app.js index e507d5c..bbdf758 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -74,6 +74,14 @@ const activateProtectedTokenFragment = () => { { form: document.getElementById("email-change-fragment-form"), input: document.getElementById("email-change-fragment-token") + }, + { + form: document.getElementById("support-confirmation-fragment-form"), + input: document.getElementById("support-confirmation-fragment-token") + }, + { + form: document.getElementById("content-removal-confirmation-fragment-form"), + input: document.getElementById("content-removal-confirmation-fragment-token") } ] diff --git a/lib/who_need_help/content_removal.ex b/lib/who_need_help/content_removal.ex index c4ceb1d..f9c59c6 100644 --- a/lib/who_need_help/content_removal.ex +++ b/lib/who_need_help/content_removal.ex @@ -138,7 +138,7 @@ defmodule WhoNeedHelp.ContentRemoval do token = confirmation_token(notice) PublicAccess.url( - "/legal/content-removal/#{notice.id}/verify?token=#{URI.encode_www_form(token)}" + "/legal/content-removal/#{notice.id}/verify#token=#{URI.encode_www_form(token)}" ) end diff --git a/lib/who_need_help/content_removal/notifier.ex b/lib/who_need_help/content_removal/notifier.ex index 4d7258b..6a816d1 100644 --- a/lib/who_need_help/content_removal/notifier.ex +++ b/lib/who_need_help/content_removal/notifier.ex @@ -13,7 +13,7 @@ defmodule WhoNeedHelp.ContentRemoval.Notifier do """ Confirm the email address for removal notice #{notice.reference}. - The notice has not been added to the staff review queue yet. Open this private link to verify the address and submit it for review: + The notice has not been added to the staff review queue yet. Open this private link, then press the confirmation button to verify the address and submit it for review: #{status_url} If you did not make this request, ignore this email. It will not reach the review queue. diff --git a/lib/who_need_help/support.ex b/lib/who_need_help/support.ex index befd757..8c52e8e 100644 --- a/lib/who_need_help/support.ex +++ b/lib/who_need_help/support.ex @@ -198,7 +198,7 @@ defmodule WhoNeedHelp.Support do def confirmation_url(%SupportRequest{} = request) do token = confirmation_token(request) - PublicAccess.url("/support/cases/#{request.id}/verify?token=#{URI.encode_www_form(token)}") + PublicAccess.url("/support/cases/#{request.id}/verify#token=#{URI.encode_www_form(token)}") end def paginate_for_staff(%Scope{user: user}, options \\ []) do diff --git a/lib/who_need_help/support/notifier.ex b/lib/who_need_help/support/notifier.ex index 4b21305..b46ef9d 100644 --- a/lib/who_need_help/support/notifier.ex +++ b/lib/who_need_help/support/notifier.ex @@ -12,7 +12,7 @@ defmodule WhoNeedHelp.Support.Notifier do """ Confirm the email address for support request #{request.reference}. - Your request has not been sent to the support queue yet. Open this private link to verify the address and submit it for review: + Your request has not been sent to the support queue yet. Open this private link, then press the confirmation button to verify the address and submit it for review: #{status_url} If you did not make this request, ignore this email. It will not reach the support queue. diff --git a/lib/who_need_help_web/controllers/content_removal_controller.ex b/lib/who_need_help_web/controllers/content_removal_controller.ex index 47951f7..46f1169 100644 --- a/lib/who_need_help_web/controllers/content_removal_controller.ex +++ b/lib/who_need_help_web/controllers/content_removal_controller.ex @@ -61,6 +61,21 @@ defmodule WhoNeedHelpWeb.ContentRemovalController do end end + def verify_page(conn, %{"id" => id}) do + case Ecto.UUID.cast(id) do + {:ok, _id} -> + render(conn, :verify, + notice_id: id, + page_title: gettext("Confirm content-removal notice") + ) + + :error -> + send_resp(conn, :not_found, "Not found") + end + end + + def verify_page(conn, _params), do: send_resp(conn, :not_found, "Not found") + def verify(conn, %{"id" => id, "token" => token}) do case ContentRemoval.verify_by_confirmation_token(id, token) do {:ok, notice} -> diff --git a/lib/who_need_help_web/controllers/content_removal_html/verify.html.heex b/lib/who_need_help_web/controllers/content_removal_html/verify.html.heex new file mode 100644 index 0000000..3776acd --- /dev/null +++ b/lib/who_need_help_web/controllers/content_removal_html/verify.html.heex @@ -0,0 +1,44 @@ + +
+ <.header> + {gettext("Confirm content-removal notice")} + <:subtitle> + {gettext("Confirm that you submitted this notice before it is sent for review.")} + + + + <.form + for={%{}} + action={~p"/legal/content-removal/#{@notice_id}/verify"} + id="content-removal-confirmation-fragment-form" + hidden + > + + <.button variant="primary" phx-disable-with={gettext("Confirming...")}> + {gettext("Confirm content-removal notice")} + + + +

+ {gettext( + "If you did not submit this notice, close this page. Nothing will be sent for review." + )} +

+ + +
+
diff --git a/lib/who_need_help_web/controllers/support_controller.ex b/lib/who_need_help_web/controllers/support_controller.ex index 04e6904..447750b 100644 --- a/lib/who_need_help_web/controllers/support_controller.ex +++ b/lib/who_need_help_web/controllers/support_controller.ex @@ -98,6 +98,21 @@ defmodule WhoNeedHelpWeb.SupportController do end end + def verify_page(conn, %{"id" => id}) do + case Ecto.UUID.cast(id) do + {:ok, _id} -> + render(conn, :verify, + request_id: id, + page_title: gettext("Confirm support request") + ) + + :error -> + send_resp(conn, :not_found, "Not found") + end + end + + def verify_page(conn, _params), do: send_resp(conn, :not_found, "Not found") + def verify(conn, %{"id" => id, "token" => token}) do case Support.verify_by_confirmation_token(id, token) do {:ok, request} -> diff --git a/lib/who_need_help_web/controllers/support_html/verify.html.heex b/lib/who_need_help_web/controllers/support_html/verify.html.heex new file mode 100644 index 0000000..91b42ba --- /dev/null +++ b/lib/who_need_help_web/controllers/support_html/verify.html.heex @@ -0,0 +1,39 @@ + +
+ <.header> + {gettext("Confirm support request")} + <:subtitle> + {gettext("Confirm that you submitted this request before it is sent to support.")} + + + + <.form + for={%{}} + action={~p"/support/cases/#{@request_id}/verify"} + id="support-confirmation-fragment-form" + hidden + > + + <.button variant="primary" phx-disable-with={gettext("Confirming...")}> + {gettext("Confirm support request")} + + + +

+ {gettext( + "If you did not submit this request, close this page. Nothing will be sent to support." + )} +

+ + +
+
diff --git a/lib/who_need_help_web/router.ex b/lib/who_need_help_web/router.ex index 32deadd..4a27ef0 100644 --- a/lib/who_need_help_web/router.ex +++ b/lib/who_need_help_web/router.ex @@ -97,7 +97,8 @@ defmodule WhoNeedHelpWeb.Router do get "/support/new", SupportController, :new post "/support", SupportController, :create get "/support/received", SupportController, :received - get "/support/cases/:id/verify", SupportController, :verify + get "/support/cases/:id/verify", SupportController, :verify_page + post "/support/cases/:id/verify", SupportController, :verify get "/support/cases/:id", SupportController, :show post "/support/cases/:id/messages", SupportController, :add_message post "/support/cases/:id/reopen", SupportController, :reopen @@ -167,7 +168,8 @@ defmodule WhoNeedHelpWeb.Router do scope "/", WhoNeedHelpWeb do pipe_through :browser - get "/legal/content-removal/:id/verify", ContentRemovalController, :verify + get "/legal/content-removal/:id/verify", ContentRemovalController, :verify_page + post "/legal/content-removal/:id/verify", ContentRemovalController, :verify get "/legal/content-removal/:id", ContentRemovalController, :show end diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index a83144a..83b5f7b 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -560,6 +560,8 @@ msgstr "" msgid "Confirm your email and ensure your account is active before publishing." msgstr "" +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:27 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:22 #: lib/who_need_help_web/controllers/user_session_html/new.html.heex:57 #: lib/who_need_help_web/controllers/user_session_html/new.html.heex:63 #: lib/who_need_help_web/controllers/user_settings_html/confirm_email.html.heex:20 @@ -2520,6 +2522,8 @@ msgstr "" msgid "Could not unblock this user. Please try again." msgstr "" +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:40 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:35 #: lib/who_need_help_web/controllers/user_settings_html/confirm_email.html.heex:27 #, elixir-autogen, elixir-format msgid "JavaScript is required to confirm this protected email link." @@ -3115,7 +3119,7 @@ msgid "Removal notice updated." msgstr "" #: lib/who_need_help_web/components/layouts.ex:201 -#: lib/who_need_help_web/controllers/content_removal_controller.ex:136 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:151 #: lib/who_need_help_web/controllers/support_html/new.html.heex:16 #, elixir-autogen, elixir-format msgid "Report content" @@ -3131,7 +3135,7 @@ msgstr "" msgid "Reported locations" msgstr "" -#: lib/who_need_help_web/controllers/support_controller.ex:226 +#: lib/who_need_help_web/controllers/support_controller.ex:241 #: lib/who_need_help_web/controllers/support_html/delete_account.html.heex:6 #: lib/who_need_help_web/controllers/support_html/delete_account.html.heex:42 #: lib/who_need_help_web/controllers/user_settings_html/edit.html.heex:128 @@ -3249,7 +3253,7 @@ msgstr "" msgid "TAKE IT DOWN" msgstr "" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:135 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:150 #: lib/who_need_help_web/controllers/support_html/new.html.heex:19 #, elixir-autogen, elixir-format msgid "TAKE IT DOWN request" @@ -3277,7 +3281,7 @@ msgstr "" msgid "Threat to life or safety" msgstr "" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:103 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:118 #, elixir-autogen, elixir-format msgid "Too many removal notices. Please try again later." msgstr "" @@ -5242,7 +5246,7 @@ msgid "Case status" msgstr "" #: lib/who_need_help_web/controllers/page_html/child_safety.html.heex:42 -#: lib/who_need_help_web/controllers/support_controller.ex:227 +#: lib/who_need_help_web/controllers/support_controller.ex:242 #: lib/who_need_help_web/live/report_live.ex:50 #, elixir-autogen, elixir-format msgid "Contact support" @@ -5253,7 +5257,7 @@ msgstr "" msgid "Content-removal notice %{reference}" msgstr "" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:111 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:126 #, elixir-autogen, elixir-format msgid "Content-removal notice received" msgstr "" @@ -5264,8 +5268,8 @@ msgstr "" msgid "Conversation" msgstr "" -#: lib/who_need_help_web/controllers/support_controller.ex:137 -#: lib/who_need_help_web/controllers/support_controller.ex:153 +#: lib/who_need_help_web/controllers/support_controller.ex:152 +#: lib/who_need_help_web/controllers/support_controller.ex:168 #: lib/who_need_help_web/live/support_case_live.ex:73 #, elixir-autogen, elixir-format msgid "Could not send your message. Please check it and try again." @@ -5328,7 +5332,7 @@ msgstr "" msgid "No status history is available for this older case." msgstr "" -#: lib/who_need_help_web/controllers/support_controller.ex:172 +#: lib/who_need_help_web/controllers/support_controller.ex:187 #: lib/who_need_help_web/live/support_case_live.ex:95 #, elixir-autogen, elixir-format msgid "Only a resolved or closed request can be reopened." @@ -5438,7 +5442,7 @@ msgstr "" msgid "Support request created" msgstr "" -#: lib/who_need_help_web/controllers/support_controller.ex:183 +#: lib/who_need_help_web/controllers/support_controller.ex:198 #, elixir-autogen, elixir-format msgid "Support request received" msgstr "" @@ -5474,7 +5478,7 @@ msgstr "" msgid "The requester states whether the medicine is paid, reserved, or still needs to be purchased." msgstr "" -#: lib/who_need_help_web/controllers/support_controller.ex:167 +#: lib/who_need_help_web/controllers/support_controller.ex:182 #: lib/who_need_help_web/live/support_case_live.ex:88 #, elixir-autogen, elixir-format msgid "The support request is open again." @@ -5502,7 +5506,7 @@ msgstr "" msgid "This support request is no longer available." msgstr "" -#: lib/who_need_help_web/controllers/support_controller.ex:143 +#: lib/who_need_help_web/controllers/support_controller.ex:158 #: lib/who_need_help_web/live/support_case_live.ex:60 #, elixir-autogen, elixir-format msgid "Too many messages. Please try again later." @@ -5539,7 +5543,7 @@ msgstr "" msgid "Your content-removal notices" msgstr "" -#: lib/who_need_help_web/controllers/support_controller.ex:130 +#: lib/who_need_help_web/controllers/support_controller.ex:145 #: lib/who_need_help_web/live/support_case_live.ex:53 #, elixir-autogen, elixir-format msgid "Your message was sent to support." @@ -7677,12 +7681,12 @@ msgstr "" msgid "You do not have permission for this action. Role changes also require a recent sign-in." msgstr "" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:70 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:85 #, elixir-autogen, elixir-format msgid "Your email was confirmed and the notice was sent for review." msgstr "" -#: lib/who_need_help_web/controllers/support_controller.ex:107 +#: lib/who_need_help_web/controllers/support_controller.ex:122 #, elixir-autogen, elixir-format msgid "Your email was confirmed and the request was sent to support." msgstr "" @@ -7872,3 +7876,37 @@ msgstr "" #, elixir-autogen, elixir-format msgid "Copy and paste this secure address into your browser:" msgstr "" + +#: lib/who_need_help_web/controllers/content_removal_controller.ex:69 +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:9 +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:28 +#, elixir-autogen, elixir-format +msgid "Confirm content-removal notice" +msgstr "" + +#: lib/who_need_help_web/controllers/support_controller.ex:106 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:9 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:23 +#, elixir-autogen, elixir-format +msgid "Confirm support request" +msgstr "" + +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:11 +#, elixir-autogen, elixir-format +msgid "Confirm that you submitted this notice before it is sent for review." +msgstr "" + +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:11 +#, elixir-autogen, elixir-format +msgid "Confirm that you submitted this request before it is sent to support." +msgstr "" + +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:33 +#, elixir-autogen, elixir-format +msgid "If you did not submit this notice, close this page. Nothing will be sent for review." +msgstr "" + +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:28 +#, elixir-autogen, elixir-format +msgid "If you did not submit this request, close this page. Nothing will be sent to support." +msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index 600755f..c723310 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -49,7 +49,7 @@ msgstr "Categories" #: lib/who_need_help_web/components/layouts.ex:95 #: lib/who_need_help_web/components/layouts.ex:168 #: lib/who_need_help_web/controllers/user_registration_html/new.html.heex:14 -#: lib/who_need_help_web/controllers/user_session_controller.ex:215 +#: lib/who_need_help_web/controllers/user_session_controller.ex:225 #: lib/who_need_help_web/controllers/user_session_html/new.html.heex:10 #, elixir-autogen, elixir-format msgid "Log in" @@ -560,6 +560,8 @@ msgstr "Confirm your account and ensure it is active first." msgid "Confirm your email and ensure your account is active before publishing." msgstr "Confirm your email and ensure your account is active before publishing." +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:27 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:22 #: lib/who_need_help_web/controllers/user_session_html/new.html.heex:57 #: lib/who_need_help_web/controllers/user_session_html/new.html.heex:63 #: lib/who_need_help_web/controllers/user_settings_html/confirm_email.html.heex:20 @@ -2520,6 +2522,8 @@ msgstr "Could not publish the request. Please try again." msgid "Could not unblock this user. Please try again." msgstr "Could not unblock this user. Please try again." +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:40 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:35 #: lib/who_need_help_web/controllers/user_settings_html/confirm_email.html.heex:27 #, elixir-autogen, elixir-format msgid "JavaScript is required to confirm this protected email link." @@ -3115,7 +3119,7 @@ msgid "Removal notice updated." msgstr "Removal notice updated." #: lib/who_need_help_web/components/layouts.ex:201 -#: lib/who_need_help_web/controllers/content_removal_controller.ex:136 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:151 #: lib/who_need_help_web/controllers/support_html/new.html.heex:16 #, elixir-autogen, elixir-format msgid "Report content" @@ -3131,7 +3135,7 @@ msgstr "Report illegal or harmful content" msgid "Reported locations" msgstr "Reported locations" -#: lib/who_need_help_web/controllers/support_controller.ex:226 +#: lib/who_need_help_web/controllers/support_controller.ex:241 #: lib/who_need_help_web/controllers/support_html/delete_account.html.heex:6 #: lib/who_need_help_web/controllers/support_html/delete_account.html.heex:42 #: lib/who_need_help_web/controllers/user_settings_html/edit.html.heex:128 @@ -3249,7 +3253,7 @@ msgstr "Support request updated." msgid "TAKE IT DOWN" msgstr "TAKE IT DOWN" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:135 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:150 #: lib/who_need_help_web/controllers/support_html/new.html.heex:19 #, elixir-autogen, elixir-format msgid "TAKE IT DOWN request" @@ -3277,7 +3281,7 @@ msgstr "This requests deletion of your Who Need Help account and associated pers msgid "Threat to life or safety" msgstr "Threat to life or safety" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:103 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:118 #, elixir-autogen, elixir-format msgid "Too many removal notices. Please try again later." msgstr "Too many removal notices. Please try again later." @@ -3757,7 +3761,7 @@ msgstr "Creating account..." msgid "Email me a verification link" msgstr "Email me a verification link" -#: lib/who_need_help_web/controllers/user_session_controller.ex:183 +#: lib/who_need_help_web/controllers/user_session_controller.ex:193 #, elixir-autogen, elixir-format msgid "Google sign-in connected. You can use it next time." msgstr "Google sign-in connected. You can use it next time." @@ -3809,7 +3813,7 @@ msgstr "Verified" msgid "We sent a verification link to %{email}. Open it to finish connecting Google." msgstr "We sent a verification link to %{email}. Open it to finish connecting Google." -#: lib/who_need_help_web/controllers/user_session_controller.ex:196 +#: lib/who_need_help_web/controllers/user_session_controller.ex:206 #, elixir-autogen, elixir-format msgid "You are signed in, but Google could not be connected. Try again in account settings." msgstr "You are signed in, but Google could not be connected. Try again in account settings." @@ -5242,7 +5246,7 @@ msgid "Case status" msgstr "Case status" #: lib/who_need_help_web/controllers/page_html/child_safety.html.heex:42 -#: lib/who_need_help_web/controllers/support_controller.ex:227 +#: lib/who_need_help_web/controllers/support_controller.ex:242 #: lib/who_need_help_web/live/report_live.ex:50 #, elixir-autogen, elixir-format msgid "Contact support" @@ -5253,7 +5257,7 @@ msgstr "Contact support" msgid "Content-removal notice %{reference}" msgstr "Content-removal notice %{reference}" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:111 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:126 #, elixir-autogen, elixir-format msgid "Content-removal notice received" msgstr "Content-removal notice received" @@ -5264,8 +5268,8 @@ msgstr "Content-removal notice received" msgid "Conversation" msgstr "Conversation" -#: lib/who_need_help_web/controllers/support_controller.ex:137 -#: lib/who_need_help_web/controllers/support_controller.ex:153 +#: lib/who_need_help_web/controllers/support_controller.ex:152 +#: lib/who_need_help_web/controllers/support_controller.ex:168 #: lib/who_need_help_web/live/support_case_live.ex:73 #, elixir-autogen, elixir-format msgid "Could not send your message. Please check it and try again." @@ -5328,7 +5332,7 @@ msgstr "No reports submitted" msgid "No status history is available for this older case." msgstr "No status history is available for this older case." -#: lib/who_need_help_web/controllers/support_controller.ex:172 +#: lib/who_need_help_web/controllers/support_controller.ex:187 #: lib/who_need_help_web/live/support_case_live.ex:95 #, elixir-autogen, elixir-format msgid "Only a resolved or closed request can be reopened." @@ -5438,7 +5442,7 @@ msgstr "Status history" msgid "Support request created" msgstr "Support request created" -#: lib/who_need_help_web/controllers/support_controller.ex:183 +#: lib/who_need_help_web/controllers/support_controller.ex:198 #, elixir-autogen, elixir-format msgid "Support request received" msgstr "Support request received" @@ -5474,7 +5478,7 @@ msgstr "TRUST AND SAFETY" msgid "The requester states whether the medicine is paid, reserved, or still needs to be purchased." msgstr "The requester states whether the medicine is paid, reserved, or still needs to be purchased." -#: lib/who_need_help_web/controllers/support_controller.ex:167 +#: lib/who_need_help_web/controllers/support_controller.ex:182 #: lib/who_need_help_web/live/support_case_live.ex:88 #, elixir-autogen, elixir-format msgid "The support request is open again." @@ -5502,7 +5506,7 @@ msgstr "This private history shows reports you submitted and the latest moderati msgid "This support request is no longer available." msgstr "This support request is no longer available." -#: lib/who_need_help_web/controllers/support_controller.ex:143 +#: lib/who_need_help_web/controllers/support_controller.ex:158 #: lib/who_need_help_web/live/support_case_live.ex:60 #, elixir-autogen, elixir-format msgid "Too many messages. Please try again later." @@ -5539,7 +5543,7 @@ msgstr "You" msgid "Your content-removal notices" msgstr "Your content-removal notices" -#: lib/who_need_help_web/controllers/support_controller.ex:130 +#: lib/who_need_help_web/controllers/support_controller.ex:145 #: lib/who_need_help_web/live/support_case_live.ex:53 #, elixir-autogen, elixir-format msgid "Your message was sent to support." @@ -7677,12 +7681,12 @@ msgstr "You do not have permission for this action." msgid "You do not have permission for this action. Role changes also require a recent sign-in." msgstr "You do not have permission for this action. Role changes also require a recent sign-in." -#: lib/who_need_help_web/controllers/content_removal_controller.ex:70 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:85 #, elixir-autogen, elixir-format msgid "Your email was confirmed and the notice was sent for review." msgstr "Your email was confirmed and the notice was sent for review." -#: lib/who_need_help_web/controllers/support_controller.ex:107 +#: lib/who_need_help_web/controllers/support_controller.ex:122 #, elixir-autogen, elixir-format msgid "Your email was confirmed and the request was sent to support." msgstr "Your email was confirmed and the request was sent to support." @@ -7872,3 +7876,37 @@ msgstr "Enable Android notifications" #, elixir-autogen, elixir-format msgid "Copy and paste this secure address into your browser:" msgstr "Copy and paste this secure address into your browser:" + +#: lib/who_need_help_web/controllers/content_removal_controller.ex:69 +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:9 +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:28 +#, elixir-autogen, elixir-format +msgid "Confirm content-removal notice" +msgstr "Confirm content-removal notice" + +#: lib/who_need_help_web/controllers/support_controller.ex:106 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:9 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:23 +#, elixir-autogen, elixir-format +msgid "Confirm support request" +msgstr "Confirm support request" + +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:11 +#, elixir-autogen, elixir-format +msgid "Confirm that you submitted this notice before it is sent for review." +msgstr "Confirm that you submitted this notice before it is sent for review." + +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:11 +#, elixir-autogen, elixir-format +msgid "Confirm that you submitted this request before it is sent to support." +msgstr "Confirm that you submitted this request before it is sent to support." + +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:33 +#, elixir-autogen, elixir-format +msgid "If you did not submit this notice, close this page. Nothing will be sent for review." +msgstr "If you did not submit this notice, close this page. Nothing will be sent for review." + +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:28 +#, elixir-autogen, elixir-format +msgid "If you did not submit this request, close this page. Nothing will be sent to support." +msgstr "If you did not submit this request, close this page. Nothing will be sent to support." diff --git a/priv/gettext/ru/LC_MESSAGES/default.po b/priv/gettext/ru/LC_MESSAGES/default.po index f3fcd76..403dd88 100644 --- a/priv/gettext/ru/LC_MESSAGES/default.po +++ b/priv/gettext/ru/LC_MESSAGES/default.po @@ -49,7 +49,7 @@ msgstr "Категории" #: lib/who_need_help_web/components/layouts.ex:95 #: lib/who_need_help_web/components/layouts.ex:168 #: lib/who_need_help_web/controllers/user_registration_html/new.html.heex:14 -#: lib/who_need_help_web/controllers/user_session_controller.ex:215 +#: lib/who_need_help_web/controllers/user_session_controller.ex:225 #: lib/who_need_help_web/controllers/user_session_html/new.html.heex:10 #, elixir-autogen, elixir-format msgid "Log in" @@ -580,6 +580,8 @@ msgstr "" "Перед публикацией подтвердите электронную почту и убедитесь, что учётная " "запись активна." +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:27 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:22 #: lib/who_need_help_web/controllers/user_session_html/new.html.heex:57 #: lib/who_need_help_web/controllers/user_session_html/new.html.heex:63 #: lib/who_need_help_web/controllers/user_settings_html/confirm_email.html.heex:20 @@ -2636,6 +2638,8 @@ msgstr "Не удалось опубликовать заявку. Попроб msgid "Could not unblock this user. Please try again." msgstr "Не удалось разблокировать пользователя. Попробуйте ещё раз." +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:40 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:35 #: lib/who_need_help_web/controllers/user_settings_html/confirm_email.html.heex:27 #, elixir-autogen, elixir-format msgid "JavaScript is required to confirm this protected email link." @@ -3231,7 +3235,7 @@ msgid "Removal notice updated." msgstr "Уведомление об удалении обновлено." #: lib/who_need_help_web/components/layouts.ex:201 -#: lib/who_need_help_web/controllers/content_removal_controller.ex:136 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:151 #: lib/who_need_help_web/controllers/support_html/new.html.heex:16 #, elixir-autogen, elixir-format msgid "Report content" @@ -3247,7 +3251,7 @@ msgstr "Сообщить о незаконном или вредоносном msgid "Reported locations" msgstr "Указанные адреса контента" -#: lib/who_need_help_web/controllers/support_controller.ex:226 +#: lib/who_need_help_web/controllers/support_controller.ex:241 #: lib/who_need_help_web/controllers/support_html/delete_account.html.heex:6 #: lib/who_need_help_web/controllers/support_html/delete_account.html.heex:42 #: lib/who_need_help_web/controllers/user_settings_html/edit.html.heex:128 @@ -3365,7 +3369,7 @@ msgstr "Обращение в поддержку обновлено." msgid "TAKE IT DOWN" msgstr "TAKE IT DOWN" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:135 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:150 #: lib/who_need_help_web/controllers/support_html/new.html.heex:19 #, elixir-autogen, elixir-format msgid "TAKE IT DOWN request" @@ -3393,7 +3397,7 @@ msgstr "Это запрос на удаление аккаунта Who Need Help msgid "Threat to life or safety" msgstr "Угроза жизни или безопасности" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:103 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:118 #, elixir-autogen, elixir-format msgid "Too many removal notices. Please try again later." msgstr "Слишком много уведомлений об удалении. Повторите попытку позже." @@ -3873,7 +3877,7 @@ msgstr "Создаём аккаунт..." msgid "Email me a verification link" msgstr "Отправить ссылку для подтверждения на email" -#: lib/who_need_help_web/controllers/user_session_controller.ex:183 +#: lib/who_need_help_web/controllers/user_session_controller.ex:193 #, elixir-autogen, elixir-format msgid "Google sign-in connected. You can use it next time." msgstr "Вход через Google подключён. В следующий раз можно использовать его." @@ -3925,7 +3929,7 @@ msgstr "Подтверждено" msgid "We sent a verification link to %{email}. Open it to finish connecting Google." msgstr "Мы отправили ссылку для подтверждения на %{email}. Откройте её, чтобы завершить подключение Google." -#: lib/who_need_help_web/controllers/user_session_controller.ex:196 +#: lib/who_need_help_web/controllers/user_session_controller.ex:206 #, elixir-autogen, elixir-format msgid "You are signed in, but Google could not be connected. Try again in account settings." msgstr "Вы вошли, но подключить Google не удалось. Повторите попытку в настройках аккаунта." @@ -5359,7 +5363,7 @@ msgid "Case status" msgstr "Статус обращения" #: lib/who_need_help_web/controllers/page_html/child_safety.html.heex:42 -#: lib/who_need_help_web/controllers/support_controller.ex:227 +#: lib/who_need_help_web/controllers/support_controller.ex:242 #: lib/who_need_help_web/live/report_live.ex:50 #, elixir-autogen, elixir-format msgid "Contact support" @@ -5370,7 +5374,7 @@ msgstr "Обратиться в поддержку" msgid "Content-removal notice %{reference}" msgstr "Уведомление об удалении контента %{reference}" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:111 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:126 #, elixir-autogen, elixir-format msgid "Content-removal notice received" msgstr "Уведомление об удалении контента получено" @@ -5381,8 +5385,8 @@ msgstr "Уведомление об удалении контента получ msgid "Conversation" msgstr "Переписка" -#: lib/who_need_help_web/controllers/support_controller.ex:137 -#: lib/who_need_help_web/controllers/support_controller.ex:153 +#: lib/who_need_help_web/controllers/support_controller.ex:152 +#: lib/who_need_help_web/controllers/support_controller.ex:168 #: lib/who_need_help_web/live/support_case_live.ex:73 #, elixir-autogen, elixir-format msgid "Could not send your message. Please check it and try again." @@ -5445,7 +5449,7 @@ msgstr "Жалоб не отправлено" msgid "No status history is available for this older case." msgstr "Для этого старого обращения история статусов недоступна." -#: lib/who_need_help_web/controllers/support_controller.ex:172 +#: lib/who_need_help_web/controllers/support_controller.ex:187 #: lib/who_need_help_web/live/support_case_live.ex:95 #, elixir-autogen, elixir-format msgid "Only a resolved or closed request can be reopened." @@ -5555,7 +5559,7 @@ msgstr "История статусов" msgid "Support request created" msgstr "Обращение в поддержку создано" -#: lib/who_need_help_web/controllers/support_controller.ex:183 +#: lib/who_need_help_web/controllers/support_controller.ex:198 #, elixir-autogen, elixir-format msgid "Support request received" msgstr "Обращение в поддержку получено" @@ -5591,7 +5595,7 @@ msgstr "ДОВЕРИЕ И БЕЗОПАСНОСТЬ" msgid "The requester states whether the medicine is paid, reserved, or still needs to be purchased." msgstr "Автор заявки указывает, оплачено ли лекарство, зарезервировано или его ещё нужно купить." -#: lib/who_need_help_web/controllers/support_controller.ex:167 +#: lib/who_need_help_web/controllers/support_controller.ex:182 #: lib/who_need_help_web/live/support_case_live.ex:88 #, elixir-autogen, elixir-format msgid "The support request is open again." @@ -5619,7 +5623,7 @@ msgstr "В этой личной истории показаны ваши жал msgid "This support request is no longer available." msgstr "Это обращение в поддержку больше недоступно." -#: lib/who_need_help_web/controllers/support_controller.ex:143 +#: lib/who_need_help_web/controllers/support_controller.ex:158 #: lib/who_need_help_web/live/support_case_live.ex:60 #, elixir-autogen, elixir-format msgid "Too many messages. Please try again later." @@ -5656,7 +5660,7 @@ msgstr "Вы" msgid "Your content-removal notices" msgstr "Ваши уведомления об удалении контента" -#: lib/who_need_help_web/controllers/support_controller.ex:130 +#: lib/who_need_help_web/controllers/support_controller.ex:145 #: lib/who_need_help_web/live/support_case_live.ex:53 #, elixir-autogen, elixir-format msgid "Your message was sent to support." @@ -7797,12 +7801,12 @@ msgstr "У вас нет разрешения на это действие." msgid "You do not have permission for this action. Role changes also require a recent sign-in." msgstr "У вас нет разрешения на это действие. Для изменения ролей также требуется недавний вход." -#: lib/who_need_help_web/controllers/content_removal_controller.ex:70 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:85 #, elixir-autogen, elixir-format msgid "Your email was confirmed and the notice was sent for review." msgstr "Ваш email подтверждён, уведомление отправлено на проверку." -#: lib/who_need_help_web/controllers/support_controller.ex:107 +#: lib/who_need_help_web/controllers/support_controller.ex:122 #, elixir-autogen, elixir-format msgid "Your email was confirmed and the request was sent to support." msgstr "Ваш email подтверждён, обращение отправлено в поддержку." @@ -7992,3 +7996,37 @@ msgstr "Включить уведомления Android" #, elixir-autogen, elixir-format msgid "Copy and paste this secure address into your browser:" msgstr "Скопируйте этот безопасный адрес и вставьте его в браузер:" + +#: lib/who_need_help_web/controllers/content_removal_controller.ex:69 +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:9 +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:28 +#, elixir-autogen, elixir-format +msgid "Confirm content-removal notice" +msgstr "Подтвердить уведомление об удалении контента" + +#: lib/who_need_help_web/controllers/support_controller.ex:106 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:9 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:23 +#, elixir-autogen, elixir-format +msgid "Confirm support request" +msgstr "Подтвердить обращение в поддержку" + +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:11 +#, elixir-autogen, elixir-format +msgid "Confirm that you submitted this notice before it is sent for review." +msgstr "Подтвердите, что это уведомление отправили вы, прежде чем оно поступит на рассмотрение." + +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:11 +#, elixir-autogen, elixir-format +msgid "Confirm that you submitted this request before it is sent to support." +msgstr "Подтвердите, что это обращение отправили вы, прежде чем оно поступит в поддержку." + +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:33 +#, elixir-autogen, elixir-format +msgid "If you did not submit this notice, close this page. Nothing will be sent for review." +msgstr "Если вы не отправляли это уведомление, закройте страницу. На рассмотрение ничего не поступит." + +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:28 +#, elixir-autogen, elixir-format +msgid "If you did not submit this request, close this page. Nothing will be sent to support." +msgstr "Если вы не отправляли это обращение, закройте страницу. В поддержку ничего не поступит." diff --git a/priv/gettext/uk/LC_MESSAGES/default.po b/priv/gettext/uk/LC_MESSAGES/default.po index d292c36..17fea4c 100644 --- a/priv/gettext/uk/LC_MESSAGES/default.po +++ b/priv/gettext/uk/LC_MESSAGES/default.po @@ -49,7 +49,7 @@ msgstr "Категорії" #: lib/who_need_help_web/components/layouts.ex:95 #: lib/who_need_help_web/components/layouts.ex:168 #: lib/who_need_help_web/controllers/user_registration_html/new.html.heex:14 -#: lib/who_need_help_web/controllers/user_session_controller.ex:215 +#: lib/who_need_help_web/controllers/user_session_controller.ex:225 #: lib/who_need_help_web/controllers/user_session_html/new.html.heex:10 #, elixir-autogen, elixir-format msgid "Log in" @@ -581,6 +581,8 @@ msgstr "" "Перед публікацією підтвердьте електронну пошту й переконайтеся, що обліковий" " запис активний." +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:27 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:22 #: lib/who_need_help_web/controllers/user_session_html/new.html.heex:57 #: lib/who_need_help_web/controllers/user_session_html/new.html.heex:63 #: lib/who_need_help_web/controllers/user_settings_html/confirm_email.html.heex:20 @@ -2630,6 +2632,8 @@ msgstr "Не вдалося опублікувати заявку. Спробу msgid "Could not unblock this user. Please try again." msgstr "Не вдалося розблокувати користувача. Спробуйте ще раз." +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:40 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:35 #: lib/who_need_help_web/controllers/user_settings_html/confirm_email.html.heex:27 #, elixir-autogen, elixir-format msgid "JavaScript is required to confirm this protected email link." @@ -3225,7 +3229,7 @@ msgid "Removal notice updated." msgstr "Повідомлення про видалення оновлено." #: lib/who_need_help_web/components/layouts.ex:201 -#: lib/who_need_help_web/controllers/content_removal_controller.ex:136 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:151 #: lib/who_need_help_web/controllers/support_html/new.html.heex:16 #, elixir-autogen, elixir-format msgid "Report content" @@ -3241,7 +3245,7 @@ msgstr "Повідомити про незаконний або шкідливи msgid "Reported locations" msgstr "Указані адреси контенту" -#: lib/who_need_help_web/controllers/support_controller.ex:226 +#: lib/who_need_help_web/controllers/support_controller.ex:241 #: lib/who_need_help_web/controllers/support_html/delete_account.html.heex:6 #: lib/who_need_help_web/controllers/support_html/delete_account.html.heex:42 #: lib/who_need_help_web/controllers/user_settings_html/edit.html.heex:128 @@ -3359,7 +3363,7 @@ msgstr "Звернення до підтримки оновлено." msgid "TAKE IT DOWN" msgstr "TAKE IT DOWN" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:135 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:150 #: lib/who_need_help_web/controllers/support_html/new.html.heex:19 #, elixir-autogen, elixir-format msgid "TAKE IT DOWN request" @@ -3387,7 +3391,7 @@ msgstr "Це запит на видалення облікового запис msgid "Threat to life or safety" msgstr "Загроза життю або безпеці" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:103 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:118 #, elixir-autogen, elixir-format msgid "Too many removal notices. Please try again later." msgstr "Забагато повідомлень про видалення. Спробуйте пізніше." @@ -3867,7 +3871,7 @@ msgstr "Створюємо обліковий запис..." msgid "Email me a verification link" msgstr "Надіслати посилання для підтвердження на email" -#: lib/who_need_help_web/controllers/user_session_controller.ex:183 +#: lib/who_need_help_web/controllers/user_session_controller.ex:193 #, elixir-autogen, elixir-format msgid "Google sign-in connected. You can use it next time." msgstr "Вхід через Google підключено. Наступного разу можна скористатися ним." @@ -3919,7 +3923,7 @@ msgstr "Підтверджено" msgid "We sent a verification link to %{email}. Open it to finish connecting Google." msgstr "Ми надіслали посилання для підтвердження на %{email}. Відкрийте його, щоб завершити підключення Google." -#: lib/who_need_help_web/controllers/user_session_controller.ex:196 +#: lib/who_need_help_web/controllers/user_session_controller.ex:206 #, elixir-autogen, elixir-format msgid "You are signed in, but Google could not be connected. Try again in account settings." msgstr "Ви ввійшли, але підключити Google не вдалося. Повторіть спробу в налаштуваннях облікового запису." @@ -5353,7 +5357,7 @@ msgid "Case status" msgstr "Статус звернення" #: lib/who_need_help_web/controllers/page_html/child_safety.html.heex:42 -#: lib/who_need_help_web/controllers/support_controller.ex:227 +#: lib/who_need_help_web/controllers/support_controller.ex:242 #: lib/who_need_help_web/live/report_live.ex:50 #, elixir-autogen, elixir-format msgid "Contact support" @@ -5364,7 +5368,7 @@ msgstr "Звернутися до підтримки" msgid "Content-removal notice %{reference}" msgstr "Повідомлення про видалення контенту %{reference}" -#: lib/who_need_help_web/controllers/content_removal_controller.ex:111 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:126 #, elixir-autogen, elixir-format msgid "Content-removal notice received" msgstr "Повідомлення про видалення контенту отримано" @@ -5375,8 +5379,8 @@ msgstr "Повідомлення про видалення контенту от msgid "Conversation" msgstr "Розмова" -#: lib/who_need_help_web/controllers/support_controller.ex:137 -#: lib/who_need_help_web/controllers/support_controller.ex:153 +#: lib/who_need_help_web/controllers/support_controller.ex:152 +#: lib/who_need_help_web/controllers/support_controller.ex:168 #: lib/who_need_help_web/live/support_case_live.ex:73 #, elixir-autogen, elixir-format msgid "Could not send your message. Please check it and try again." @@ -5439,7 +5443,7 @@ msgstr "Скарг не подано" msgid "No status history is available for this older case." msgstr "Для цього старого звернення історія статусів недоступна." -#: lib/who_need_help_web/controllers/support_controller.ex:172 +#: lib/who_need_help_web/controllers/support_controller.ex:187 #: lib/who_need_help_web/live/support_case_live.ex:95 #, elixir-autogen, elixir-format msgid "Only a resolved or closed request can be reopened." @@ -5549,7 +5553,7 @@ msgstr "Історія статусів" msgid "Support request created" msgstr "Звернення до підтримки створено" -#: lib/who_need_help_web/controllers/support_controller.ex:183 +#: lib/who_need_help_web/controllers/support_controller.ex:198 #, elixir-autogen, elixir-format msgid "Support request received" msgstr "Звернення до підтримки отримано" @@ -5585,7 +5589,7 @@ msgstr "ДОВІРА ТА БЕЗПЕКА" msgid "The requester states whether the medicine is paid, reserved, or still needs to be purchased." msgstr "Автор заявки вказує, чи ліки вже оплачені, зарезервовані або їх ще потрібно придбати." -#: lib/who_need_help_web/controllers/support_controller.ex:167 +#: lib/who_need_help_web/controllers/support_controller.ex:182 #: lib/who_need_help_web/live/support_case_live.ex:88 #, elixir-autogen, elixir-format msgid "The support request is open again." @@ -5613,7 +5617,7 @@ msgstr "У цій приватній історії показано ваші с msgid "This support request is no longer available." msgstr "Це звернення до підтримки більше не доступне." -#: lib/who_need_help_web/controllers/support_controller.ex:143 +#: lib/who_need_help_web/controllers/support_controller.ex:158 #: lib/who_need_help_web/live/support_case_live.ex:60 #, elixir-autogen, elixir-format msgid "Too many messages. Please try again later." @@ -5650,7 +5654,7 @@ msgstr "Ви" msgid "Your content-removal notices" msgstr "Ваші повідомлення про видалення контенту" -#: lib/who_need_help_web/controllers/support_controller.ex:130 +#: lib/who_need_help_web/controllers/support_controller.ex:145 #: lib/who_need_help_web/live/support_case_live.ex:53 #, elixir-autogen, elixir-format msgid "Your message was sent to support." @@ -7791,12 +7795,12 @@ msgstr "У вас немає дозволу на цю дію." msgid "You do not have permission for this action. Role changes also require a recent sign-in." msgstr "У вас немає дозволу на цю дію. Для зміни ролей також потрібен нещодавній вхід." -#: lib/who_need_help_web/controllers/content_removal_controller.ex:70 +#: lib/who_need_help_web/controllers/content_removal_controller.ex:85 #, elixir-autogen, elixir-format msgid "Your email was confirmed and the notice was sent for review." msgstr "Ваш email підтверджено, повідомлення надіслано на перевірку." -#: lib/who_need_help_web/controllers/support_controller.ex:107 +#: lib/who_need_help_web/controllers/support_controller.ex:122 #, elixir-autogen, elixir-format msgid "Your email was confirmed and the request was sent to support." msgstr "Ваш email підтверджено, звернення надіслано до підтримки." @@ -7986,3 +7990,37 @@ msgstr "Увімкнути сповіщення Android" #, elixir-autogen, elixir-format msgid "Copy and paste this secure address into your browser:" msgstr "Скопіюйте цю безпечну адресу та вставте її у браузер:" + +#: lib/who_need_help_web/controllers/content_removal_controller.ex:69 +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:9 +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:28 +#, elixir-autogen, elixir-format +msgid "Confirm content-removal notice" +msgstr "Підтвердити повідомлення про видалення контенту" + +#: lib/who_need_help_web/controllers/support_controller.ex:106 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:9 +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:23 +#, elixir-autogen, elixir-format +msgid "Confirm support request" +msgstr "Підтвердити звернення до підтримки" + +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:11 +#, elixir-autogen, elixir-format +msgid "Confirm that you submitted this notice before it is sent for review." +msgstr "Підтвердьте, що це повідомлення надіслали ви, перш ніж воно надійде на розгляд." + +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:11 +#, elixir-autogen, elixir-format +msgid "Confirm that you submitted this request before it is sent to support." +msgstr "Підтвердьте, що це звернення надіслали ви, перш ніж воно надійде до підтримки." + +#: lib/who_need_help_web/controllers/content_removal_html/verify.html.heex:33 +#, elixir-autogen, elixir-format +msgid "If you did not submit this notice, close this page. Nothing will be sent for review." +msgstr "Якщо ви не надсилали це повідомлення, закрийте сторінку. На розгляд нічого не надійде." + +#: lib/who_need_help_web/controllers/support_html/verify.html.heex:28 +#, elixir-autogen, elixir-format +msgid "If you did not submit this request, close this page. Nothing will be sent to support." +msgstr "Якщо ви не надсилали це звернення, закрийте сторінку. До підтримки нічого не надійде." diff --git a/test/who_need_help/support_and_content_removal_test.exs b/test/who_need_help/support_and_content_removal_test.exs index 0e06c86..7a39124 100644 --- a/test/who_need_help/support_and_content_removal_test.exs +++ b/test/who_need_help/support_and_content_removal_test.exs @@ -47,7 +47,8 @@ defmodule WhoNeedHelp.SupportAndContentRemovalTest do assert_email_sent(fn email -> matches_request = email.subject =~ request.reference and - email.text_body =~ "/support/cases/#{request.id}/verify?token=" + email.text_body =~ "/support/cases/#{request.id}/verify#token=" and + not String.contains?(email.text_body, "/verify?token=") if matches_request, do: send(test_pid, {:support_acknowledgement, email}) matches_request @@ -57,14 +58,14 @@ defmodule WhoNeedHelp.SupportAndContentRemovalTest do [confirmation_url] = Regex.run( - ~r{https?://[^\s]+/support/cases/#{Regex.escape(request.id)}/verify\?token=[^\s]+}, + ~r{https?://[^\s]+/support/cases/#{Regex.escape(request.id)}/verify#token=[^\s]+}, email.text_body ) confirmation_token = confirmation_url |> URI.parse() - |> Map.fetch!(:query) + |> Map.fetch!(:fragment) |> URI.decode_query() |> Map.fetch!("token") @@ -657,7 +658,9 @@ defmodule WhoNeedHelp.SupportAndContentRemovalTest do assert_email_sent(fn email -> email.subject =~ "Confirm Who Need Help removal notice" and email.text_body =~ notice.reference and - email.text_body =~ "has not been added to the staff review queue yet" + email.text_body =~ "has not been added to the staff review queue yet" and + email.text_body =~ "/legal/content-removal/#{notice.id}/verify#token=" and + not String.contains?(email.text_body, "/verify?token=") end) moderator_scope = moderator_scope() diff --git a/test/who_need_help_web/controllers/support_controller_test.exs b/test/who_need_help_web/controllers/support_controller_test.exs index 6a218e2..eaa0eba 100644 --- a/test/who_need_help_web/controllers/support_controller_test.exs +++ b/test/who_need_help_web/controllers/support_controller_test.exs @@ -171,7 +171,7 @@ defmodule WhoNeedHelpWeb.SupportControllerTest do assert_email_sent() end - test "confirmation endpoints exchange short-lived confirmation links for status links", %{ + test "confirmation pages require an explicit POST before exposing cases to staff", %{ conn: conn } do assert {:ok, support_request} = @@ -183,10 +183,37 @@ defmodule WhoNeedHelpWeb.SupportControllerTest do "The confirmation endpoint must redirect to a separate private status link." }) - support_conn = + support_token = WhoNeedHelp.Support.confirmation_token(support_request) + + support_page = get( conn, - ~p"/support/cases/#{support_request.id}/verify?token=#{WhoNeedHelp.Support.confirmation_token(support_request)}" + ~p"/support/cases/#{support_request.id}/verify?token=#{support_token}" + ) + + support_html = html_response(support_page, 200) + assert support_html =~ "Confirm support request" + assert support_html =~ ~s(id="support-confirmation-fragment-form") + assert support_html =~ ~s(id="support-confirmation-fragment-token") + refute support_html =~ support_token + refute Repo.get!(SupportRequest, support_request.id).contact_verified_at + + assert response( + post( + recycle(support_page), + ~p"/support/cases/#{support_request.id}/verify", + %{} + ), + 404 + ) + + refute Repo.get!(SupportRequest, support_request.id).contact_verified_at + + support_conn = + post( + recycle(support_page), + ~p"/support/cases/#{support_request.id}/verify", + %{"token" => support_token} ) support_location = redirected_to(support_conn) @@ -208,11 +235,25 @@ defmodule WhoNeedHelpWeb.SupportControllerTest do "accurate_complete" => "true" }) - removal_conn = + removal_token = WhoNeedHelp.ContentRemoval.confirmation_token(removal_notice) + + removal_page = conn |> recycle() - |> get( - ~p"/legal/content-removal/#{removal_notice.id}/verify?token=#{WhoNeedHelp.ContentRemoval.confirmation_token(removal_notice)}" + |> get(~p"/legal/content-removal/#{removal_notice.id}/verify?token=#{removal_token}") + + removal_html = html_response(removal_page, 200) + assert removal_html =~ "Confirm content-removal notice" + assert removal_html =~ ~s(id="content-removal-confirmation-fragment-form") + assert removal_html =~ ~s(id="content-removal-confirmation-fragment-token") + refute removal_html =~ removal_token + refute Repo.get!(WhoNeedHelp.ContentRemoval.Notice, removal_notice.id).contact_verified_at + + removal_conn = + post( + recycle(removal_page), + ~p"/legal/content-removal/#{removal_notice.id}/verify", + %{"token" => removal_token} ) removal_location = redirected_to(removal_conn)