Index: openacs-4/packages/static-pages/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/www/index.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/static-pages/www/index.adp 27 Apr 2004 12:07:20 -0000 1.1 @@ -0,0 +1,4 @@ + + static files + +@listing;noquote@ Index: openacs-4/packages/static-pages/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/www/index.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/static-pages/www/index.tcl 20 Apr 2001 20:51:22 -0000 1.1 +++ openacs-4/packages/static-pages/www/index.tcl 27 Apr 2004 12:07:20 -0000 1.2 @@ -1,11 +1,33 @@ # packages/static-pages/www/index.tcl ad_page_contract { - Redirect to admin/. + If static pages fs_root is set to a directory which + exists in www/ then display the static files at the + fs_root for this instance. Otherwise simply redirect to + admin. - @author Brandoch Calef (bcalef@arsdigita.com) + this makes it possible to eg. create a static doc tree for + a community mounted at example.com/c1 and if fs_root is set + to /www/c1/static and static pages is mounted at example/c1/static + then the files in the static tree can simply be browsed. + + It should probably check for a /www/c1/static/index.html or index.htm page + though. + + @author Jeff Davis (davis@xarg.net) @creation-date 2001-02-23 @cvs-id $Id$ } { } -ad_returnredirect "admin/" +# if the mount point is the package_url and there is a directory there then show +# the files in the filesystem otherwise jump to the admin page +set fs_root [string trimright [parameter::get -parameter fs_root] /] + +if {[string equal "$fs_root/" "/www[ad_conn package_url]"] + && [file isdirectory "[acs_root_dir]$fs_root"] +} { + set listing [rp_html_directory_listing [acs_root_dir]$fs_root] +} else { + ad_returnredirect "admin/" +} +