Question
On pages protected from read (%ALLOWTOPICREAD% tag for instance), with the method
using a
viewauth script clone of the
view script, the %TOC% tag is not working
in the sense that clicking on headers in it just reload the page
- TWiki version: Sep 2001
- Web server: apache
- Server OS: linux
- Web browser: Netscape, opera
- Client OS: linux
The problem is that the links are of the form
/.../bin/view/Web/ToPic#header
But the URL of this page is of the form
/.../bin/viewauth/Web/ToPic
So for the browser, this link is non-local, it tries to reload the page and get lost in the
process
Possible solutions I can see:
- in view script, if we are in viewauth, replace strings /view/ by /viewauth/ in the relevant places
- change the base href=... tag to use viewauth
- define a new var %VIEWSCRIPT%, expansed to view or viewauth depending on the context
- use relative URLs for links (may be impossible for links into other topics)
--
ColasNahaboo - 23 Oct 2001
Answer
I implemented a low-tech (but effifient) solution based on
2: create a new template for
viewauth, with just the name of the script changed in it. This is done by a:
sed -e 's|URL%/view%SCRIPT|URL%/viewauth%SCRIPT|' <templates/view.tmpl >templates/viewauth.tmpl
- pro: it works with no overhead
- con: you must re-update the viewauth template if you change the view template (add a reminder comment in
templates/view.tmpl )
--
ColasNahaboo - 22 Nov 2001
This is fixed and in
TWikiAlphaRelease. The fix is in TWiki.pm, it figures out to use
viewauth instead of
view for TOC. See also
Codev.ViewAuthHandlingForTOC
--
PeterThoeny - 24 Nov 2001