diff --git a/src/Handler/Profile.hs b/src/Handler/Profile.hs index 3a0103c58..4f3c89e90 100644 --- a/src/Handler/Profile.hs +++ b/src/Handler/Profile.hs @@ -584,6 +584,8 @@ makeProfileData :: Entity User -> DB Widget makeProfileData (Entity uid User{..}) = do now <- liftIO getCurrentTime avsId <- entityVal <<$>> getBy (UniqueUserAvsUser uid) + externalAuths <- (\(Entity _ ExternalAuth{..}) -> ("" :: Text, externalAuthSource, externalAuthLastSync)) <<$>> selectList [ ExternalAuthUser ==. uid ] [] -- TODO: define and use user identification in ExternalAuth model + -- avsCards <- maybe (pure mempty) (\a -> selectList [UserAvsCardPersonId ==. userAvsPersonId a] []) avsId functions <- Map.fromListWith Set.union . map (\(Entity _ UserFunction{..}) -> (userFunctionFunction, Set.singleton userFunctionSchool)) <$> selectList [UserFunctionUser ==. uid] [] lecture_corrector <- E.select $ E.distinct $ E.from $ \(sheet `E.InnerJoin` corrector `E.InnerJoin` course) -> do diff --git a/templates/profileData.hamlet b/templates/profileData.hamlet index 9eb2817af..881598b6d 100644 --- a/templates/profileData.hamlet +++ b/templates/profileData.hamlet @@ -1,6 +1,6 @@ $newline never -$# SPDX-FileCopyrightText: 2022 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Winnie Ros +$# SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel , Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Winnie Ros $# $# SPDX-License-Identifier: AGPL-3.0-or-later @@ -10,10 +10,6 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later _{MsgIdent}
#{userIdent} -
- _{MsgAuthModeSet} -
- _{userAuthentication} $maybe avs <- avsId
_{MsgAvsPersonNo} @@ -124,6 +120,25 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later _{MsgUserCreated}
^{formatTimeW SelFormatDateTime userCreated} +
+ _{MsgAdminUserAuthentication} +
+ $if null externalAuths && is _Nothing userPasswordHash + _{MsgAuthKindNoLogin} + $else +
    + $if is _Just userPasswordHash +
  • _{MsgAuthKindPWHash} + $forall (authIdent, sourceIdent, lsync) <- externalAuths +
  • + $case sourceIdent + $of AuthSourceIdAzure _clientId + _{MsgAuthKindAzure}: # + $of AuthSourceIdLdap _host _port + _{MsgAuthKindLDAP}: # + #{authIdent} # + + (_{MsgAdminUserAuthLastSync}: ^{formatTimeW SelFormatDateTime lsync})
    _{MsgLastLogin}
    @@ -131,18 +146,6 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later ^{formatTimeW SelFormatDateTime llogin} $nothing _{MsgNeverSet} -
    - _{MsgProfileLastLdapSynchronisation} -
    - $maybe lsync <- userLastLdapSynchronisation - ^{formatTimeW SelFormatDateTime lsync} - $nothing - _{MsgNeverSet} - $maybe pKey <- userLdapPrimaryKey -
    - _{MsgProfileLdapPrimaryKey} -
    - #{pKey}
    _{MsgTokensLastReset}