Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-templating/www/doc/demo/compile.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-templating/www/doc/demo/compile.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/compile.tcl,v diff -u -r1.1.1.1.30.1 -r1.1.1.1.30.2 --- openacs-4/packages/acs-templating/www/doc/demo/compile.tcl 10 Sep 2015 08:22:09 -0000 1.1.1.1.30.1 +++ openacs-4/packages/acs-templating/www/doc/demo/compile.tcl 24 May 2016 09:11:28 -0000 1.1.1.1.30.2 @@ -1,18 +1,23 @@ -set file [ns_queryget file] +ad_page_contract { -if { [regexp {\.\.|^/} $file] } { + View compiled file + (Part of demo pages) - set compiled "Only files within this directory may be shown." - -} else { - - # [ns_url2file [ns_conn url]] fails under request processor ! - # the file for URL pkg/page may be in packages/pkg/www/page, not www/pkg/page - set dir [file dirname [ad_conn file]] - set compiled [ns_quotehtml [template::adp_compile -file $dir/$file]] +} { + file:trim,notnull +} -validate { + valid_file -requires file { + if { [regexp {\.\.|^/} $file] } { + ad_complain "Only files within this directory may be shown." + } + } } + +# [ns_url2file [ns_conn url]] fails under request processor ! +# the file for URL pkg/page may be in packages/pkg/www/page, not www/pkg/page -ns_return 200 text/html "
$compiled
" +set dir [file dirname [ad_conn file]] +set compiled [template::adp_compile -file $dir/$file] # Local variables: # mode: tcl Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-templating/www/doc/demo/show.adp'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/acs-templating/www/doc/demo/show.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/demo/show.tcl,v diff -u -r1.3.2.2 -r1.3.2.3 --- openacs-4/packages/acs-templating/www/doc/demo/show.tcl 10 Sep 2015 08:22:12 -0000 1.3.2.2 +++ openacs-4/packages/acs-templating/www/doc/demo/show.tcl 24 May 2016 09:11:28 -0000 1.3.2.3 @@ -1,44 +1,29 @@ ad_page_contract { - small demp + small demo source viewer @author unknown @creation-date unknown @cvs-id $Id$ } { - {file:token ""} -} + file:trim,notnull +} -validate { + valid_file -requires file { + if { [regexp {\.\.|^/} $file] } { + ad_complain "Only files within this directory may be shown." + } + set dir [file dirname [ad_conn file]] + if {![file readable $dir/$file]} { + ad_complain "The specified file ist not readable" + } + } +} -if { $file eq "" } { +# +# [ns_url2file [ns_conn url]] fails under request processor, since +# the request processor manges the provided url path. +# +set source [template::util::read_file $dir/$file] - set output "no file specified" - -} elseif { [regexp {\.\.|^/} $file] } { - - set output "Only files within this directory may be shown." - -} else { - # - # [ns_url2file [ns_conn url]] fails under request processor, since - # the request processor manges the provided url path. - # - set dir [file dirname [ad_conn file]] - if {[file readable $dir/$file]} { - # - # Probably, one should in real life the file with - # ns_returnfile, since the file might contain binary - # characters... but for this sample script, we return - # everything as html. - # - set text [ns_quotehtml [template::util::read_file $dir/$file]] - set output "
$text
" - } else { - set output "The specified file not readable" - # probably, we should return a 404 error, not a success status code - } -} - -ns_return 200 text/html $output - # Local variables: # mode: tcl # tcl-indent-level: 4