From 5b3fac97c77c5c9945d08d98cb19251ca7736980 Mon Sep 17 00:00:00 2001 From: christoph Date: Fri, 20 Feb 2009 23:50:24 +0100 Subject: Made the login work. Added an elementary feed-list. --- cljssss-g.clj | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/cljssss-g.clj b/cljssss-g.clj index e1cee88..d9f2149 100644 --- a/cljssss-g.clj +++ b/cljssss-g.clj @@ -40,14 +40,25 @@ (with-db (sql/with-query-results [{id :id password :password}] ["SELECT id, password FROM user WHERE name = ?" - (@params :name)] - (if (= password (@params :password)) + (params :name)] + (if (= password (params :password)) (do (alter session assoc :id id) (redirect-to "/")) (redirect-to "/login?valuesofbetawillgiverisetodom=true")))))) + (GET "/bare_feedlist" + (if (not (session :id)) + (redirect-to "/login") + (with-dbt + (sql/with-query-results + [results] + ["SELECT feed.link FROM feed, user_feed_link WHERE user_feed_link.feed=feed.id AND user_feed_link.user=?" 1] + (loop [cstr "" r results] + (if (rest r) + (recur (str cstr (first r) "\n") (rest r)) + (str cstr (first r) "\n"))))))) (GET "/" - (if (@session :id) + (if (session :id) (.toString (doto (.getInstanceOf templates "index") (.setAttributes {"title" "Subscriptions", -- cgit v1.2.3