chore(profile): better auth info on profile page
This commit is contained in:
parent
012c75db21
commit
19433fdc56
@ -584,6 +584,8 @@ makeProfileData :: Entity User -> DB Widget
|
|||||||
makeProfileData (Entity uid User{..}) = do
|
makeProfileData (Entity uid User{..}) = do
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
avsId <- entityVal <<$>> getBy (UniqueUserAvsUser uid)
|
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
|
-- 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] []
|
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
|
lecture_corrector <- E.select $ E.distinct $ E.from $ \(sheet `E.InnerJoin` corrector `E.InnerJoin` course) -> do
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
$newline never
|
$newline never
|
||||||
|
|
||||||
$# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <vaupel.sarah@campus.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Winnie Ros <winnie.ros@campus.lmu.de>
|
$# SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel <sarah.vaupel@uniworx.de>, Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <vaupel.sarah@campus.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Winnie Ros <winnie.ros@campus.lmu.de>
|
||||||
$#
|
$#
|
||||||
$# SPDX-License-Identifier: AGPL-3.0-or-later
|
$# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
@ -10,10 +10,6 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later
|
|||||||
_{MsgIdent}
|
_{MsgIdent}
|
||||||
<dd .deflist__dd .email>
|
<dd .deflist__dd .email>
|
||||||
#{userIdent}
|
#{userIdent}
|
||||||
<dt .deflist__dt>
|
|
||||||
_{MsgAuthModeSet}
|
|
||||||
<dd .deflist__dd>
|
|
||||||
_{userAuthentication}
|
|
||||||
$maybe avs <- avsId
|
$maybe avs <- avsId
|
||||||
<dt .deflist__dt>
|
<dt .deflist__dt>
|
||||||
_{MsgAvsPersonNo}
|
_{MsgAvsPersonNo}
|
||||||
@ -124,6 +120,25 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later
|
|||||||
_{MsgUserCreated}
|
_{MsgUserCreated}
|
||||||
<dd .deflist__dd>
|
<dd .deflist__dd>
|
||||||
^{formatTimeW SelFormatDateTime userCreated}
|
^{formatTimeW SelFormatDateTime userCreated}
|
||||||
|
<dt .deflist__dt>
|
||||||
|
_{MsgAdminUserAuthentication}
|
||||||
|
<dd .deflist__dd>
|
||||||
|
$if null externalAuths && is _Nothing userPasswordHash
|
||||||
|
_{MsgAuthKindNoLogin}
|
||||||
|
$else
|
||||||
|
<ul>
|
||||||
|
$if is _Just userPasswordHash
|
||||||
|
<li>_{MsgAuthKindPWHash}
|
||||||
|
$forall (authIdent, sourceIdent, lsync) <- externalAuths
|
||||||
|
<li>
|
||||||
|
$case sourceIdent
|
||||||
|
$of AuthSourceIdAzure _clientId
|
||||||
|
_{MsgAuthKindAzure}: #
|
||||||
|
$of AuthSourceIdLdap _host _port
|
||||||
|
_{MsgAuthKindLDAP}: #
|
||||||
|
#{authIdent} #
|
||||||
|
<span .comment>
|
||||||
|
(_{MsgAdminUserAuthLastSync}: ^{formatTimeW SelFormatDateTime lsync})
|
||||||
<dt .deflist__dt>
|
<dt .deflist__dt>
|
||||||
_{MsgLastLogin}
|
_{MsgLastLogin}
|
||||||
<dd .deflist__dd>
|
<dd .deflist__dd>
|
||||||
@ -131,18 +146,6 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later
|
|||||||
^{formatTimeW SelFormatDateTime llogin}
|
^{formatTimeW SelFormatDateTime llogin}
|
||||||
$nothing
|
$nothing
|
||||||
_{MsgNeverSet}
|
_{MsgNeverSet}
|
||||||
<dt .deflist__dt>
|
|
||||||
_{MsgProfileLastLdapSynchronisation}
|
|
||||||
<dd .deflist__dd>
|
|
||||||
$maybe lsync <- userLastLdapSynchronisation
|
|
||||||
^{formatTimeW SelFormatDateTime lsync}
|
|
||||||
$nothing
|
|
||||||
_{MsgNeverSet}
|
|
||||||
$maybe pKey <- userLdapPrimaryKey
|
|
||||||
<dt .deflist__dt>
|
|
||||||
_{MsgProfileLdapPrimaryKey}
|
|
||||||
<dd .deflist__dd .ldap-primary-key>
|
|
||||||
#{pKey}
|
|
||||||
<dt .deflist__dt>
|
<dt .deflist__dt>
|
||||||
_{MsgTokensLastReset}
|
_{MsgTokensLastReset}
|
||||||
<dd .deflist__dd>
|
<dd .deflist__dd>
|
||||||
|
|||||||
Reference in New Issue
Block a user