about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <v.ambo@me.com>2012-04-22T19·57+0200
committerVincent Ambo <v.ambo@me.com>2012-04-22T19·57+0200
commit04eb6244978770138b0b624de32a8304087d911e (patch)
tree3484f14f5d79f84892ce81d10a559e55e71259b8
parent04d549b817f9de60052b802b6a40520b38511b2e (diff)
* removed captchas (well, commented them out)
-rw-r--r--src/Blog.hs2
-rw-r--r--src/Main.hs6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/Blog.hs b/src/Blog.hs
index 7f6891cf6e..d7a53e1f42 100644
--- a/src/Blog.hs
+++ b/src/Blog.hs
@@ -140,7 +140,7 @@ renderCommentBox cLang cId = do
         H.p $ H.input ! A.name "cname" ! A.placeholder "Name" ! A.class_ "cInput"
         H.p $ H.label $ H.textarea ! A.name "ctext" ! A.cols "50" ! A.rows "13" ! A.class_ "cInput" !
                         A.placeholder (toValue $ cTextPlaceholder cLang) $ mempty
-        H.p $ H.label $ captcha
+        -- H.p $ H.label $ captcha
         H.p $ H.input ! A.class_ "cInput" ! A.style "width: 120px;" ! A.type_ "submit" ! A.value (toValue $ cSend cLang)
 
 renderComments :: [Comment] -> BlogLang -> Html
diff --git a/src/Main.hs b/src/Main.hs
index c347250816..4d1ec4af57 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -149,7 +149,9 @@ addComment acid lang captchakey eId = do
   nComment <- Comment <$> pure now
                       <*> lookText' "cname"
                       <*> pure (commentEscape nCtext)
-  -- captcha verification
+  update' acid (AddComment eId nComment) 
+                >> seeOther ("/" ++ show lang ++ "/" ++ show eId) (toResponse())
+  {- -- captcha verification
   challenge <- look "recaptcha_challenge_field"
   response <- look "recaptcha_response_field"
   (userIp, _) <- askRq >>= return . rqPeer
@@ -157,7 +159,7 @@ addComment acid lang captchakey eId = do
   case validation of 
     Right _ -> update' acid (AddComment eId nComment) 
                 >> seeOther ("/" ++ show lang ++ "/" ++ show eId) (toResponse())
-    Left _ -> (liftIO $ putStrLn "Captcha failed") >> seeOther ("/" ++ show lang ++ "/" ++ show eId) (toResponse())
+    Left _ -> (liftIO $ putStrLn "Captcha failed") >> seeOther ("/" ++ show lang ++ "/" ++ show eId) (toResponse()) -}
 
 commentEscape :: Text -> Text
 commentEscape = newlineEscape . ltEscape . gtEscape . ampEscape