summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjournal-admin.cgi2
-rw-r--r--main.lisp10
2 files changed, 5 insertions, 7 deletions
diff --git a/journal-admin.cgi b/journal-admin.cgi
index d8fdfc5..770ddf9 100755
--- a/journal-admin.cgi
+++ b/journal-admin.cgi
@@ -22,4 +22,4 @@ if ! [ -f "$FASL_FILE" -a \( `mtime_of "$FASL_FILE"` -gt $lisp_mtime \) ]; then
find "$DIR" -name "*.fas" -print0 | xargs -0 cat > "$FASL_FILE"
fi
-exec env LC_ALL=de_DE.UTF-8 clisp -q -q -M "$LISPINIT_DIR/lispinit.mem.gz" -x "(progn (load \"$FASL_FILE\") (cl-user::script-main))" --admin-mode
+exec env LC_ALL=de_DE.UTF-8 clisp -q -q -M "$LISPINIT_DIR/lispinit.mem.gz" -x "(progn (load \"$FASL_FILE\") (cl-user::script-main :admin-mode t))"
diff --git a/main.lisp b/main.lisp
index 7d35260..f2c901a 100644
--- a/main.lisp
+++ b/main.lisp
@@ -307,7 +307,7 @@
#+clisp
-(defun journal-main ()
+(defun journal-main (&key admin-mode)
(let ((encoding (ext:make-encoding :charset charset:utf-8)))
(ext:letf* ((custom:*terminal-encoding* encoding)
(custom:*foreign-encoding* encoding)
@@ -316,15 +316,13 @@
(custom:*default-file-encoding* encoding))
(with-initialised-journal
(let ((*random-state* (make-random-state t)))
- (if (member "--admin-mode"
- (coerce (ext:argv) 'list)
- :test #'string=)
+ (if admin-mode
(dispatch-admin-action)
(dispatch-user-action)))))))
#+clisp
-(defun cl-user::script-main ()
+(defun cl-user::script-main (&key admin-mode)
(dolist (env-var '("HTTP_CACHE_CONTROL" "HTTP_IF_MODIFIED_SINCE"))
(pushnew env-var http::*http-env-vars*))
(http:http-init)
@@ -344,4 +342,4 @@
(<:pre (<:as-html (with-output-to-string (out)
#+clisp (system::pretty-print-condition e out)
#+clisp (system::print-backtrace :out out)))))))))
- (journal-main)))
+ (journal-main :admin-mode admin-mode)))