aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristoph <christoph@debian.uxul.homelinux.org>2009-02-20 23:50:24 +0100
committerchristoph <christoph@debian.uxul.homelinux.org>2009-02-20 23:50:24 +0100
commit5b3fac97c77c5c9945d08d98cb19251ca7736980 (patch)
tree09e626011c974a0a628f7fe6f6e71b86460f1cc0
parentc483598d9d32ad6d126938070459408479877582 (diff)
Made the login work. Added an elementary feed-list.
-rw-r--r--cljssss-g.clj17
1 files 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",