aboutsummaryrefslogtreecommitdiff
path: root/index.scml
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-03-24 22:56:22 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-03-24 22:56:22 +0000
commit3ddec4614a394b2d2840f72ec43520a7562c38f9 (patch)
tree801b4c8364856e65d010b2a4dba976c116a83eae /index.scml
parent6857163a55a2c2915bb0a4fc5376dce6180bbaa4 (diff)
downloadellinika-3ddec4614a394b2d2840f72ec43520a7562c38f9.tar.gz
ellinika-3ddec4614a394b2d2840f72ec43520a7562c38f9.tar.bz2
Fetch the dispatcher page if no suitable language has been selected.
git-svn-id: file:///home/puszcza/svnroot/ellinika/trunk@412 941c8c0f-9102-463b-b60b-cd22ce0e6858
Diffstat (limited to 'index.scml')
-rw-r--r--index.scml16
1 files changed, 6 insertions, 10 deletions
diff --git a/index.scml b/index.scml
index 0201d5b..8d8e51d 100644
--- a/index.scml
+++ b/index.scml
@@ -18,9 +18,9 @@
;;;;
(define ellinika-document-root "/home/gray/public_html/ellinika")
-(define ellinika-default-language "ru")
+(define ellinika-dispatcher "disp.html")
-(define (get-dir-name)
+(define (get-file-name)
(call-with-current-continuation
(lambda (return)
(for-each
@@ -29,12 +29,8 @@
(suff (list #\. #\_)))
(let ((dir (string-append ellinika-document-root "/" slang)))
(cond
- ((catch 'system-error
- (lambda ()
- (eq? (stat:type (stat dir)) 'directory))
- (lambda args
- #f))
- (return dir))
+ ((access? (string-append dir "/index.html") R_OK)
+ (return (string-append dir "/index.html")))
((not (null? suff))
(let ((p (let itr ((sl suff))
(if (null? sl)
@@ -57,10 +53,10 @@
(string-split
(table:get (request-rec:subprocess-env Request) "HTTP_ACCEPT_LANGUAGE")
#\,)))
- (string-append ellinika-document-root "/" ellinika-default-language))))
+ (string-append ellinika-document-root "/" ellinika-dispatcher))))
(with-input-from-file
- (string-append (get-dir-name) "/intro.html")
+ (get-file-name)
(lambda ()
(do ((line (read-line) (read-line)))
((eof-object? line))

Return to:

Send suggestions and report system problems to the System administrator.