Class UserInfo
The UserInfo class provides Business Layer model for Users.
Inherited Members
Namespace: DotNetNuke.Entities.Users
Assembly: DotNetNuke.dll
Syntax
public class UserInfo : BaseEntityInfo, IPropertyAccess, IUserInfo
Constructors
| Improve this Doc View SourceUserInfo()
Initializes a new instance of the UserInfo class.
Declaration
public UserInfo()
Properties
| Improve this Doc View SourceAffiliateID
Gets or sets the AffiliateId for this user.
Declaration
public int AffiliateID { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Cacheability
Gets the cache level for property access.
Declaration
public CacheLevel Cacheability { get; }
Property Value
| Type | Description |
|---|---|
| CacheLevel |
DisplayName
Gets or sets the Display Name.
Declaration
public string DisplayName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Gets or sets the Email Address.
Declaration
public string Email { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
FirstName
Gets or sets the First Name.
Declaration
public string FirstName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
HasAgreedToTerms
Gets or sets a value indicating whether the user has agreed to the terms and conditions.
Declaration
public bool HasAgreedToTerms { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
HasAgreedToTermsOn
Gets or sets when the user last agreed to the terms and conditions.
Declaration
public DateTime HasAgreedToTermsOn { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
IsAdmin
Gets a value indicating whether the user is in the portal's administrators role.
Declaration
public bool IsAdmin { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsDeleted
Gets or sets a value indicating whether the User is deleted.
Declaration
public bool IsDeleted { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsSuperUser
Gets or sets a value indicating whether the User is a SuperUser.
Declaration
public bool IsSuperUser { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LastIPAddress
Gets or sets the Last IP address used by user.
Declaration
public string LastIPAddress { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
LastName
Gets or sets the Last Name.
Declaration
public string LastName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Membership
Gets or sets the Membership object.
Declaration
public UserMembership Membership { get; set; }
Property Value
| Type | Description |
|---|---|
| UserMembership |
PasswordResetExpiration
Gets or sets the datetime that the PasswordResetToken is valid.
Declaration
public DateTime PasswordResetExpiration { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
PasswordResetToken
Gets or sets the token created for resetting passwords.
Declaration
public Guid PasswordResetToken { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid |
PortalID
Gets or sets the PortalId.
Declaration
public int PortalID { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Profile
Gets or sets the Profile Object.
Declaration
public UserProfile Profile { get; set; }
Property Value
| Type | Description |
|---|---|
| UserProfile |
RequestsRemoval
Gets or sets a value indicating whether the user has requested they be removed from the site.
Declaration
public bool RequestsRemoval { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Roles
The UserInfo class provides Business Layer model for Users.
Declaration
public string[] Roles { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String[] |
Social
Gets and sets the Social property.
Declaration
public UserSocial Social { get; }
Property Value
| Type | Description |
|---|---|
| UserSocial |
UserID
Gets or sets the User Id.
Declaration
public int UserID { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Username
Gets or sets the User Name.
Declaration
public string Username { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
VanityUrl
The UserInfo class provides Business Layer model for Users.
Declaration
public string VanityUrl { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
| Improve this Doc View SourceGetProperty(String, String, CultureInfo, UserInfo, Scope, ref Boolean)
Property access, initially provided for TokenReplace.
Declaration
public string GetProperty(string propertyName, string format, CultureInfo formatProvider, UserInfo accessingUser, Scope currentScope, ref bool propertyNotFound)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | propertyName | Name of the Property. |
| System.String | format | format string. |
| CultureInfo | formatProvider | format provider for numbers, dates, currencies. |
| UserInfo | accessingUser | userinfo of the user, who queries the data (used to determine permissions). |
| Scope | currentScope | requested maximum access level, might be restricted due to user level. |
| System.Boolean | propertyNotFound | out: flag, if property could be retrieved. |
Returns
| Type | Description |
|---|---|
| System.String | current value of the property for this userinfo object. |
IsInRole(String)
IsInRole determines whether the user is in the role passed.
Declaration
public bool IsInRole(string role)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | role | The role to check. |
Returns
| Type | Description |
|---|---|
| System.Boolean | A Boolean indicating success or failure. |
LocalTime()
Gets current time in User's timezone.
Declaration
public DateTime LocalTime()
Returns
| Type | Description |
|---|---|
| DateTime | The time in the user's (or portal's) preferred time zone. |
LocalTime(DateTime)
Convert utc time in User's timezone.
Declaration
public DateTime LocalTime(DateTime utcTime)
Parameters
| Type | Name | Description |
|---|---|---|
| DateTime | utcTime | Utc time to convert. |
Returns
| Type | Description |
|---|---|
| DateTime | The time in the user's (or portal's) preferred time zone. |
UpdateDisplayName(String)
UpdateDisplayName updates the displayname to the format provided.
Declaration
public void UpdateDisplayName(string format)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | format | The format to use. |