|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.meshcms.core.UserInfo
Profile of a user. Modifications made by calling the set methods are not
stored until you use store(org.meshcms.core.WebSite)
.
Field Summary | |
static int |
ADMIN
Permissions for an administrator (full permissions). |
static int |
CAN_ADD_USERS
Permission to add other users. |
static int |
CAN_BROWSE_FILES
Permission to browse files. |
static int |
CAN_DO_ADMINTASKS
Permission to do maintainance operations. |
static int |
CAN_EDIT_PAGES
Permission to edit pages (in the home path of the user profile). |
static int |
CAN_MANAGE_FILES
Permission to manage files. |
static int |
CAN_VIEW_OTHER_USERINFO
Permission to view other user profiles. |
static java.lang.String[] |
DETAILS
Names for user detail fields. |
protected static java.lang.String |
E_MAIL
|
static int |
EDITOR
Permissions for an editor (can edit files, but is not an administrator). |
protected boolean |
global
|
static int |
GUEST
Permissions for guest user (non-logged in). |
protected static java.lang.String |
HOME_PATH
|
protected java.util.Properties |
info
|
protected static java.lang.String |
LANGUAGE
|
static int |
MEMBER
Permissions for a member (can't edit files). |
protected static java.lang.String |
PASSWORD
|
protected static java.lang.String |
PERMISSIONS
|
protected static java.lang.String |
SALT
|
protected static java.lang.String |
USERNAME
|
protected static java.lang.String |
VALID_USERNAME_CHARS
Characters allowed in a username. |
Constructor Summary | |
UserInfo()
Creates a new empty instance. |
Method Summary | |
boolean |
canDo(int what)
Verifies the permissions to do a certain thing. |
boolean |
canWrite(WebSite webSite,
Path filePath)
Verifies all permissions to write the file at a certain path in the web application. |
boolean |
exists(WebSite webSite,
java.lang.String username)
Checks if the user exists. |
java.lang.String |
getDetailName(int index)
Returns the name of the user detail at the given index. |
java.lang.String |
getDetailValue(java.lang.String name)
Returns the value of the given user detail. |
java.lang.String |
getDisplayName()
Returns a string suitable to describe the user. |
java.lang.String |
getEmail()
Returns the user's e-mail address. |
Path |
getHomePath()
Returns the user's home path. |
java.lang.String |
getPassword()
Returns the user's (encrypted) password. |
int |
getPermissions()
Returns the user's permissions. |
java.lang.String |
getPreferredLocaleCode()
Returns the preferred locale for the user, in a form like en_US , it or similar. |
java.lang.String |
getUsername()
Returns the user's username. |
java.lang.String |
getValue(java.lang.String name)
Returns the value of a specific property. |
boolean |
isGlobal()
|
boolean |
isGuest()
Checks if the user is a guest. |
boolean |
load(WebSite webSite,
java.lang.String username,
java.lang.String password)
Loads a specific user. |
void |
loadGuest()
Loads the guest user. |
boolean |
setDetail(java.lang.String name,
java.lang.String value)
Sets a user's detail. |
boolean |
setEmail(java.lang.String email)
Sets the e-mail address of this user. |
void |
setHomePath(Path homePath)
Sets the home path for the user. |
void |
setPassword(java.lang.String password)
Sets the password for this user. |
void |
setPermissions(int permissions)
Sets permissions for the user. |
void |
setPreferredLocaleCode(java.lang.String localeCode)
Sets the preferred locale for the user. |
void |
setUsername(java.lang.String username)
Sets the username for this user. |
boolean |
store(WebSite webSite)
Stores the user's profile in a file. |
boolean |
updatePassword(java.lang.String oldPassword,
java.lang.String newPassword)
Sets the password for this user after verification of the old password. |
boolean |
verifyPassword(java.lang.String password)
Verifies the given password agains the one in the current profile. |
static boolean |
verifyUsername(java.lang.String username)
Checks if the username is valid (i.e. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CAN_ADD_USERS
public static final int CAN_EDIT_PAGES
public static final int CAN_MANAGE_FILES
public static final int CAN_VIEW_OTHER_USERINFO
public static final int CAN_DO_ADMINTASKS
public static final int CAN_BROWSE_FILES
public static final int GUEST
public static final int MEMBER
public static final int EDITOR
public static final int ADMIN
protected static final java.lang.String USERNAME
protected static final java.lang.String PASSWORD
protected static final java.lang.String HOME_PATH
protected static final java.lang.String PERMISSIONS
protected static final java.lang.String E_MAIL
protected static final java.lang.String LANGUAGE
public static final java.lang.String[] DETAILS
protected static final java.lang.String VALID_USERNAME_CHARS
protected static final java.lang.String SALT
protected java.util.Properties info
protected boolean global
Constructor Detail |
public UserInfo()
load(org.meshcms.core.WebSite, java.lang.String, java.lang.String)
to load a defined user.
Method Detail |
public void setUsername(java.lang.String username)
public java.lang.String getUsername()
public void setPassword(java.lang.String password)
public boolean updatePassword(java.lang.String oldPassword, java.lang.String newPassword)
public java.lang.String getPassword()
public boolean setEmail(java.lang.String email)
Utils.checkAddress(java.lang.String)
is used to verify the new
address.
public java.lang.String getEmail()
public void setHomePath(Path homePath)
public Path getHomePath()
public void setPermissions(int permissions)
public int getPermissions()
public java.lang.String getPreferredLocaleCode()
en_US
, it
or similar.
public void setPreferredLocaleCode(java.lang.String localeCode)
public void loadGuest()
public boolean load(WebSite webSite, java.lang.String username, java.lang.String password)
public boolean store(WebSite webSite)
public static boolean verifyUsername(java.lang.String username)
VALID_USERNAME_CHARS
only).
public boolean verifyPassword(java.lang.String password)
public boolean canDo(int what)
user.canDo(UserInfo.CAN_EDIT_PAGES)
public boolean canWrite(WebSite webSite, Path filePath)
public boolean setDetail(java.lang.String name, java.lang.String value)
DETAILS
. Other details can be set, but they will not be stored
when store(org.meshcms.core.WebSite)
is called.
getValue(java.lang.String)
public java.lang.String getValue(java.lang.String name)
setDetail(java.lang.String, java.lang.String)
public java.lang.String getDetailValue(java.lang.String name)
public java.lang.String getDetailName(int index)
public java.lang.String getDisplayName()
public boolean isGuest()
public boolean exists(WebSite webSite, java.lang.String username)
public boolean isGlobal()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |