* Instead of an error when the users file doesn't exist, just show a

warning in the log file.
* Use 'timestamp for reading preference files.

svn: r16174
This commit is contained in:
Eli Barzilay 2009-09-30 02:10:17 +00:00
parent a45782a7d2
commit d39959ce1f
3 changed files with 8 additions and 5 deletions

View File

@ -40,9 +40,10 @@
(provide user-data)
(define (user-data user)
;; the student always assumed to exist
;; the student is always assumed to exist
(cdr (get-preference (if (string? user) (string->symbol user) user)
(lambda () #f) #f (build-path server-dir "users.ss"))))
(lambda () #f) 'timestamp
(build-path server-dir "users.ss"))))
(provide user-substs)
(define (user-substs user str)

View File

@ -325,7 +325,8 @@
orig-custodian))
(define (get-user-data username)
(get-preference (string->symbol username) (lambda () #f) #f "users.ss"))
(get-preference (string->symbol username) (lambda () #f) 'timestamp
"users.ss"))
(define (check-field value field-re field-name field-desc)
(unless (cond [(or (string? field-re) (regexp? field-re))
(regexp-match field-re value)]

View File

@ -24,9 +24,10 @@
(define get-user-data
(let ([users-file (build-path server-dir "users.ss")])
(unless (file-exists? users-file)
(error 'get-user-data "users file missing at: ~a" users-file))
(log-line "WARNING: users file missing on startup: ~a" users-file))
(lambda (user)
(get-preference (string->symbol user) (lambda () #f) #f users-file))))
(get-preference (string->symbol user) (lambda () #f) 'timestamp
users-file))))
(define (relativize-path p)
(path->string (find-relative-path (normalize-path server-dir) p)))