From a77897fd4a474e5e2cfa292af069c33f8d3aa6ac Mon Sep 17 00:00:00 2001 From: Scott Ostler Date: Mon, 25 Oct 2010 10:11:02 -0400 Subject: Added mgmt pw --- src/site.clj | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/site.clj b/src/site.clj index 1523c6f..68190d5 100644 --- a/src/site.clj +++ b/src/site.clj @@ -1253,6 +1253,15 @@ WHERE u.user_id = ANY(?)" (.setAttribute st "dumps" (map process-message-for-output msgs)) (.toString st))) +;; MGMT logic + +(def mgmt-pw "idontgetit") + +(defn mgmt [session url pw] + (if (= (and pw (lower-case pw)) mgmt-pw) + (validated-chat session "mgmt" "chat") + (validated-chat session "mgmt"))) + ;; Compojure Routes (defn serve-static [dir path] @@ -1335,7 +1344,8 @@ WHERE u.user_id = ANY(?)" (GET "/test/hiscores/week" (hiscore-test session params "week")) (GET "/test/hiscores/month" (hiscore-test session params "month")) - + (GET "/mgmt" (mgmt session request nil)) + (GET "/mgmt/:pw" (mgmt session request (:pw params))) ;; Events ; (GET "/event" (event-page session)) -- cgit v1.2.3-70-g09d2