uff. br0ken stuff.

This commit is contained in:
nek0 2016-09-05 17:17:57 +02:00
parent 2db1b5a8af
commit aab8e5661d
5 changed files with 17 additions and 18 deletions

View file

@ -150,15 +150,15 @@ getAdminProfileDeleteR ownerId = do
case tempOwner of
Just owner -> do
let albumList = userAlbums owner
_ <- mapM (\albumId -> do
mapM_ (\albumId -> do
album <- runDB $ getJust albumId
let mediaList = albumContent album
_ <- mapM (\med -> do
mapM_ (\med -> do
-- delete comments
commEnts <- runDB $ selectList [CommentOrigin ==. med] []
_ <- mapM (\ent -> do
mapM_ (\ent -> do
children <- runDB $ selectList [CommentParent ==. (Just $ entityKey ent)] []
_ <- mapM (\child -> do
mapM_ (\child -> do
-- delete comment children
runDB $ delete $ entityKey child
) children
@ -169,7 +169,6 @@ getAdminProfileDeleteR ownerId = do
liftIO $ removeFile (normalise $ L.tail $ mediumThumb medium)
liftIO $ removeFile (normalise $ L.tail $ mediumPreview medium)
-- delete medium database entry and search
ium <- runDB $ getJust med
runDB $ delete med
) mediaList
runDB $ delete albumId

View file

@ -22,14 +22,14 @@ import Data.Text.Encoding
getReactivateR :: Handler Html
getReactivateR = do
(reactivateWidget, enctype) <- generateFormPost reactivateForm
(reactivateWidget, enctype) <- generateFormPost $ renderBootstrap3 BootstrapBasicForm $ reactivateForm
formLayout $ do
setTitle "Eidolon :: Reactivate account"
$(widgetFile "reactivate")
postReactivateR :: Handler Html
postReactivateR = do
((result, _), _) <- runFormPost reactivateForm
((result, _), _) <- runFormPost $ renderBootstrap3 BootstrapBasicForm $ reactivateForm
case result of
FormSuccess temp -> do
users <- runDB $ selectList [UserEmail ==. temp] []
@ -66,6 +66,7 @@ postReactivateR = do
setMessage "There is something wrong with your email"
redirect $ ReactivateR
reactivateForm :: Form Text
reactivateForm = renderDivs $ (\a -> a)
<$> areq emailField "Email" Nothing
reactivateForm :: AForm Handler Text
reactivateForm = id
<$> areq emailField (bfs ("Email" :: Text)) Nothing
<* bootstrapSubmit ("Send" :: BootstrapSubmit Text)

View file

@ -1,16 +1,17 @@
$newline always
<div .item>
<div .medium>
<noscript>You need to have Javascript enabled
<form .login>
<h3>Activate your account
<p>
<form>
<div .form-group .required>
<label for="password1">Password:
<input id="password1" type="password" required>
<p>
<div .form-group .required>
<label for="password2">Confirm your password:
<input id="password2" type="password" required>
<p id="progress">
<input id="activate" type="submit" value="Activate" data-token="#{token}" data-salt="#{hexSalt}">
<div .form-group .optional>
<input id="activate" type="submit" value="Activate" data-token="#{token}" data-salt="#{hexSalt}">
<script src="/static/js/jquery.min.js" type="text/javascript">
<script src="/static/js/jsSHA.js" type="text/javascript">

View file

@ -4,5 +4,3 @@ $newline always
<form method="post" enctype=#{enctype}>
^{reactivateWidget}
<div>
<input type=submit value="Send">

View file

@ -2,7 +2,7 @@ $newline always
<div .medium>
<noscript>You need to have Javscript enabled
<h3>Signup
<form role="form" class="inner" method="POST" action=@{SignupR}>
<form role="form" method="POST" action=@{SignupR}>
<div .form-group .required>
<label for="username">Username:
<input .form-control #username name="username" type="text" required>