diff options
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))) |
