From decc5af6829998e2d0db79382bbd9a7bad7b5b09 Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Wed, 20 Dec 2023 16:31:59 +0100 Subject: [PATCH] fix(users): fix #121 by providing last login column, which was the last part missing --- src/Handler/Users.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Handler/Users.hs b/src/Handler/Users.hs index b2c8d3073..2af62ef7d 100644 --- a/src/Handler/Users.hs +++ b/src/Handler/Users.hs @@ -129,8 +129,9 @@ postUsersR = do (\(usr, E.Value reroutCom) -> linkUserWidget ForProfileDataR usr <> bool mempty icnReroute reroutCom) <$> supervisors' icnReroute = text2widget " " <> toWgt (icon IconLetter) pure $ mconcat supervisors - , sortable (Just "auth-ldap") (i18nCell MsgAuthMode) $ \DBRow{ dbrOutput = Entity _ User{..} } -> i18nCell userAuthentication - , sortable (Just "ldap-sync") (i18nCell MsgLdapSynced) $ \DBRow{ dbrOutput = Entity _ User{..} } -> maybe mempty dateTimeCell userLastLdapSynchronisation + , sortable (Just "last-login") (i18nCell MsgLastLogin) $ \DBRow{ dbrOutput = Entity _ User{..} } -> maybe mempty dateTimeCell userLastAuthentication + , sortable (Just "auth-ldap") (i18nCell MsgAuthMode) $ \DBRow{ dbrOutput = Entity _ User{..} } -> i18nCell userAuthentication + , sortable (Just "ldap-sync") (i18nCell MsgLdapSynced) $ \DBRow{ dbrOutput = Entity _ User{..} } -> maybe mempty dateTimeCell userLastLdapSynchronisation , flip foldMap universeF $ \function -> sortable (Just $ SortingKey $ CI.mk $ toPathPiece function) (i18nCell function) $ \DBRow{ dbrOutput = Entity uid _ } -> flip (set' cellContents) mempty $ do schools <- liftHandler . runDB . E.select . E.from $ \(school `E.InnerJoin` userFunction) -> do @@ -228,6 +229,9 @@ postUsersR = do , ( "auth-ldap" , SortColumn $ \user -> user E.^. UserAuthentication E.!=. E.val AuthLDAP ) + , ( "last-login" + , SortColumn $ \user -> user E.^. UserLastAuthentication + ) , ( "ldap-sync" , SortColumn $ \user -> user E.^. UserLastLdapSynchronisation )