projects
/
rrq
/
hourglass.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes; first version
[rrq/hourglass.git]
/
manager
/
usage.lsp
diff --git
a/manager/usage.lsp
b/manager/usage.lsp
index e53a4ac467e794f6d48c55747589145f1dd089ed..3969a3e50ced948fcfdb56e772b95adab91d8c6b 100644
(file)
--- a/
manager/usage.lsp
+++ b/
manager/usage.lsp
@@
-1,20
+1,21
@@
(load "expand-string.lsp")
(load "expand-string.lsp")
+(constant
+ 'USAGEFILE SITE:control.usage.dat
+ 'EXTRAFILE SITE:control.extra.dat
+ )
+
(when (= (env "REQUEST_METHOD") "POST")
(load "usage-extra.lsp")
)
(when (= (env "REQUEST_METHOD") "POST")
(load "usage-extra.lsp")
)
-(define (get-remote-user) REMOTE_USER)
-
(constant
(constant
- 'ADMIN (member REMOTE_USER '("ralph" "lin"))
- 'USAGE (read-expr (read-file "usage.dat"))
- 'extra-options '(0 10 30 60)
- 'EXTRAFILE "control-extra.dat"
+ 'USAGE (read-expr (read-file USAGEFILE))
'EXTRATM (file-info EXTRAFILE 6)
'EXTRATM (file-info EXTRAFILE 6)
- 'TM (date-value)
'EXTRA (and (regex "([0-9]+) ([0-9]+)" (or (read-file EXTRAFILE) "") 0)
(list (int $1 0 10) (int $2 0 10)))
'EXTRA (and (regex "([0-9]+) ([0-9]+)" (or (read-file EXTRAFILE) "") 0)
(list (int $1 0 10) (int $2 0 10)))
+ 'TM (date-value)
+ 'extra-options '(0 10 30 60)
)
(define (tm2time tm)
)
(define (tm2time tm)
@@
-29,5
+30,6
@@
(when (and EXTRATM EXTRA (>= TM EXTRATM))
(setf X (tm2time (- (+ EXTRATM (time2tm EXTRA)) TM))))
(when (and EXTRATM EXTRA (>= TM EXTRATM))
(setf X (tm2time (- (+ EXTRATM (time2tm EXTRA)) TM))))
+(println "Status 200 OK\nContent-Type: text/html\n\n")
(println (expand-file "tmpl/usage-form.html" ))
(exit 0)
(println (expand-file "tmpl/usage-form.html" ))
(exit 0)