small fixes

svn: r1295
This commit is contained in:
Eli Barzilay 2005-11-12 16:08:46 +00:00
parent d48f0587b8
commit c88354bb17
3 changed files with 12 additions and 7 deletions

View File

@ -214,10 +214,10 @@ sub-directories:
which matches the default user-regexp which matches the default user-regexp
'username-case-sensitive? : a boolean; when #f, usernames 'username-case-sensitive? : a boolean; when #f, usernames
are case-folded for all purposes; defaults to #f are case-folded for all purposes; defaults to #f (note that
(note that you should not set this to #t on Windows or when you should not set this to #t on Windows or when using other
using a case-insensitive filesystem, since usernames are used case-insensitive filesystems, since usernames are used as
as directory names) directory names)
'allow-new-users : a boolean indicating whether to allow 'allow-new-users : a boolean indicating whether to allow
new-user requests from a client tool; the default is #f new-user requests from a client tool; the default is #f

View File

@ -377,6 +377,10 @@
[else (error* "no language configured for submissions")]) [else (error* "no language configured for submissions")])
output-file) output-file)
;; ======================================== ;; ========================================
;; indirection for user-post (may be set after `check:')
(define (post users submission)
(when user-post (user-post users submission)))
;; ========================================
;; configuration sanity checks ;; configuration sanity checks
(let ([bad (cond [(and eval? (not language)) (let ([bad (cond [(and eval? (not language))
"`eval?' without `language'"] "`eval?' without `language'"]
@ -390,7 +394,7 @@
(when bad (when bad
(error* "bad checker specifications: cannot use ~a" bad))) (error* "bad checker specifications: cannot use ~a" bad)))
;; ======================================== ;; ========================================
(list pre check user-post))))]))) (list pre check post))))])))
(define-syntax (with-bindings stx) (define-syntax (with-bindings stx)
(syntax-case stx () (syntax-case stx ()

View File

@ -473,7 +473,8 @@
(when (a-ref data key #f) (perror "multiple values for ~e" key)) (when (a-ref data key #f) (perror "multiple values for ~e" key))
(case key (case key
[(username/s) [(username/s)
(when USERNAME-CASE-SENSITIVE? (set! val (string-foldcase val))) (unless USERNAME-CASE-SENSITIVE?
(set! val (string-foldcase val)))
(let ([usernames (let ([usernames
;; Username lists must always be sorted, and never empty ;; Username lists must always be sorted, and never empty
;; (regexp-split will not return an empty list) ;; (regexp-split will not return an empty list)
@ -507,7 +508,7 @@
[else [else
(when (eof-object? msg) (when (eof-object? msg)
(LOG "hangup") (LOG "hangup")
(error 'handin "hangup" (a-ref data 'username/s))) (error 'handin "hangup (~a)" (a-ref data 'username/s)))
(let ([usernames (a-ref data 'usernames #f)] (let ([usernames (a-ref data 'usernames #f)]
[user-datas (a-ref data 'user-datas #f)]) [user-datas (a-ref data 'user-datas #f)])
(when (or (memq #f user-datas) (when (or (memq #f user-datas)