From 2321216b0f4f194c7cd8b47eb020819d6aa1f2e5 Mon Sep 17 00:00:00 2001 From: ros Date: Thu, 8 Jul 2021 14:12:05 +0200 Subject: [PATCH 1/5] feat(link password time): done --- messages/uniworx/categories/jobs_handler/de-de-formal.msg | 1 + messages/uniworx/categories/jobs_handler/en-eu.msg | 1 + src/Application.hs | 2 +- src/Foundation/I18n.hs | 2 ++ templates/mail/passwordReset.hamlet | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/messages/uniworx/categories/jobs_handler/de-de-formal.msg b/messages/uniworx/categories/jobs_handler/de-de-formal.msg index 9486409fa..7a63c78ff 100644 --- a/messages/uniworx/categories/jobs_handler/de-de-formal.msg +++ b/messages/uniworx/categories/jobs_handler/de-de-formal.msg @@ -17,3 +17,4 @@ InvitationAcceptDecline: Einladung annehmen/ablehnen InvitationFromTip displayName@Text: Sie erhalten diese Einladung, weil #{displayName} ihren Versand in Uni2work ausgelöst hat. InvitationFromTipAnonymous: Sie erhalten diese Einladung, weil ein nicht eingeloggter Benutzer/eine nichteingeloggte Benutzerin ihren Versand in Uni2work ausgelöst hat. InvitationUniWorXTip: Uni2work ist ein webbasiertes Lehrverwaltungssystem der LMU München. +LinkActiveUntil time@UTCTime: Der Link ist nur bis #{time} aktiv! \ No newline at end of file diff --git a/messages/uniworx/categories/jobs_handler/en-eu.msg b/messages/uniworx/categories/jobs_handler/en-eu.msg index 6df1adf0c..f7df35617 100644 --- a/messages/uniworx/categories/jobs_handler/en-eu.msg +++ b/messages/uniworx/categories/jobs_handler/en-eu.msg @@ -17,3 +17,4 @@ InvitationAcceptDecline: Accept/Decline invitation InvitationFromTip displayName: You are receiving this invitation because #{displayName} has caused it to be sent from within Uni2work. InvitationFromTipAnonymous: You are receiving this invitiation because an user who didn't log in has caused it to be send from within Uni2work. InvitationUniWorXTip: Uni2work is a web based teaching management system at LMU Munich. +LinkActiveUntil time@UTCTime: The link is only available until #{time}! \ No newline at end of file diff --git a/src/Application.hs b/src/Application.hs index bcaf1edda..ab3bb8886 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -707,4 +707,4 @@ addPWEntry :: User addPWEntry User{ userAuthentication = _, ..} (Text.encodeUtf8 -> pw) = db' $ do PWHashConf{..} <- getsYesod $ view _appAuthPWHash (AuthPWHash . Text.decodeUtf8 -> userAuthentication) <- liftIO $ makePasswordWith pwHashAlgorithm pw pwHashStrength - void $ insert User{..} + void $ insert User{..} \ No newline at end of file diff --git a/src/Foundation/I18n.hs b/src/Foundation/I18n.hs index b720355c6..e013060f5 100644 --- a/src/Foundation/I18n.hs +++ b/src/Foundation/I18n.hs @@ -417,6 +417,8 @@ instance ToMessage Natural where toMessage = tshow instance ToMessage Word64 where toMessage = tshow +instance ToMessage UTCTime where + toMessage = tshow instance HasResolution a => ToMessage (Fixed a) where toMessage = toMessage . showFixed True diff --git a/templates/mail/passwordReset.hamlet b/templates/mail/passwordReset.hamlet index 2dd9dfc7b..df7524f81 100644 --- a/templates/mail/passwordReset.hamlet +++ b/templates/mail/passwordReset.hamlet @@ -13,3 +13,4 @@ $newline never

