| java.lang.Object com.ecyrd.jspwiki.auth.UserManager
UserManager | public class UserManager (Code) | | Manages user accounts, logins/logouts, passwords, etc.
author: Janne Jalkanen author: Erik Bunn |
Constructor Summary | |
public | UserManager(WikiEngine engine, Properties props) Creates an UserManager instance for the given WikiEngine and
the specified set of properties. |
Method Summary | |
public SSOToken | getAdminSSOToken() | public WikiAuthenticator | getAuthenticator() Returns the WikiAuthenticator object employed by this UserManager. | public List | getGroupsForPrincipal(Principal user) Returns a list of all WikiGroups this Principal is a member
of. | public Principal | getPrincipal(String name) Attempts to find a Principal from the list of known principals. | public String | getUserCommonName(String userid) | public UserDatabase | getUserDatabase() Returns the UserDatabase employed by this UserManager. | public UserProfile | getUserProfile(String name) Convenience shortcut to UserDatabase.getUserProfile(). | public UserProfile | getUserProfile(HttpServletRequest request) Gets a UserProfile, either from the request (presumably
authenticated and with auth information) or a new one
(with default permissions).
Parameters: request - The servlet request for this user. | public WikiGroup | getWikiGroup(String name) Returns a WikiGroup instance for a given name. | public boolean | isAdministrator(WikiPrincipal p) Returns true, if the user or the group represents a super user,
which should be allowed access to everything.
Parameters: p - Principal to check for administrator access. | protected UserProfile | limitedLogin(HttpServletRequest request) Performs a "limited" login: sniffs for a user name from a cookie or the
client, and creates a limited user profile based on it. | public boolean | login(String username, String password, HttpSession session) Attempts to perform a login for the given username/password
combination. | public void | logout(HttpSession session) Logs a web user out, clearing the session. | public void | setUserCookie(HttpServletResponse response, String name) Sets the username cookie. |
GROUP_KNOWNPERSON | final public static String GROUP_KNOWNPERSON(Code) | | |
GROUP_NAMEDGUEST | final public static String GROUP_NAMEDGUEST(Code) | | |
PROP_ADMINISTRATOR | final public static String PROP_ADMINISTRATOR(Code) | | |
PROP_AUTHENTICATOR | final public static String PROP_AUTHENTICATOR(Code) | | |
PROP_STOREIPADDRESS | final public static String PROP_STOREIPADDRESS(Code) | | If true, logs the IP address of the editor on saving.
|
PROP_USERDATABASE | final public static String PROP_USERDATABASE(Code) | | |
WIKIUSER | final public static String WIKIUSER(Code) | | The name the UserProfile is stored in a Session by.
|
UserManager | public UserManager(WikiEngine engine, Properties props) throws WikiException(Code) | | Creates an UserManager instance for the given WikiEngine and
the specified set of properties. All initialization for the
modules is done here.
|
getAdminSSOToken | public SSOToken getAdminSSOToken()(Code) | | |
getAuthenticator | public WikiAuthenticator getAuthenticator()(Code) | | Returns the WikiAuthenticator object employed by this UserManager.
|
getGroupsForPrincipal | public List getGroupsForPrincipal(Principal user) throws NoSuchPrincipalException(Code) | | Returns a list of all WikiGroups this Principal is a member
of.
|
getPrincipal | public Principal getPrincipal(String name)(Code) | | Attempts to find a Principal from the list of known principals.
|
getUserDatabase | public UserDatabase getUserDatabase()(Code) | | Returns the UserDatabase employed by this UserManager.
|
getUserProfile | public UserProfile getUserProfile(String name)(Code) | | Convenience shortcut to UserDatabase.getUserProfile().
|
getUserProfile | public UserProfile getUserProfile(HttpServletRequest request)(Code) | | Gets a UserProfile, either from the request (presumably
authenticated and with auth information) or a new one
(with default permissions).
Parameters: request - The servlet request for this user. A valid UserProfile. Can also return null in case it is not possibleto get an UserProfile. since: 2.1.10. |
getWikiGroup | public WikiGroup getWikiGroup(String name)(Code) | | Returns a WikiGroup instance for a given name. WikiGroups are cached,
so there is basically a singleton across the Wiki for a group.
The reason why this class caches them instead of the WikiGroup
class itself is that it is the business of the User Manager to
handle such issues.
Parameters: name - Name of the group. This is case-sensitive. A WikiGroup instance. |
isAdministrator | public boolean isAdministrator(WikiPrincipal p)(Code) | | Returns true, if the user or the group represents a super user,
which should be allowed access to everything.
Parameters: p - Principal to check for administrator access. true, if the principal is an administrator. |
limitedLogin | protected UserProfile limitedLogin(HttpServletRequest request)(Code) | | Performs a "limited" login: sniffs for a user name from a cookie or the
client, and creates a limited user profile based on it.
|
login | public boolean login(String username, String password, HttpSession session) throws WikiSecurityException(Code) | | Attempts to perform a login for the given username/password
combination. Also sets the attribute UserManager.WIKIUSER in the current session,
which can then be used to fetch the current UserProfile. Or you can be lazy and
just call getUserProfile()...
Parameters: username - The user name. This is an user name, not a WikiName. In most casesthey are the same, but in some cases, they might not be. Parameters: password - The password. true, if the username/password is valid. throws: PasswordException - , if password has expired |
logout | public void logout(HttpSession session)(Code) | | Logs a web user out, clearing the session.
Parameters: session - The current HTTP session for this user. |
|
|