diff --git a/Handler/Activate.hs b/Handler/Activate.hs index 9672ab8..adf9ef1 100644 --- a/Handler/Activate.hs +++ b/Handler/Activate.hs @@ -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|
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|
User activated|]
       redirect $ HomeR
diff --git a/config/routes b/config/routes
index 8814789..c83e4e1 100644
--- a/config/routes
+++ b/config/routes
@@ -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
diff --git a/templates/default-layout.hamlet b/templates/default-layout.hamlet
index e5ab1dd..1942b24 100644
--- a/templates/default-layout.hamlet
+++ b/templates/default-layout.hamlet
@@ -6,7 +6,7 @@
       
  • Logout
  • - Upload image + Create album $nothing
  • Login