Ticket #33 (new enhancement)
Customizable no-edit pages
| Reported by: | Randy Selzler <RSelzler@…> | Owned by: | sheep |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | Hatta Wiki | Version: | unknown |
| Keywords: | Cc: | RSelzler@… |
Description
When users attempt to edit a page, but it's not allowed, I'd like to render a page with a custom hint.
For example, if login is required to edit Wiki pages, but the user clicks 'Edit' before logging in (or types an explicit '+edit' into the URL, or clicks a link that begins with '+edit'), then a custom page could suggest what actions are possible. The 'suggestion' might be a login prompt, request for a forgotten password or new user registration form.
Other special pages might be configurable too. If the entire Wiki is read-only, then a page might explain why. If the page is 'Locked', then suggest how to contact admin for help. If the page is a directory, instead of a file, a custom error might be explain the problem in terms that are appropriate for the target audience.
This enhancement request may overlap existing ones for 'Better error pages', but Trac admin can sort that out.
I'm also still hoping to get an 'Edit prologue' feature :D

Since access control is done by a web server, not by Hatta, you need to refer to the web server's documentation about setting up custom error pages. I know that Apache can do that, for example. This would handle the first use case.
The idea of making the error pages configurable sounds nice. As you noted, this depends on the ticket #31 -- not sure how easy it would be. One problem I already foresee is about the error message itself: the same error code may display different messages, depending on where it is raised. This is nice, because the messages can be very specific and informative, and they can contain things like page names and other additional information.
There is however currently no way to incorporate that in the custom pages, except for defining a separate page for every possible error message, which doesn't sound too good.