* added flushSessions :: IO()
* updated TODO
This commit is contained in:
parent
eaa9ed5b98
commit
f6446aec72
2 changed files with 15 additions and 2 deletions
1
TODO
1
TODO
|
@ -1,4 +1,3 @@
|
|||
* handle BlogErrors
|
||||
* fix sessions
|
||||
* add readMore link
|
||||
* add flushSessions :: IO()
|
|
@ -168,6 +168,12 @@ getSession sId =
|
|||
do b@Blog{..} <- ask
|
||||
return $ getOne $ blogSessions @= sId
|
||||
|
||||
clearSessions :: Update Blog [Session]
|
||||
clearSessions =
|
||||
do b@Blog{..} <- get
|
||||
put $ b { blogSessions = empty }
|
||||
return []
|
||||
|
||||
addUser :: Text -> String -> Update Blog User
|
||||
addUser un pw =
|
||||
do b@Blog{..} <- get
|
||||
|
@ -203,6 +209,7 @@ $(makeAcidic ''Blog
|
|||
, 'addUser
|
||||
, 'getUser
|
||||
, 'checkUser
|
||||
, 'clearSessions
|
||||
])
|
||||
|
||||
interactiveUserAdd :: IO ()
|
||||
|
@ -215,3 +222,10 @@ interactiveUserAdd = do
|
|||
pw <- getLine
|
||||
update' acid (AddUser (pack un) pw)
|
||||
createCheckpointAndClose acid
|
||||
|
||||
flushSessions :: IO ()
|
||||
flushSessions = do
|
||||
tbDir <- getEnv "TAZBLOG"
|
||||
acid <- openLocalStateFrom (tbDir ++ "/BlogState") initialBlogState
|
||||
update' acid (ClearSessions)
|
||||
createCheckpointAndClose acid
|
||||
|
|
Loading…
Reference in a new issue