Table of Contents

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

Email

If autheticated, the current user's email

public abstract string Email { get; }

Property Value

string

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

int

IdInSession

The user's id. If session tracking is disable, requesting the id will return 0.

public abstract int IdInSession { get; }

Property Value

int

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

bool

IsAuthenticated

is the current user authetnicated

public abstract bool IsAuthenticated { get; }

Property Value

bool

IsDebugging

true if the current user is a developer and has turned on debugging

public abstract bool IsDebugging { get; }

Property Value

bool

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

bool

IsEditingAnything

true if the current user is editing any content

[Obsolete("Use IsEditing()", false)]
public abstract bool IsEditingAnything { get; }

Property Value

bool

IsGuest

true if the current user is not authenticated and not recognized.

public abstract bool IsGuest { get; }

Property Value

bool

IsMember

[Obsolete("Deprecated. Use another method to differentiate types of users, like groups, select lists, etc.", false)]
public abstract bool IsMember { get; }

Property Value

bool

IsNew

true if the current user is not recognized and not authenticated

public abstract bool IsNew { get; }

Property Value

bool

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

bool

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

bool

IsTemplateEditing

true if the current user is editing the template

public abstract bool IsTemplateEditing { get; }

Property Value

bool

IsWorkflowRendering

[Obsolete("deprecated", false)]
public abstract bool IsWorkflowRendering { get; }

Property Value

bool

Language

The language relfected in the browser metadata

public abstract string Language { get; }

Property Value

string

LanguageID

The id of the language relfected in the browser metadata

public abstract int LanguageID { get; }

Property Value

int

Name

If autheticated, the current user's name

public abstract string Name { get; }

Property Value

string

OrganizationID

If autheticated, the current user's organization

public abstract int OrganizationID { get; }

Property Value

int

Password

[Obsolete("Deprecated.", false)]
public abstract string Password { get; }

Property Value

string

Username

If autheticated, the current user's username

public abstract string Username { get; }

Property Value

string

Methods

ClearProperty(string)

remove the property

public abstract void ClearProperty(string key)

Parameters

key string

GetBoolean(string)

Return the user property for the specified key.

public abstract bool GetBoolean(string key)

Parameters

key string

Returns

bool

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

key string
defaultValue bool

Returns

bool

GetBoolean(string, string)

[Obsolete("correct default type", false)]
public abstract bool GetBoolean(string PropertyName, string DefaultValue)

Parameters

PropertyName string
DefaultValue string

Returns

bool

GetDate(string)

Return the user property for the specified key.

public abstract DateTime GetDate(string key)

Parameters

key string

Returns

DateTime

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

key string
defaultValue DateTime

Returns

DateTime

GetDate(string, string)

[Obsolete("correct default type", false)]
public abstract DateTime GetDate(string PropertyName, string DefaultValue)

Parameters

PropertyName string
DefaultValue string

Returns

DateTime

GetIdByLogin(string, string)

Get a user's id from their username and password

public abstract int GetIdByLogin(string username, string password)

Parameters

username string
password string

Returns

int

GetInteger(string)

Return the user property for the specified key.

public abstract int GetInteger(string key)

Parameters

key string

Returns

int

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

key string
defaultValue int

Returns

int

GetInteger(string, string)

[Obsolete("correct default type", false)]
public abstract int GetInteger(string PropertyName, string DefaultValue)

Parameters

PropertyName string
DefaultValue string

Returns

int

GetNumber(string)

Return the user property for the specified key.

public abstract double GetNumber(string key)

Parameters

key string

Returns

double

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

key string
defaultValue double

Returns

double

GetNumber(string, string)

[Obsolete("correct default type", false)]
public abstract double GetNumber(string PropertyName, string DefaultValue)

Parameters

PropertyName string
DefaultValue string

Returns

double

GetObject<T>(string)

Return the user property for the specified key.

public abstract T GetObject<T>(string key)

Parameters

key string

Returns

T

Type Parameters

T

GetProperty(string)

[Obsolete("Use the Get method with the correct type.", false)]
public abstract string GetProperty(string key)

Parameters

key string

Returns

string

GetProperty(string, string)

[Obsolete("Use the Get method with the correct type.", false)]
public abstract string GetProperty(string key, string defaultValue)

Parameters

key string
defaultValue string

Returns