_{SomeMessage MsgResetPassword} + _{SomeMessage $ MsgLinkActiveUntil tomorrowEndOfDay} From df2a9bc20fe9f958cbee98315b644ec2fcba0630 Mon Sep 17 00:00:00 2001 From: ros Date: Fri, 23 Jul 2021 09:53:40 +0200 Subject: [PATCH 2/5] feat(link password time): new time format --- messages/uniworx/categories/jobs_handler/de-de-formal.msg | 2 +- messages/uniworx/categories/jobs_handler/en-eu.msg | 2 +- src/Foundation/I18n.hs | 3 --- src/Jobs/Handler/SendPasswordReset.hs | 4 ++-- templates/mail/passwordReset.hamlet | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/messages/uniworx/categories/jobs_handler/de-de-formal.msg b/messages/uniworx/categories/jobs_handler/de-de-formal.msg index 7a63c78ff..8fd6899f6 100644 --- a/messages/uniworx/categories/jobs_handler/de-de-formal.msg +++ b/messages/uniworx/categories/jobs_handler/de-de-formal.msg @@ -17,4 +17,4 @@ InvitationAcceptDecline: Einladung annehmen/ablehnen InvitationFromTip displayName@Text: Sie erhalten diese Einladung, weil #{displayName} ihren Versand in Uni2work ausgelöst hat. InvitationFromTipAnonymous: Sie erhalten diese Einladung, weil ein nicht eingeloggter Benutzer/eine nichteingeloggte Benutzerin ihren Versand in Uni2work ausgelöst hat. InvitationUniWorXTip: Uni2work ist ein webbasiertes Lehrverwaltungssystem der LMU München. -LinkActiveUntil time@UTCTime: Der Link ist nur bis #{time} aktiv! \ No newline at end of file +LinkActiveUntil time@Text: Der Link ist nur bis #{time} aktiv! \ No newline at end of file diff --git a/messages/uniworx/categories/jobs_handler/en-eu.msg b/messages/uniworx/categories/jobs_handler/en-eu.msg index f7df35617..be3093426 100644 --- a/messages/uniworx/categories/jobs_handler/en-eu.msg +++ b/messages/uniworx/categories/jobs_handler/en-eu.msg @@ -17,4 +17,4 @@ InvitationAcceptDecline: Accept/Decline invitation InvitationFromTip displayName: You are receiving this invitation because #{displayName} has caused it to be sent from within Uni2work. InvitationFromTipAnonymous: You are receiving this invitiation because an user who didn't log in has caused it to be send from within Uni2work. InvitationUniWorXTip: Uni2work is a web based teaching management system at LMU Munich. -LinkActiveUntil time@UTCTime: The link is only available until #{time}! \ No newline at end of file +LinkActiveUntil time@Text: The link is only available until #{time}! \ No newline at end of file diff --git a/src/Foundation/I18n.hs b/src/Foundation/I18n.hs index e013060f5..0d7a31ee1 100644 --- a/src/Foundation/I18n.hs +++ b/src/Foundation/I18n.hs @@ -417,9 +417,6 @@ instance ToMessage Natural where toMessage = tshow instance ToMessage Word64 where toMessage = tshow -instance ToMessage UTCTime where - toMessage = tshow - instance HasResolution a => ToMessage (Fixed a) where toMessage = toMessage . showFixed True diff --git a/src/Jobs/Handler/SendPasswordReset.hs b/src/Jobs/Handler/SendPasswordReset.hs index 0832b4453..5e73b8949 100644 --- a/src/Jobs/Handler/SendPasswordReset.hs +++ b/src/Jobs/Handler/SendPasswordReset.hs @@ -34,7 +34,7 @@ dispatchJobSendPasswordReset jRecipient = JobHandlerException . userMailT jRecip let resetBearer = resetBearer' & bearerRestrict (UserPasswordR cID) (decodeUtf8 . Base64.encode . BA.convert $ computeUserAuthenticationDigest userAuthentication) encodedBearer <- encodeBearer resetBearer - + resetUrl <- toTextUrl (UserPasswordR cID, [(toPathPiece GetBearer, toPathPiece encodedBearer)]) - + activeTime <- formatTimeMail SelFormatDateTime tomorrowEndOfDay addHtmlMarkdownAlternatives ($(ihamletFile "templates/mail/passwordReset.hamlet") :: HtmlUrlI18n (SomeMessage UniWorX) (Route UniWorX)) diff --git a/templates/mail/passwordReset.hamlet b/templates/mail/passwordReset.hamlet index df7524f81..fa448db58 100644 --- a/templates/mail/passwordReset.hamlet +++ b/templates/mail/passwordReset.hamlet @@ -13,4 +13,4 @@ $newline never

