take out the "roles" setup
[rrq/hourglass.git] / manager / basic_login.lsp
index 7231ef0e0e7f7b3b62d4f5965a3655dafd7d5497..38b7ac490b56a7ef827c6ac8f5e5b7808825c527 100644 (file)
@@ -5,8 +5,9 @@
 ;;
 ;; Its (main-args 0) has a final path component X.cgi that links to
 ;; this file as a packnl embedding that will use that X part of its
-;; name to determine th actual script. That lookup will also use the
-;; "role base" as declared in "roles.txt"
+;; name to determine th actual script.
+
+(load "siteconfig.lsp")
 
 (write-line 2 (string (date-value) " " (main-args)))
 (unless (ends-with (main-args 0) ".cgi")
   (write-line 1 (read-file "tmpl/unauthorized.http"))
   (exit 0))
 
-(define (role-script ROLE)
+;; Determine actual script name respecting given role, if any.
+(define (role-script (ROLE "."))
   (let ((CMD (and (regex "([^/]*).cgi$" (main-args 0) 0) $1)))
-    (if (= "." ROLE) (string CMD ".lsp")
-      (format "%s/%s.lsp" ROLE CMD))))
+    (if (= "." ROLE) (string CMD ".lsp") (format "%s/%s.lsp" ROLE CMD))))
 
 (setf
- ROLES (map (fn (x) (parse x ":")) (parse (read-file "roles.txt") "\n"))
  REMOTE_USER (and (regex "([^:]+):" (base64-dec (6 AUTH)) 0) $1)
- ROLE (or (lookup REMOTE_USER ROLES) "child")
- SCRIPT (role-script ROLE)
+ SCRIPT (role-script)
  )
 (env "REMOTE_USER" REMOTE_USER)
 (env "ROLE" ROLE)