class User extends ConcreteObject (View source)

Properties

$error from ConcreteObject
$uID
$uName
$uGroups
$superUser
$uTimezone
protected $uDefaultLanguage
protected $accessEntities
protected $hasher
protected $uLastPasswordChange

Methods

loadError($error)

No description

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

static 
camelcase($file)

No description

static 
uncamelcase($string)

No description

static User|null
getByUserID(int $uID, bool $login = false, bool $cacheItemsOnLogin = true)

Return an User instance given its id (or null if it's not found)

static User
loginByUserID(int $uID)

No description

static 
isLoggedIn() deprecated

No description

bool
checkLogin()

No description

UserInfo|null
getUserInfoObject()

No description

__construct()

No description

recordLogin()

Increment number of logins and update login timestamps.

string
encryptPassword(string $uPassword, null $salt = null)

$salt is retained for compatibilty with older versions of concerete5, but not used.

string
legacyEncryptPassword(string $uPassword)

This is for compatibility with passwords generated in older versions of concrete5.

bool
isActive()

No description

bool
isSuperUser()

No description

int|null
getLastOnline()

No description

string|null
getUserName()

No description

bool
isRegistered()

No description

string
getUserID()

No description

string|null
getUserTimezone()

No description

string
getUserSessionValidSince()

Return date in yyyy-mm-dd H:i:s format.

setAuthTypeCookie(string $authType)

No description

setLastAuthType(AuthenticationType $at)

No description

int
getLastAuthType()

No description

unloadAuthenticationTypes()

No description

logout(bool $hard = true)

No description

invalidateSession(bool $hard = true)

No description

static 
verifyAuthTypeCookie()

No description

array
getUserGroupObjects()

Returns an array of Group objects the user belongs to.

array
getUserGroups()

Returns an array of group ids the user belongs to.

setUserDefaultLanguage(string $lang)

Sets a default language for a user record.

string
getUserDefaultLanguage()

Gets the default language for the logged-in user.

string
getLastPasswordChange()

Returns date in yyyy-mm-dd H:i:s format.

string
getUserLanguageToDisplay()

Checks to see if the current user object is registered. If so, it queries that records default language. Otherwise, it falls back to sitewide settings.

refreshUserGroups()

No description

array
getUserAccessEntityObjects()

No description

array
_getUserGroups(bool $disableLogin = false)

No description

enterGroup(Group $g)

No description

exitGroup(Group $g)

No description

bool
inGroup(Group $g)

Return true if user is in Group.

loadMasterCollectionEdit(int $mcID, int $ocID)

No description

bool
loadCollectionEdit(Page $c)

Loads a page in edit mode.

unloadCollectionEdit(bool $removeCache = true)

No description

string|null
config(string $cfKey)

No description

markPreviousFrontendPage(Page $c)

No description

int
getPreviousFrontendPageID()

No description

saveConfig(string $cfKey, string $cfValue)

No description

refreshCollectionEdit(Page $c)

No description

Statement
forceCollectionCheckInAll()

No description

PasswordHash
getUserPasswordHasher() deprecated

No description

persist(bool $cache_interface = true)

Manage user session writing.

logIn(bool $cache_interface = true)

No description

Details

loadError($error)

Parameters

$error

isError()

getError()

setPropertiesFromArray($arr)

Parameters

$arr

static camelcase($file)

Parameters

$file

static uncamelcase($string)

Parameters

$string

static User|null getByUserID(int $uID, bool $login = false, bool $cacheItemsOnLogin = true)

Return an User instance given its id (or null if it's not found)

Parameters

int $uID The id of the user
bool $login = false Set to true to make the user the current one
bool $cacheItemsOnLogin = false Set to true to cache some items when $login is true

Return Value

User|null

static User loginByUserID(int $uID)

Parameters

int $uID

Return Value

User

static isLoggedIn() deprecated

deprecated Use isRegistered() instead

bool checkLogin()

Return Value

bool

UserInfo|null getUserInfoObject()

Return Value

UserInfo|null

__construct()

recordLogin()

Increment number of logins and update login timestamps.

Exceptions

Exception

string encryptPassword(string $uPassword, null $salt = null)

$salt is retained for compatibilty with older versions of concerete5, but not used.

Parameters

string $uPassword
null $salt

Return Value

string

string legacyEncryptPassword(string $uPassword)

This is for compatibility with passwords generated in older versions of concrete5.

Use only for checking password hashes, not generating new ones to store.

Parameters

string $uPassword

Return Value

string

bool isActive()

Return Value

bool

bool isSuperUser()

Return Value

bool

int|null getLastOnline()

Return Value

int|null

string|null getUserName()

Return Value

string|null

bool isRegistered()

Return Value

bool

string getUserID()

Return Value

string

string|null getUserTimezone()

Return Value

string|null

string getUserSessionValidSince()

Return date in yyyy-mm-dd H:i:s format.

Return Value

string

setAuthTypeCookie(string $authType)

Parameters

string $authType

Exceptions

Exception

setLastAuthType(AuthenticationType $at)

Parameters

AuthenticationType $at

int getLastAuthType()

Return Value

int

unloadAuthenticationTypes()

logout(bool $hard = true)

Parameters

bool $hard

invalidateSession(bool $hard = true)

Parameters

bool $hard

static verifyAuthTypeCookie()

array getUserGroupObjects()

Returns an array of Group objects the user belongs to.

Return Value

array

array getUserGroups()

Returns an array of group ids the user belongs to.

Return Value

array

setUserDefaultLanguage(string $lang)

Sets a default language for a user record.

Parameters

string $lang

string getUserDefaultLanguage()

Gets the default language for the logged-in user.

Return Value

string

string getLastPasswordChange()

Returns date in yyyy-mm-dd H:i:s format.

Return Value

string

string getUserLanguageToDisplay()

Checks to see if the current user object is registered. If so, it queries that records default language. Otherwise, it falls back to sitewide settings.

Return Value

string

refreshUserGroups()

array getUserAccessEntityObjects()

Return Value

array

array _getUserGroups(bool $disableLogin = false)

Parameters

bool $disableLogin

Return Value

array

enterGroup(Group $g)

Parameters

Group $g

exitGroup(Group $g)

Parameters

Group $g

bool inGroup(Group $g)

Return true if user is in Group.

Parameters

Group $g

Return Value

bool

loadMasterCollectionEdit(int $mcID, int $ocID)

Parameters

int $mcID
int $ocID

bool loadCollectionEdit(Page $c)

Loads a page in edit mode.

Parameters

Page $c

Return Value

bool

unloadCollectionEdit(bool $removeCache = true)

Parameters

bool $removeCache

string|null config(string $cfKey)

Parameters

string $cfKey

Return Value

string|null

markPreviousFrontendPage(Page $c)

Parameters

Page $c

int getPreviousFrontendPageID()

Return Value

int

saveConfig(string $cfKey, string $cfValue)

Parameters

string $cfKey
string $cfValue

refreshCollectionEdit(Page $c)

Parameters

Page $c

Statement forceCollectionCheckInAll()

Return Value

Statement

PasswordHash getUserPasswordHasher() deprecated

deprecated Use $app->make(\Concrete\Core\Encryption\PasswordHasher::class)

Return Value

PasswordHash

persist(bool $cache_interface = true)

Manage user session writing.

Parameters

bool $cache_interface

logIn(bool $cache_interface = true)

Parameters

bool $cache_interface