_{SomeMessage MsgResetPassword} - _{SomeMessage $ MsgLinkActiveUntil tomorrowEndOfDay} + _{SomeMessage $ MsgLinkActiveUntil activeTime} From 0524f0a1203f70b6943e256759b9a70d452054c3 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Thu, 12 Aug 2021 12:04:02 +0200 Subject: [PATCH 3/5] Apply 1 suggestion(s) to 1 file(s) --- messages/uniworx/categories/jobs_handler/en-eu.msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/messages/uniworx/categories/jobs_handler/en-eu.msg b/messages/uniworx/categories/jobs_handler/en-eu.msg index be3093426..d98247824 100644 --- a/messages/uniworx/categories/jobs_handler/en-eu.msg +++ b/messages/uniworx/categories/jobs_handler/en-eu.msg @@ -17,4 +17,4 @@ InvitationAcceptDecline: Accept/Decline invitation InvitationFromTip displayName: You are receiving this invitation because #{displayName} has caused it to be sent from within Uni2work. InvitationFromTipAnonymous: You are receiving this invitiation because an user who didn't log in has caused it to be send from within Uni2work. InvitationUniWorXTip: Uni2work is a web based teaching management system at LMU Munich. -LinkActiveUntil time@Text: The link is only available until #{time}! \ No newline at end of file +LinkActiveUntil time@Text: The link is only active until #{time}! \ No newline at end of file From 85006ff389188b56a8b61943621c190c9a9503b7 Mon Sep 17 00:00:00 2001 From: ros Date: Thu, 12 Aug 2021 12:06:49 +0200 Subject: [PATCH 4/5] feat(link password time): restore application --- src/Application.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Application.hs b/src/Application.hs index 001d87096..bcaf1edda 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -17,10 +17,9 @@ module Application ) where import Control.Monad.Logger (liftLoc, LoggingT(..), MonadLoggerIO(..)) -import Database.Persist.Postgresql ( openSimpleConn, pgConnStr, pgPoolIdleTimeout +import Database.Persist.Postgresql ( openSimpleConn, pgConnStr, connClose, pgPoolIdleTimeout , pgPoolSize ) -import Database.Persist.SqlBackend.Internal ( connClose ) import qualified Database.PostgreSQL.Simple as PG import Import hiding (cancel, respond) import Language.Haskell.TH.Syntax (qLocation) @@ -143,7 +142,6 @@ import Handler.Participants import Handler.StorageKey import Handler.Workflow import Handler.Error -import Handler.Upload -- This line actually creates our YesodDispatch instance. It is the second half @@ -709,4 +707,4 @@ addPWEntry :: User addPWEntry User{ userAuthentication = _, ..} (Text.encodeUtf8 -> pw) = db' $ do PWHashConf{..} <- getsYesod $ view _appAuthPWHash (AuthPWHash . Text.decodeUtf8 -> userAuthentication) <- liftIO $ makePasswordWith pwHashAlgorithm pw pwHashStrength - void $ insert User{..} \ No newline at end of file + void $ insert User{..} From acab92d143efb950d2449309a622560b41a7b2e9 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Fri, 20 Aug 2021 12:19:29 +0200 Subject: [PATCH 5/5] chore: restore testdata/workflows --- testdata/workflows | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testdata/workflows b/testdata/workflows index cf7dcf58c..1a788c67f 160000 --- a/testdata/workflows +++ b/testdata/workflows @@ -1 +1 @@ -Subproject commit cf7dcf58c524176bbdd27ff279d68a5ab90cd06e +Subproject commit 1a788c67fe98cadf1e29b0e328072437955fd660