diff options
| author | Scott Ostler <sbsotler@gmail.com> | 2010-11-14 12:59:03 -0800 |
|---|---|---|
| committer | Scott Ostler <sbsotler@gmail.com> | 2010-11-14 12:59:03 -0800 |
| commit | c6d587ff0cc72fda619cea633050607c12987faf (patch) | |
| tree | c8d5d9ab0449dc2075a17b2fa6bf1222ade43d9c /src/utils.clj | |
| parent | 6b8215267bc5af44dfab4097992a31b35513b102 (diff) | |
| parent | f5692dcbff94853078cb06ea63c881bb0588e297 (diff) | |
resolve site.clj conflict
Diffstat (limited to 'src/utils.clj')
| -rwxr-xr-x | src/utils.clj | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/utils.clj b/src/utils.clj index 8ed801e..9d7fd3a 100755 --- a/src/utils.clj +++ b/src/utils.clj @@ -431,10 +431,13 @@ (defn is-super-vip? [session] (contains? super-vips (:nick session))) -(defmacro if-vip [e] +(defmacro if-vip "Evaluates expr if user is super-vip otherwise returns 404. Can only be used where session is defined." - `(if (is-vip? ~'session) ~e (unknown-page))) + ([e] + `(if (is-vip? ~'session) ~e (unknown-page))) + ([e alt] + `(if (is-vip? ~'session) ~e ~alt))) (defmacro if-super-vip [e] "Evaluates expr if user is super-vip otherwise returns 404. Can only be used @@ -475,4 +478,4 @@ (for [[idx elt] (indexed coll) :when (pred elt)] idx)) (defn index-of [pred coll] - (first (index-filter pred coll)))
\ No newline at end of file + (first (index-filter pred coll))) |
