summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2012-06-19 00:05:15 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2012-06-19 00:05:15 +0200
commit41a9ee97f3c0e41b68342bf7dc22b49a7ca6ab4b (patch)
tree130cca27c373076a85a73e6e117521f0c398a06b /src
parentaebb61cd613d1e104a044180cc729f252d6f8415 (diff)
Profile: Publish full name on profile page.
Diffstat (limited to 'src')
-rw-r--r--src/mulk/benki/id.clj18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/mulk/benki/id.clj b/src/mulk/benki/id.clj
index 38dab61..2589e80 100644
--- a/src/mulk/benki/id.clj
+++ b/src/mulk/benki/id.clj
@@ -80,11 +80,19 @@
(def profile-page {})
+(defn user-name [uid]
+ (let [user (query1 "SELECT first_name, last_name FROM users WHERE id = ?" uid)]
+ (fmt nil "~A ~A"
+ (:first_name user)
+ (:last_name user))))
+
(defn show-profile-page [user]
- (layout profile-page "A Profile Page"
- [:div {:typeof "foaf:Person"}
- [:h2 "Public Keys"]
- (with-dbt
+ (with-dbt
+ (layout profile-page "A Profile Page"
+ [:div {:typeof "foaf:Person"}
+ [:div {:property "foaf:name"}
+ (user-name user)]
+ [:h2 "Public Keys"]
(sql/with-query-results keys ["SELECT * FROM user_rsa_keys WHERE \"user\" = ?" user]
(doall
(for [{modulus :modulus,
@@ -101,7 +109,7 @@
[:dt "Exponent"]
[:dd {:property "cert:exponent"
:datatype "xsd:integer"}
- (fmt nil "~D" exponent)]]]])))))]))
+ (fmt nil "~D" exponent)]]]]))))])))
(defn render-xrds [nickname]
{:status 200