Class CPUserBaseClass
- Namespace
- Contensive.BaseClasses
- Assembly
- CPBase.dll
properties and methods that relate to the current user identity.
public abstract class CPUserBaseClass
- Inheritance
-
CPUserBaseClass
- Inherited Members
Properties
If autheticated, the current user's email
public abstract string Email { get; }
Property Value
Id
The user's id. If session tracking is disable, requesting the id will create a new guest user.
public abstract int Id { get; }
Property Value
IdInSession
The user's id. If session tracking is disable, requesting the id will return 0.
public abstract int IdInSession { get; }
Property Value
IsAdmin
true if the current user is authenticated and their identity is administrator role (checkbox in people record)
public abstract bool IsAdmin { get; }
Property Value
IsAuthenticated
is the current user authetnicated
public abstract bool IsAuthenticated { get; }
Property Value
IsDebugging
true if the current user is a developer and has turned on debugging
public abstract bool IsDebugging { get; }
Property Value
IsDeveloper
true if the current user is authenticated and their identity is the developer role (checkbox in people record)
public abstract bool IsDeveloper { get; }
Property Value
IsEditingAnything
true if the current user is editing any content
[Obsolete("Use IsEditing()", false)]
public abstract bool IsEditingAnything { get; }
Property Value
IsGuest
true if the current user is not authenticated and not recognized.
public abstract bool IsGuest { get; }
Property Value
IsMember
[Obsolete("Deprecated. Use another method to differentiate types of users, like groups, select lists, etc.", false)]
public abstract bool IsMember { get; }
Property Value
IsNew
true if the current user is not recognized and not authenticated
public abstract bool IsNew { get; }
Property Value
IsPageBuilderEditing
true if the current user is an administrator and editing with Page Builder (creating addon lists for pages)
public abstract bool IsPageBuilderEditing { get; }
Property Value
IsRecognized
true if the current user is recognized from their visitor record, but has not logged in as that identity
public abstract bool IsRecognized { get; }
Property Value
IsTemplateEditing
true if the current user is editing the template
public abstract bool IsTemplateEditing { get; }
Property Value
IsWorkflowRendering
[Obsolete("deprecated", false)]
public abstract bool IsWorkflowRendering { get; }
Property Value
Language
The language relfected in the browser metadata
public abstract string Language { get; }
Property Value
LanguageID
The id of the language relfected in the browser metadata
public abstract int LanguageID { get; }
Property Value
Name
If autheticated, the current user's name
public abstract string Name { get; }
Property Value
OrganizationID
If autheticated, the current user's organization
public abstract int OrganizationID { get; }
Property Value
Password
[Obsolete("Deprecated.", false)]
public abstract string Password { get; }
Property Value
Username
If autheticated, the current user's username
public abstract string Username { get; }
Property Value
Methods
ClearProperty(string)
remove the property
public abstract void ClearProperty(string key)
Parameters
keystring
GetBoolean(string)
Return the user property for the specified key.
public abstract bool GetBoolean(string key)
Parameters
keystring
Returns
GetBoolean(string, bool)
Return the user property for the specified key. If the key doesn't exist, save and return the default value.
public abstract bool GetBoolean(string key, bool defaultValue)
Parameters
Returns
GetBoolean(string, string)
[Obsolete("correct default type", false)]
public abstract bool GetBoolean(string PropertyName, string DefaultValue)
Parameters
Returns
GetDate(string)
Return the user property for the specified key.
public abstract DateTime GetDate(string key)
Parameters
keystring
Returns
GetDate(string, DateTime)
Return the user property for the specified key. If the key doesn't exist, save and return the default value.
public abstract DateTime GetDate(string key, DateTime defaultValue)
Parameters
Returns
GetDate(string, string)
[Obsolete("correct default type", false)]
public abstract DateTime GetDate(string PropertyName, string DefaultValue)
Parameters
Returns
GetIdByLogin(string, string)
Get a user's id from their username and password
public abstract int GetIdByLogin(string username, string password)
Parameters
Returns
GetInteger(string)
Return the user property for the specified key.
public abstract int GetInteger(string key)
Parameters
keystring
Returns
GetInteger(string, int)
Return the user property for the specified key. If the key doesn't exist, save and return the default value.
public abstract int GetInteger(string key, int defaultValue)
Parameters
Returns
GetInteger(string, string)
[Obsolete("correct default type", false)]
public abstract int GetInteger(string PropertyName, string DefaultValue)
Parameters
Returns
GetNumber(string)
Return the user property for the specified key.
public abstract double GetNumber(string key)
Parameters
keystring
Returns
GetNumber(string, double)
Return the user property for the specified key. If the key doesn't exist, save and return the default value.
public abstract double GetNumber(string key, double defaultValue)
Parameters
Returns
GetNumber(string, string)
[Obsolete("correct default type", false)]
public abstract double GetNumber(string PropertyName, string DefaultValue)
Parameters
Returns
GetObject<T>(string)
Return the user property for the specified key.
public abstract T GetObject<T>(string key)
Parameters
keystring
Returns
- T
Type Parameters
T
GetProperty(string)
[Obsolete("Use the Get method with the correct type.", false)]
public abstract string GetProperty(string key)
Parameters
keystring
Returns
GetProperty(string, string)
[Obsolete("Use the Get method with the correct type.", false)]
public abstract string GetProperty(string key, string defaultValue)
Parameters
Returns
GetProperty(string, string, int)
[Obsolete("Use the Get method with the correct type.", false)]
public abstract string GetProperty(string key, string defaultValue, int targetVisitId)
Parameters
Returns
GetText(string)
Return the user property for the specified key.
public abstract string GetText(string key)
Parameters
keystring
Returns
GetText(string, string)
Return the user property for the specified key. If the key doesn't exist, save and return the default value.
public abstract string GetText(string key, string defaultValue)
Parameters
Returns
IsAdvancedEditing()
is the current user advanced editing any content
public abstract bool IsAdvancedEditing()
Returns
IsAdvancedEditing(string)
is the current user advance editing the indicated content
public abstract bool IsAdvancedEditing(string contentName)
Parameters
contentNamestring
Returns
IsAuthoring(string)
[Obsolete("Use IsEditing()", true)]
public abstract bool IsAuthoring(string contentName)
Parameters
contentNamestring
Returns
IsContentManager()
true if the current user is authenticated and their identity is content manager role
public abstract bool IsContentManager()
Returns
IsContentManager(string)
true if the current user is authenticated and their identity is content manager role (in a content manager group)
public abstract bool IsContentManager(string contentName)
Parameters
contentNamestring
Returns
IsEditing()
true if the current user is editing anything
public abstract bool IsEditing()
Returns
IsEditing(string)
true if the current user is editing the content specified
public abstract bool IsEditing(string contentName)
Parameters
contentNamestring
Returns
IsInGroup(string)
true if the specified user is authenticted and in the specified group
public abstract bool IsInGroup(string groupName)
Parameters
groupNamestring
Returns
IsInGroup(string, int)
public abstract bool IsInGroup(string groupName, int userId)
Parameters
Returns
IsInGroupList(string)
true if the current user is authenticted and in one of the specified groups.
public abstract bool IsInGroupList(string groupIdCommaList)
Parameters
groupIdCommaListstring
Returns
IsInGroupList(string, int)
true if the specified user is authenticted and in one of the specified groups.
public abstract bool IsInGroupList(string groupIdCommaList, int checkUserID)
Parameters
Returns
IsNewLoginOK(int, string, string, ref string)
returns true if the credentials are valid, and not currently in user (the current user can use them)
public abstract bool IsNewLoginOK(int userId, string username, string password, ref string errorMessage)
Parameters
userIdintThe id of the user who wants to update their username and password
usernamestringpasswordstringerrorMessagestringif the result is false, this is a user compatible message that explains how they can fix the issue
Returns
IsNewLoginOK(string, string)
returns true if the credentials are valid, and not currently in user (the current user can use them)
public abstract bool IsNewLoginOK(string username, string password)
Parameters
Returns
IsQuickEditing(string)
true if the current user has turned on quick editing
public abstract bool IsQuickEditing(string contentName)
Parameters
contentNamestring
Returns
Login(string, string)
Autheticate the current user to the credentials provided. If the site property AllowEmailLogin is true, this method treats the first argument as either email or username. Duplicates and email=username matches are not allowed.
public abstract bool Login(string username, string password)
Parameters
Returns
Login(string, string, bool)
Autheticate the current user to the credentials provided. If the site property AllowEmailLogin is true, this method treats the first argument as either email or username. Duplicates and email=username matches are not allowed.
public abstract bool Login(string username, string password, bool setAutoLogin)
Parameters
usernamestringpasswordstringsetAutoLoginboolIf true, and allowed on the site, the user will be automatically logged in by their visitor cookie on future visits. Not available to admin or devloper roles.
Returns
LoginByID(int)
Autheticate the current user to the identity id provided.
public abstract bool LoginByID(int recordId)
Parameters
recordIdint
Returns
LoginByID(int, bool)
Autheticate the current user to the identity id provided. If the site property AllowEmailLogin is true, this method treats the first argument as either email or username. Duplicates and email=username matches are not allowed.
public abstract bool LoginByID(int recordId, bool setAutoLogin)
Parameters
Returns
LoginByID(string, bool)
[Obsolete("Use LoginById(integer) instead", false)]
public abstract bool LoginByID(string RecordID, bool SetAutoLogin = false)
Parameters
Returns
LoginIsOK(string, string)
returns true if the credentials provided are valid for a user in the system.
public abstract bool LoginIsOK(string username, string password)
Parameters
Returns
Logout()
logout the current user
public abstract void Logout()
Recognize(int)
Associate the current visit session to the visitor session, but leave the user not authenticated. This changes the user to isRecognized=true, isGuest=false, isAuthenticated=false
public abstract bool Recognize(int userID)
Parameters
userIDint
Returns
SetPassword(string)
Set the current user's password. If in plain-text password mode, the password field is populated, else the passwordHash field is populated. Return true if the password meets password policies.
public abstract bool SetPassword(string password)
Parameters
passwordstring
Returns
SetPassword(string, int)
Set the specific user's password. If in plain-text password mode, the password field is populated, else the passwordHash field is populated. Return true if the password meets password policies.
public abstract bool SetPassword(string password, int userId)
Parameters
Returns
SetPassword(string, int, ref string)
Set the specific user's password. If in plain-text password mode, the password field is populated, else the passwordHash field is populated. Return true if the password meets password policies. If error, return a user appropriate error message.
public abstract bool SetPassword(string password, int userId, ref string userErrorMessage)
Parameters
Returns
SetPassword(string, ref string)
Set the current user's password. If in plain-text password mode, the password field is populated, else the passwordHash field is populated. Return true if the password meets password policies. If error, return a user appropriate error message.
public abstract bool SetPassword(string password, ref string userErrorMessage)
Parameters
Returns
SetProperty(string, bool)
Set a user property for this type
public abstract void SetProperty(string key, bool value)
Parameters
SetProperty(string, bool, int)
Set a boolean user property for a specific user
public abstract void SetProperty(string key, bool value, int userId)
Parameters
SetProperty(string, DateTime)
Set a user property for this type
public abstract void SetProperty(string key, DateTime value)
Parameters
SetProperty(string, DateTime, int)
Set a datetime user property for a specific user
public abstract void SetProperty(string key, DateTime value, int userId)
Parameters
SetProperty(string, double)
Set a user property for this type
public abstract void SetProperty(string key, double value)
Parameters
SetProperty(string, double, int)
Set a number (double) user property for a specific user
public abstract void SetProperty(string key, double value, int userId)
Parameters
SetProperty(string, int)
Set a user property for this type
public abstract void SetProperty(string key, int value)
Parameters
SetProperty(string, int, int)
Set an integer user property for a specific user
public abstract void SetProperty(string key, int value, int userId)
Parameters
SetProperty(string, string)
Set a text user property
public abstract void SetProperty(string key, string value)
Parameters
SetProperty(string, string, int)
Set a text user property for a specific user
public abstract void SetProperty(string key, string value, int userId)
Parameters
Track()
If track users is disabled, this method begins tracking the current user
public abstract void Track()