Forum OpenACS Development: Re: Templates & Security

Collapse
Posted by Dave Bauer on
Malte,

I have been thinking about this for awhile. What I think is the best idea is to define an alternative adp location for each package instance. Either through a package instance parameter, or just a parallel directory tree, possible under openacs-4/templates which mirrors the site-map.

Doing this requires a small change to ad_return_template which sets what template file to use.  And of course, make sure all the tcl files that return a page explicity call ad_return_template.

In addition, programmers should set the -properties section in the tcl file to document what variables are available to use in the adp file. Then they can easily be offered on the edit page.

For security, disallowing tcl code in adps, and adding additional adp tags to make it easier to add functions to pages should be helpful.

Of course, if more packages used the content repository, we could use the template assignment features of the content repository to figure out which template to use to display a page. The old CMS package actually parses the CR templates, and implements its own additional tags to make it easier for template editors.

I look forward to getting this working.