diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/admin.clj | 20 | ||||
| -rw-r--r-- | src/site.clj | 6 |
2 files changed, 24 insertions, 2 deletions
diff --git a/src/admin.clj b/src/admin.clj index 3a5abe7..1073095 100644 --- a/src/admin.clj +++ b/src/admin.clj @@ -35,6 +35,10 @@ SELECT * FROM users ORDER BY created_on DESC LIMIT 5000 ") +(def fetch-recent-users-query " +SELECT * FROM users WHERE last_login IS NOT NULL ORDER BY last_login DESC LIMIT 1000 +") + (def fetch-active-mutes-query " SELECT m.*, (m.set_on + m.duration) AS expiry, @@ -75,6 +79,9 @@ LIMIT 1 (defn fetch-new-users [] (do-select [fetch-new-users-query])) +(defn fetch-recent-users [] + (do-select [fetch-recent-users-query])) + (defn fetch-active-mutes [] (do-select [fetch-active-mutes-query])) @@ -178,7 +185,7 @@ AND cancelled = false (.setAttribute st "inactive" (f inactive)) (.toString st)))) -;; Recent users list +;; New users list (defn show-users [session params] (if-vip @@ -189,6 +196,17 @@ AND cancelled = false (.setAttribute st "users" (f users)) (.toString st)))) +;; Recent users list + +(defn show-lastlog [session params] + (if-vip + (let [st (fetch-template "users" session) + users (fetch-recent-users) + formatter (partial apply-formats user-formatter) + f #(map (comp stringify-and-escape formatter) %)] + (.setAttribute st "users" (f users)) + (.toString st)))) + ;; Debug Page (defn error-header [& text] diff --git a/src/site.clj b/src/site.clj index 66e880e..67bb007 100644 --- a/src/site.clj +++ b/src/site.clj @@ -305,7 +305,7 @@ WHERE user_id IN ; this should check if the user was created in the last day i guess (defn ip-recently-created? [ip] - (> (count (do-select ["select * from users where created_ip=?::cidr" (str ip)] )) 10)) + (> (count (do-select ["select * from users where created_ip=?::cidr" (str ip)] )) 15)) (def *reserved-nicks-path* "docs/reserved_nicks.txt") (def *reserved-nicks-refresh-period-sec* 300) @@ -1196,6 +1196,9 @@ WHERE user_id IN (GET "/images/*" (serve-static *image-directory* (params :*))) (GET "/avatars/*" (serve-static *avatar-directory* (params :*))) ;; irl + (GET "/soccer/*" (redirect-to "/")) + (GET "/soccer/" (redirect-to "/")) + (GET "/soccer" (redirect-to "/")) (GET "/irl" (redirect-to "/irl/")) (GET "/irl/" (serve-static "static/319" "index.html")) (GET "/irl/*" (serve-static "static/319" (params :*))) @@ -1299,6 +1302,7 @@ WHERE user_id IN (GET "/debug" (debug-page session flash)) (POST "/debug" (debug-commmand! session params)) (GET "/mutes" (show-mutes session params)) + (GET "/users/lastlog" (show-lastlog session params)) (GET "/users" (show-users session params)) (GET "/roomlist" (show-rooms session)) (POST "/mute" (mute! session params)) |
