The Authenticator is a pluggable interface. This can be implemented to make it work with an external system, or with a normal wikipage, or even a flat text-file.
The code:
package ... public abstract class Authenticator { public boolean Login(String username, String password, HttpServletRequest request){ Wiki wiki = ...; WikiUserPrincipal user = getWikiUserPrincipal(username,password,wiki); if ( user == null) return false; else request.getSession.setAttribute("user", user); } /** * This method is responsible for controlling the username and password against * some persistently saved mapping of these. The method returns a WikiUserPrincipal if * the user can log in else null is returned (Maybe an exception or error should be thrown instead). */ protected abstract WikiUserPrincipal getWikiUserPrincipal(String username, String password, WikiEngine wiki); }
Add new attachment
Only authorized users are allowed to upload new attachments.