public class XWikiUser extends Object
Modifier and Type | Field and Description |
---|---|
static LocalDocumentReference |
ACCOUNT_VALIDATION_DOCUMENT_REFERENCE |
static String |
ACTIVE_PROPERTY
The name of the property that store the active status of the user.
|
static String |
EMAIL_CHECKED_PROPERTY
The name of the property that store the information if an email was checked for the user.
|
Constructor and Description |
---|
XWikiUser(DocumentReference userReference)
Create a XWikiUser from its document reference and infer if the user is global or not based on the wiki part of
this reference.
|
XWikiUser(DocumentReference userReference,
boolean main)
Create a XWikiUser from its document reference and set the main flag.
|
XWikiUser(String user)
Deprecated.
since 11.6RC1 use
XWikiUser(DocumentReference) . |
XWikiUser(String user,
boolean main)
Deprecated.
since 11.6RC1 use
XWikiUser(DocumentReference, boolean) . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
boolean |
exists(XWikiContext context) |
String |
getFullName() |
String |
getUser()
Deprecated.
since 11.6RC1 use
getFullName() . |
DocumentReference |
getUserReference() |
boolean |
isDisabled(XWikiContext context) |
boolean |
isEmailChecked(XWikiContext context) |
boolean |
isMain()
See if the user is global (i.e.
|
boolean |
isUserInGroup(String groupName,
XWikiContext context)
Check if the user belongs to a group or not.
|
void |
setDisabled(boolean disable,
XWikiContext context) |
void |
setEmailChecked(boolean checked,
XWikiContext context) |
void |
setMain(boolean main) |
void |
setUser(String user) |
String |
toString() |
public static final String ACTIVE_PROPERTY
public static final String EMAIL_CHECKED_PROPERTY
public static final LocalDocumentReference ACCOUNT_VALIDATION_DOCUMENT_REFERENCE
public XWikiUser(DocumentReference userReference)
isMain()
for more information.userReference
- the document reference of the user.public XWikiUser(DocumentReference userReference, boolean main)
isMain()
).userReference
- the document reference of the user.main
- true if the user is global (i.e. registered in the main wiki)@Deprecated public XWikiUser(String user)
XWikiUser(DocumentReference)
.user
- the full name of the user on the form XWiki.Foo.@Deprecated public XWikiUser(String user, boolean main)
XWikiUser(DocumentReference, boolean)
.user
- the full name of the user on the form XWiki.Foo.main
- true if the user is global (i.e. registered in the main wiki)@Deprecated public String getUser()
getFullName()
.public String getFullName()
public DocumentReference getUserReference()
public boolean isEmailChecked(XWikiContext context)
context
- used to retrieve the user document.public void setEmailChecked(boolean checked, XWikiContext context)
checked
- true if the email address was checked for the user. False if it wasn't checked.context
- used to retrieve the user document.public boolean isDisabled(XWikiContext context)
context
- used to retrieve the user document.public void setDisabled(boolean disable, XWikiContext context)
disable
- true if the user disabled the account. False to enable the account.context
- used to retrieve the user document.public boolean exists(XWikiContext context)
context
- used to retrieve the user document.public void setUser(String user)
public boolean isUserInGroup(String groupName, XWikiContext context) throws XWikiException
groupName
- The group to check.context
- The current context
.XWikiException
- If an error occurs when checking the groups.public boolean isMain()
public void setMain(boolean main)
Copyright © 2004–2022 XWiki. All rights reserved.