diff options
author | Yorhel <git@yorhel.nl> | 2020-12-19 09:21:39 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2020-12-19 09:21:39 +0100 |
commit | 5da40cc1dc01170251c9065beea141ac3b7696ff (patch) | |
tree | acf4e8e32c6212e30e6443abe4d41fdd230adadc | |
parent | d96b545dc45a0f85239dc36738ceb5fbe25d47e5 (diff) |
Warn about shitty email providers upon registration & password reset
-rw-r--r-- | elm/Lib/Util.elm | 9 | ||||
-rw-r--r-- | elm/User/PassReset.elm | 12 | ||||
-rw-r--r-- | elm/User/Register.elm | 10 |
3 files changed, 30 insertions, 1 deletions
diff --git a/elm/Lib/Util.elm b/elm/Lib/Util.elm index f3cf6433..72a0828d 100644 --- a/elm/Lib/Util.elm +++ b/elm/Lib/Util.elm @@ -83,6 +83,15 @@ containsNonLatin : String -> Bool containsNonLatin = Regex.contains nonlatin_ +-- Given an email address, returns the name of the provider if it has a good chance of blocking mails from our server. +shittyMailProvider : String -> Maybe String +shittyMailProvider s = + case String.split "@" s |> List.drop 1 |> List.head |> Maybe.withDefault "" |> String.toLower of + "sbcglobal.net" -> Just "AT&T" + "att.net" -> Just "AT&T" + _ -> Nothing + + -- Format a release resolution, first argument indicates whether empty string is to be used for "unknown" resoFmt : Bool -> Int -> Int -> String resoFmt empty x y = diff --git a/elm/User/PassReset.elm b/elm/User/PassReset.elm index dbcb1d57..5eb78313 100644 --- a/elm/User/PassReset.elm +++ b/elm/User/PassReset.elm @@ -8,6 +8,7 @@ import Lib.Api as Api import Gen.Api as GApi import Gen.UserPassReset as GUPR import Lib.Html exposing (..) +import Lib.Util exposing (..) main : Program () Model Msg @@ -68,7 +69,16 @@ view model = , text " and we'll send you instructions to set a new password within a few minutes!" ] , table [ class "formtable" ] - [ formField "email::E-Mail" [ inputText "email" model.email EMail GUPR.valEmail ] + [ formField "email::E-Mail" + [ inputText "email" model.email EMail GUPR.valEmail + , case shittyMailProvider model.email of + Nothing -> text "" + Just n -> span [] + [ br [] [] + , b [ class "standout" ] [ text "WARNING: " ] + , text (n ++ " is known to silently drop emails from VNDB. If your password reset email does not arrive in a few hours, please send a mail to contact@vndb.org.") + ] + ] ] ] , div [ class "mainbox" ] diff --git a/elm/User/Register.elm b/elm/User/Register.elm index de8e36ce..e9d8cab5 100644 --- a/elm/User/Register.elm +++ b/elm/User/Register.elm @@ -8,6 +8,7 @@ import Lib.Api as Api import Gen.Api as GApi import Gen.UserRegister as GUR import Lib.Html exposing (..) +import Lib.Util exposing (..) main : Program () Model Msg @@ -82,6 +83,15 @@ view model = ] , formField "email::E-Mail" [ inputText "email" model.email EMail GUR.valEmail + , case shittyMailProvider model.email of + Nothing -> text "" + Just n -> span [] + [ br [] [] + , b [ class "standout" ] [ text "WARNING: " ] + , text (n ++ " is known to silently drop emails from VNDB. If you have an address at another provider, you may want to use that." + ++ " If you want to keep using this provider, please kindly tell them to stop blocking VNDB. Thanks.") + , br [] [] + ] , br_ 1 , text "Your email address will only be used in case you lose your password. " , text "We will never send spam or newsletters unless you explicitly ask us for it or we get hacked." |