This reverts commit a61a83d.
* If set to 'modify', authentication is required to modify the wiki. * If set to 'read', atuhentication is required to view the wiki. * If set to 'none', authentication is never required, and pages can be edited anonymously. API changes: * currentUser moved to Authentication module * requireAuthentication added to Config * Added AuthenticationLevel type * requireUser renamed authenticate, parameter for AuthenticationLevel added; requireUserThat renamed authenticateUserThat
…a meaningful error message
Including: /_feed/a/b, foo/bar (no leading slash), etc.
+ Now the currently logged in user is taken from the REMOTE_USER request header. + This can be set externally (as by mod_auth_cas) or by a gitit filter that runs before the other wiki handlers. + This gitit filter, withUser, is set in config and will differ depending on whether we're using form authentication (in which case the user will be extracted from a session) or http authentication (in which case it will be extracted from the "authorization" request header). (When we're using gitit with an external system that sets REMOTE_USER, we can set this to id.) + Config also specifies authHandler, which includes handlers for urls like _login and _logout. This can be set to use the form-based authentication handlers or a pared-down logout handler for HTTP authentication. + The requireUser combinator checks that a user is logged in before running a handler; if not, we divert to the _login page with a 'destination' parameter with the URL to return to. This replaces the old ifLoggedIn. + A GET parameter is now used for 'destination', rather than a cookie. Also, we try not to rely on 'referer' except as a fallback.
+ Config sets these appropriately. + They can be specified in a calling program. + The login/out box is now no longer hidden when non-form authentication is used.
Reason: if the base url is /wiki, and you are browsing /wiki, then wikilinks that are relative URLS will not work correctly. For example, "Help" will take you to /Help rather than /wiki/Help. The simple solution is to ensure that users are always at /wiki/ rather than /wiki. This has no effect when gitit is being served at the root url. Thanks to MightyByte for pointing out the problem.