diff options
author | christoph <christoph@debian.uxul.homelinux.org> | 2009-02-20 23:50:24 +0100 |
---|---|---|
committer | christoph <christoph@debian.uxul.homelinux.org> | 2009-02-20 23:50:24 +0100 |
commit | 5b3fac97c77c5c9945d08d98cb19251ca7736980 (patch) | |
tree | 09e626011c974a0a628f7fe6f6e71b86460f1cc0 | |
parent | c483598d9d32ad6d126938070459408479877582 (diff) |
Made the login work. Added an elementary feed-list.
-rw-r--r-- | cljssss-g.clj | 17 |
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", |