Abstract UserDatabase class that provides convenience methods for finding
profiles, building Principal collections and hashing passwords.
author: Andrew R. Jaquith since: 2.3
find(String index) Looks up and returns the first
UserProfile in the user database
that whose login name, full name, or wiki name matches the supplied
string.
Looks up and returns the first
UserProfile in the user database
that whose login name, full name, or wiki name matches the supplied
string. This method provides a "forgiving" search algorithm for resolving
principal names when the exact profile attribute that supplied the name
is unknown.
Parameters: index - the login name, full name, or wiki name See Also:com.ecyrd.jspwiki.auth.user.UserDatabase.find(java.lang.String)
Looks up the Principals representing a user from the user database. These
are defined as a set of WikiPrincipals manufactured from the login name,
full name, and wiki name. If the user database does not contain a user
with the supplied identifier, throws a
NoSuchPrincipalException .
public boolean validatePassword(String loginName, String password)(Code)
Validates the password for a given user. If the user does not exist in
the user database, this method always returns false. If
the user exists, the supplied password is compared to the stored
password. Note that if the stored password's value starts with
{SHA}, the supplied password is hashed prior to the
comparison.
Parameters: loginName - the user's login name Parameters: password - the user's password (obtained from user input, e.g., a web form) true if the supplied user password matches thestored password See Also:com.ecyrd.jspwiki.auth.user.UserDatabase.validatePassword(java.lang.Stringjava.lang.String)