diff options
-rwxr-xr-x | journal-admin.cgi | 2 | ||||
-rw-r--r-- | main.lisp | 10 |
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))" @@ -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))) |