From 766b707106e052fc57a97b8dcd8b017475662317 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Sun, 11 Oct 2009 11:51:31 +0200 Subject: Change the way admin mode is selected. Ignore-this: 32655f3986da0817b1c78ad9d67a465e darcs-hash:b7966307b4a3986747b022e188f980febacffac1 --- journal-admin.cgi | 2 +- 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))" 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))) -- cgit v1.2.3