From ef58e04d1dbf1084cbae5a803dce683f555beddb Mon Sep 17 00:00:00 2001 From: tim b Date: Sat, 3 Jul 2010 17:20:54 -0700 Subject: add last_login time and last_ip to users table --- src/utils.clj | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/utils.clj') diff --git a/src/utils.clj b/src/utils.clj index 9008793..607343e 100755 --- a/src/utils.clj +++ b/src/utils.clj @@ -40,6 +40,11 @@ (slurp* url) (throw (Exception. (str "Invalid url " u)))))) +(defn get-ip [request] + (let [ip (get (:headers request) "x-real-ip") ; behind nginx + ip (if ip ip (:remote-addr request))] (str ip)) ; deployed locally +) + (defn append [& vecs] (reduce into vecs)) -- cgit v1.2.3-70-g09d2