string

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

key string
defaultValue string
targetVisitId int

Returns

string

GetText(string)

Return the user property for the specified key.

public abstract string GetText(string key)

Parameters

key string

Returns

string

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

key string
defaultValue string

Returns

string

IsAdvancedEditing()

is the current user advanced editing any content

public abstract bool IsAdvancedEditing()

Returns

bool

IsAdvancedEditing(string)

is the current user advance editing the indicated content

public abstract bool IsAdvancedEditing(string contentName)

Parameters

contentName string

Returns

bool

IsAuthoring(string)

[Obsolete("Use IsEditing()", true)]
public abstract bool IsAuthoring(string contentName)

Parameters

contentName string

Returns

bool

IsContentManager()

true if the current user is authenticated and their identity is content manager role

public abstract bool IsContentManager()

Returns

bool

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

contentName string

Returns

bool

IsEditing()

true if the current user is editing anything

public abstract bool IsEditing()

Returns

bool

IsEditing(string)

true if the current user is editing the content specified

public abstract bool IsEditing(string contentName)

Parameters

contentName string

Returns

bool

IsInGroup(string)

true if the specified user is authenticted and in the specified group

public abstract bool IsInGroup(string groupName)

Parameters

groupName string

Returns

bool

IsInGroup(string, int)

public abstract bool IsInGroup(string groupName, int userId)

Parameters

groupName string
userId int

Returns

bool

IsInGroupList(string)

true if the current user is authenticted and in one of the specified groups.

public abstract bool IsInGroupList(string groupIdCommaList)

Parameters

groupIdCommaList string

Returns

bool

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

groupIdCommaList string

A comma delimited list of one or more group Ids

checkUserID int

Returns

bool

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

userId int

The id of the user who wants to update their username and password

username string
password string
errorMessage string

if the result is false, this is a user compatible message that explains how they can fix the issue

Returns

bool

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

username string
password string

Returns

bool

IsQuickEditing(string)

true if the current user has turned on quick editing

public abstract bool IsQuickEditing(string contentName)

Parameters

contentName string

Returns

bool

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

username string
password string

Returns

bool

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

username string
password string
setAutoLogin bool

If 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

bool

LoginByID(int)

Autheticate the current user to the identity id provided.

public abstract bool LoginByID(int recordId)

Parameters

recordId int

Returns

bool

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

recordId int
setAutoLogin bool

Returns

bool

LoginByID(string, bool)

[Obsolete("Use LoginById(integer) instead", false)]
public abstract bool LoginByID(string RecordID, bool SetAutoLogin = false)

Parameters

RecordID string
SetAutoLogin bool

Returns

bool

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

username string
password string

Returns

bool

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

userID int

Returns

bool

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

password string

Returns

bool

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

password string
userId int

Returns

bool

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

password string
userId int
userErrorMessage string

Returns

bool

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

password string
userErrorMessage string

Returns

bool

SetProperty(string, bool)

Set a user property for this type

public abstract void SetProperty(string key, bool value)

Parameters

key string
value bool

SetProperty(string, bool, int)

Set a boolean user property for a specific user

public abstract void SetProperty(string key, bool value, int userId)

Parameters

key string
value bool
userId int

SetProperty(string, DateTime)

Set a user property for this type

public abstract void SetProperty(string key, DateTime value)

Parameters

key string
value DateTime

SetProperty(string, DateTime, int)

Set a datetime user property for a specific user

public abstract void SetProperty(string key, DateTime value, int userId)

Parameters

key string
value DateTime
userId int

SetProperty(string, double)

Set a user property for this type

public abstract void SetProperty(string key, double value)

Parameters

key string
value double

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

key string
value double
userId int

SetProperty(string, int)

Set a user property for this type

public abstract void SetProperty(string key, int value)

Parameters

key string
value int

SetProperty(string, int, int)

Set an integer user property for a specific user

public abstract void SetProperty(string key, int value, int userId)

Parameters

key string
value int
userId int

SetProperty(string, string)

Set a text user property

public abstract void SetProperty(string key, string value)

Parameters

key string
value string

SetProperty(string, string, int)

Set a text user property for a specific user

public abstract void SetProperty(string key, string value, int userId)

Parameters

key string
value string
userId int

Track()

If track users is disabled, this method begins tracking the current user

public abstract void Track()