directory creation procedure
This commit is contained in:
parent
8bbe4d5d02
commit
0ab0552f20
3 changed files with 7 additions and 3 deletions
|
@ -1,6 +1,9 @@
|
|||
module Handler.Activate where
|
||||
|
||||
import Import as I
|
||||
import Data.Text
|
||||
import System.Directory
|
||||
import System.FilePath
|
||||
|
||||
getActivateR :: Text -> Handler Html
|
||||
getActivateR token = do
|
||||
|
@ -10,6 +13,7 @@ getActivateR token = do
|
|||
setMessage $ [shamlet|<pre>Invalid Token!|]
|
||||
redirect $ HomeR
|
||||
Just x -> do
|
||||
_ <- runDB $ insert $ tokenUser (entityVal x)
|
||||
userId <- runDB $ insert $ tokenUser (entityVal x)
|
||||
liftIO $ createDirectory $ "static" </> (unpack $ extractKey userId)
|
||||
setMessage $ [shamlet|<pre>User activated|]
|
||||
redirect $ HomeR
|
||||
|
|
|
@ -8,6 +8,6 @@
|
|||
/login LoginR GET POST
|
||||
/logout LogoutR GET
|
||||
/activate/#Text ActivateR GET
|
||||
/user/#Text ProfileR GET
|
||||
/user/#UserId ProfileR GET
|
||||
/upload UploadR GET POST
|
||||
/newalbum NewAlbumR GET POST
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<li>
|
||||
<a href=@{LogoutR}>Logout
|
||||
<li>
|
||||
<a href=@{UploadR}>Upload image
|
||||
<a href=@{NewAlbumR}>Create album
|
||||
$nothing
|
||||
<li>
|
||||
<a href=@{LoginR}>Login
|
||||
|
|
Loading…
Reference in a new issue