chore(admin): oauth2 admin form identifiers
This commit is contained in:
parent
5c4f742745
commit
ce8aa849f8
@ -15,34 +15,33 @@ import Import
|
|||||||
|
|
||||||
getAdminOAuth2R, postAdminOAuth2R :: Handler Html
|
getAdminOAuth2R, postAdminOAuth2R :: Handler Html
|
||||||
getAdminOAuth2R = postAdminOAuth2R
|
getAdminOAuth2R = postAdminOAuth2R
|
||||||
postAdminOAuth2R = error "postAdminOAuth2R not yet implemented"
|
postAdminOAuth2R =
|
||||||
-- ((presult, pwidget), penctype) <- runFormPost $ identifyForm ("adminLdapLookup"::Text) $ \html ->
|
((presult, pwidget), penctype) <- runFormPost $ identifyForm ("adminOAuth2Lookup"::Text) $ \html ->
|
||||||
-- flip (renderAForm FormStandard) html $ areq textField (fslI MsgAdminUserIdent) Nothing
|
flip (renderAForm FormStandard) html $ areq textField (fslI MsgAdminUserIdent) Nothing
|
||||||
--
|
|
||||||
-- let procFormPerson :: Text -> Handler (Maybe ())
|
let procFormPerson :: Text -> Handler (Maybe ())
|
||||||
-- procFormPerson lid = error "TODO"
|
procFormPerson lid = error "TODO"
|
||||||
--
|
|
||||||
--
|
((uresult, uwidget), uenctype) <- runFormPost $ identifyForm ("adminOAuth2Upsert"::Text) $ \html ->
|
||||||
-- ((uresult, uwidget), uenctype) <- runFormPost $ identifyForm ("adminLdapUpsert"::Text) $ \html ->
|
flip (renderAForm FormStandard) html $ areq textField (fslI MsgAdminUserIdent) Nothing
|
||||||
-- flip (renderAForm FormStandard) html $ areq textField (fslI MsgAdminUserIdent) Nothing
|
let procFormUpsert :: Text -> Handler (Maybe (Either CampusUserConversionException (Entity User)))
|
||||||
-- let procFormUpsert :: Text -> Handler (Maybe (Either CampusUserConversionException (Entity User)))
|
procFormUpsert lid = pure <$> runDB (try $ ldapLookupAndUpsert lid)
|
||||||
-- procFormUpsert lid = pure <$> runDB (try $ ldapLookupAndUpsert lid)
|
mbLdapUpsert <- formResultMaybe uresult procFormUpsert
|
||||||
-- mbLdapUpsert <- formResultMaybe uresult procFormUpsert
|
|
||||||
--
|
|
||||||
--
|
actionUrl <- fromMaybe AdminLdapR <$> getCurrentRoute
|
||||||
-- actionUrl <- fromMaybe AdminLdapR <$> getCurrentRoute
|
siteLayoutMsg MsgMenuLdap $ do
|
||||||
-- siteLayoutMsg MsgMenuLdap $ do
|
setTitleI MsgMenuLdap
|
||||||
-- setTitleI MsgMenuLdap
|
let personForm = wrapForm pwidget def
|
||||||
-- let personForm = wrapForm pwidget def
|
{ formAction = Just $ SomeRoute actionUrl
|
||||||
-- { formAction = Just $ SomeRoute actionUrl
|
, formEncoding = penctype
|
||||||
-- , formEncoding = penctype
|
}
|
||||||
-- }
|
upsertForm = wrapForm uwidget def
|
||||||
-- upsertForm = wrapForm uwidget def
|
{ formAction = Just $ SomeRoute actionUrl
|
||||||
-- { formAction = Just $ SomeRoute actionUrl
|
, formEncoding = uenctype
|
||||||
-- , formEncoding = uenctype
|
}
|
||||||
-- }
|
presentUtf8 lv = Text.intercalate ", " (either tshow id . Text.decodeUtf8' <$> lv)
|
||||||
-- presentUtf8 lv = Text.intercalate ", " (either tshow id . Text.decodeUtf8' <$> lv)
|
presentLatin1 lv = Text.intercalate ", " ( Text.decodeLatin1 <$> lv)
|
||||||
-- presentLatin1 lv = Text.intercalate ", " ( Text.decodeLatin1 <$> lv)
|
|
||||||
--
|
-- TODO: use i18nWidgetFile instead if this is to become permanent
|
||||||
-- -- TODO: use i18nWidgetFile instead if this is to become permanent
|
$(widgetFile "oauth2")
|
||||||
-- $(widgetFile "ldap")
|
|
||||||
|
|||||||
Reference in New Issue
Block a user