diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-02-29 22:45:24 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2012-02-29 22:45:24 +0100 |
commit | 30515c14a029c140a82729962b06eecac1745f11 (patch) | |
tree | c823bc018faa30651481aee7d092d5150870dc28 /src/mulk/benki/book_marx.clj | |
parent | c36256cb55640fbe452198831cb21cdeb4c570b9 (diff) |
Book Marx: Implement support for page-specific authentication tokens.
Diffstat (limited to 'src/mulk/benki/book_marx.clj')
-rw-r--r-- | src/mulk/benki/book_marx.clj | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/mulk/benki/book_marx.clj b/src/mulk/benki/book_marx.clj index e5e8701..bbaa9f6 100644 --- a/src/mulk/benki/book_marx.clj +++ b/src/mulk/benki/book_marx.clj @@ -84,8 +84,7 @@ (cq/sort [:date#desc]))) (defpage "/marx" {} - (let [user (session/get :user) - marks (bookmarks-visible-by user)] + (let [marks (bookmarks-visible-by *user*)] (with-dbt (layout bookmarx-list-page "Book Marx" [:div {:id "login-message" @@ -133,9 +132,8 @@ (.toString feed))))) (defpage "/marx/feed" {} - (let [user (session/get :user)] - (response/content-type "application/atom+xml; charset=UTF-8" - (marx-feed-for-user user)))) + (response/content-type "application/atom+xml; charset=UTF-8" + (marx-feed-for-user *user*))) (defpage "/marx/tags" {} (with-auth @@ -188,8 +186,7 @@ title :title, tags :tags, visibility :visibility, origin :origin} (with-auth - (let [tagseq (map string/trim (string/split tags #",")) - user (session/get :user)] + (let [tagseq (map string/trim (string/split tags #","))] (with-dbt (let [bookmark (sql/with-query-results results @@ -197,7 +194,7 @@ visibility) VALUES (?, ?, ?, ?, ?) RETURNING id" - user uri title description visibility] + *user* uri title description visibility] (:id (first (into () results))))] (doseq [tag tagseq] (sql/insert-values :bookmark_tags [:bookmark :tag] [bookmark tag])))))) |