class User extends Object (View source)

Properties

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

Methods

loadError($error)

No description

from  Object
isError()

No description

from  Object
getError()

No description

from  Object
setPropertiesFromArray($arr)

No description

from  Object
static 
camelcase($file)

No description

from  Object
static 
uncamelcase($string)

No description

from  Object
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 bool
isLoggedIn()

Return true if user is logged in.

bool
checkLogin()

No description

UserInfo|null
getUserInfoObject()

No description

__construct()

No description

recordLogin()

Increment number of logins and update login timestamps.

recordView(Page $c)

Update PageStatistics

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()

No description

persist(bool $cache_interface = true)

Manage user session writing.

logIn(bool $cache_interface = true)

No description

Details

loadError($error)

No description

Parameters

$error

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

Parameters

$arr

static camelcase($file)

No description

Parameters

$file

static uncamelcase($string)

No description

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)

No description

Parameters

int $uID

Return Value

User

static bool isLoggedIn()

Return true if user is logged in.

Return Value

bool

bool checkLogin()

No description

Return Value

bool

UserInfo|null getUserInfoObject()

No description

Return Value

UserInfo|null

__construct()

No description

recordLogin()

Increment number of logins and update login timestamps.

Exceptions

Exception

recordView(Page $c)

Update PageStatistics

Parameters

Page $c

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()

No description

Return Value

bool

bool isSuperUser()

No description

Return Value

bool

int|null getLastOnline()

No description

Return Value

int|null

string|null getUserName()

No description

Return Value

string|null

bool isRegistered()

No description

Return Value

bool

string getUserID()

No description

Return Value

string

string|null getUserTimezone()

No description

Return Value

string|null

string getUserSessionValidSince()

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

Return Value

string

setAuthTypeCookie(string $authType)

No description

Parameters

string $authType

Exceptions

Exception

setLastAuthType(AuthenticationType $at)

No description

Parameters

AuthenticationType $at

int getLastAuthType()

No description

Return Value

int

unloadAuthenticationTypes()

No description

logout(bool $hard = true)

No description

Parameters

bool $hard

invalidateSession(bool $hard = true)

No description

Parameters

bool $hard

static verifyAuthTypeCookie()

No description

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()

No description

array getUserAccessEntityObjects()

No description

Return Value

array

array _getUserGroups(bool $disableLogin = false)

No description

Parameters

bool $disableLogin

Return Value

array

enterGroup(Group $g)

No description

Parameters

Group $g

exitGroup(Group $g)

No description

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)

No description

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)

No description

Parameters

bool $removeCache

string|null config(string $cfKey)

No description

Parameters

string $cfKey

Return Value

string|null

markPreviousFrontendPage(Page $c)

No description

Parameters

Page $c

int getPreviousFrontendPageID()

No description

Return Value

int

saveConfig(string $cfKey, string $cfValue)

No description

Parameters

string $cfKey
string $cfValue

refreshCollectionEdit(Page $c)

No description

Parameters

Page $c

Statement forceCollectionCheckInAll()

No description

Return Value

Statement

PasswordHash getUserPasswordHasher()

No description

Return Value

PasswordHash

See also

PasswordHash

persist(bool $cache_interface = true)

Manage user session writing.

Parameters

bool $cache_interface

logIn(bool $cache_interface = true)

No description

Parameters

bool $cache_interface