Forum OpenACS Q&A: turn off index view

Collapse
Posted by David Kuczek on
How do I turn off the index view on aolserver?

For example: I have no index.tcl file in a certain directory like
/graphics or /images, but I don't want that everybody sees what files
are in that folder...

Thanks

Collapse
Posted by Don Baccus on
Try setting "directoryfile=index.html" in your server's parameter section (/ns/server/server-name).  If it doesn't find it you should get an error message.
Collapse
Posted by David Kuczek on
Hello Don,

I originall had:

set directoryfile          index.adp,index.tcl,index.html,index.htm

so I switched it to:

set directoryfile          index.html

but not that much happened... (I can still see all the files in /images although I don't have a index.html in there)

This is the sample nsd.tcl from the documentation...

Collapse
Posted by David Walker on
if you have abstract urls enabled I don't think the server cares what you set for directory file. It looks to me like any index.* file will be served.

There is code so that you can set directorylisting "none" and the index file will not be shown but it doesn't work without the following change.

change the following line in ad-abstract-url.tcl from
if { [string compare $listings "fancy"] || [string compare $listings "simple"] }  {
to
if { [string match $listings "fancy"] || [string match $listings "simple"] }  {
then "ns_param directorylisting none" in the "ns/server/${server}" section of your config file should work fine
Collapse
Posted by David Walker on
upon further review
if { [string equal $listings "fancy"] || [string equal $listings "simple"] }  {
would be even better
Collapse
Posted by David Kuczek on
Hello David,

I just tried what you said.

The problem is that the server doesn't recognize files like one-folder?file_id=xyz inside file-storage... You would have to rename it to one-folder.tcl?file_id=xyz...

Buuuut if you keep the ad-abstract-url.tcl file in its original state (compare) and just set "ns_param  directorylisting  none" in the server file everything works like a charm (although there is a comment in the server file: # Can be simple or fancy)

Thanks

Collapse
Posted by David Walker on
check your server log (grep Error /usr/local/aolserver/log/*.log). if you mistyped anything the function will not be created and abstract urls will cease to function.