123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
;; log-port
;; logfile
;; seen-pages
;; page-dir-style ;; #t = new style, #f = old style
;; debugmode))
;; SPLIT INTO STRAIGHT FORWARD INIT AND COMPLEX INIT
(define (initialize self)
(sdat-set-dbtype! self 'pg)
(sdat-set-page! self "home") ;; these are defaults
(sdat-set-curr-page! self "home")
(sdat-set-content-type! self "Content-type: text/html; charset=iso-8859-1\n\n")
(sdat-set-page-type! self 'html)
(sdat-set-toppage! self "index")
(sdat-set-params! self '()) ;;
|
|
|
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
;; log-port
;; logfile
;; seen-pages
;; page-dir-style ;; #t = new style, #f = old style
;; debugmode))
;; SPLIT INTO STRAIGHT FORWARD INIT AND COMPLEX INIT
(define (session:initialize self)
(sdat-set-dbtype! self 'pg)
(sdat-set-page! self "home") ;; these are defaults
(sdat-set-curr-page! self "home")
(sdat-set-content-type! self "Content-type: text/html; charset=iso-8859-1\n\n")
(sdat-set-page-type! self 'html)
(sdat-set-toppage! self "index")
(sdat-set-params! self '()) ;;
|
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
|
"DELETE FROM session_vars WHERE session_id=?;"
"DELETE FROM sessions WHERE id=?;"
"COMMIT;"))
(conn (sdat-get-conn self)))
(if session-id
(begin
(dbi:exec conn qry session-id session-id)
(initialize self '())
(session:setup self)))
(not (session:get-session-id self session-key))))
;; (define (session:delete-session self session-key)
;; (let ((session-id (session:get-session-id self session-key))
;; (queries (list "BEGIN;"
;; "DELETE FROM session_vars WHERE session_id=?;"
|
|
|
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
|
"DELETE FROM session_vars WHERE session_id=?;"
"DELETE FROM sessions WHERE id=?;"
"COMMIT;"))
(conn (sdat-get-conn self)))
(if session-id
(begin
(dbi:exec conn qry session-id session-id)
(session:initialize self)
(session:setup self)))
(not (session:get-session-id self session-key))))
;; (define (session:delete-session self session-key)
;; (let ((session-id (session:get-session-id self session-key))
;; (queries (list "BEGIN;"
;; "DELETE FROM session_vars WHERE session_id=?;"
|