user
in package
Table of Contents
Properties
- $_changed : mixed
- $_changes_trace : mixed
- $enable : mixed
- $hash : string|null
- $id : mixed
- $login : mixed
- $options : mixed
- $password : mixed
- $profils : mixed
- $rights : mixed
Methods
- all() : array<string|int, user>
- Get all users
- byEnable() : array<string|int, user>
- Search users by enable status
- byHash() : user
- Get user by hash
- byId() : user|null
- Return user object if exists
- byLogin() : user
- Get user by login
- byLoginAndHash() : user
- Get user by login and hash
- byProfils() : array<string|int, user>
- Search users by profils
- cleanExpiredRegisterDevices() : void
- cleanPasswordAndHashInput() : array<string|int, mixed>
- connect() : user|false
- Return user object if login and password are correct, else return false
- connectToLDAP() : mixed
- deadCmd() : array<string|int, mixed>
- decrypt() : void
- encrypt() : void
- failedLogin() : void
- getAccessKeyForReport() : string
- getChanged() : mixed
- getEnable() : mixed
- getHash() : string
- getId() : mixed
- getLogin() : mixed
- getOptions() : mixed
- getPassword() : string
- getProfils() : mixed
- getRights() : mixed
- is_Connected() : bool
- isBan() : bool
- isValidAndEnabled() : bool
- isValidRegisteredDevice() : bool
- loginFromResetToken() : string
- postInsert() : void
- postRemove() : void
- postSave() : void
- preInsert() : void
- preRemove() : void
- preSave() : void
- preUpdate() : void
- raiseForInvalidLogin() : void
- refresh() : void
- regenerateHashes() : mixed
- registerDeviceLifetime() : int
- remove() : bool
- removeBanIp() : void
- resetPasswordFromToken() : bool
- save() : bool
- searchByOptions() : array<string|int, user>
- Search users by options
- searchByRight() : array<string|int, user>
- Search users by right
- sendResetPasswordLink() : void
- setChanged() : self
- setEnable() : self
- setHash() : mixed
- setId() : self
- setLogin() : self
- setOptions() : mixed
- setPassword() : self
- setProfils() : self
- setRights() : self
- supportAccess() : void
- toArray() : array<string, mixed>
- Convert user to array, stripping sensitive data (password hash, 2FA secret)
- validateTwoFactorCode() : mixed
- regenerateHash() : mixed
- traceChange() : void
Properties
$_changed
private
mixed
$_changed
= \false
$_changes_trace
private
mixed
$_changes_trace
= array()
$enable
private
mixed
$enable
= 1
$hash
private
string|null
$hash
= ''
$id
private
mixed
$id
$login
private
mixed
$login
$options
private
mixed
$options
$password
private
mixed
$password
$profils
private
mixed
$profils
= 'admin'
$rights
private
mixed
$rights
Methods
all()
Get all users
public
static all() : array<string|int, user>
Return values
array<string|int, user> —Array of all users
byEnable()
Search users by enable status
public
static byEnable(bool $_enable) : array<string|int, user>
Parameters
- $_enable : bool
Return values
array<string|int, user> —Array of users with the specified enable status
byHash()
Get user by hash
public
static byHash(mixed $_hash) : user
Parameters
- $_hash : mixed
Return values
userbyId()
Return user object if exists
public
static byId(int|string $_id) : user|null
Parameters
- $_id : int|string
-
user ID
Return values
user|null —user object if exists, null otherwise
byLogin()
Get user by login
public
static byLogin(mixed $_login) : user
Parameters
- $_login : mixed
Return values
userbyLoginAndHash()
Get user by login and hash
public
static byLoginAndHash(mixed $_login, mixed $_hash) : user
Parameters
- $_login : mixed
- $_hash : mixed
Return values
userbyProfils()
Search users by profils
public
static byProfils(string $_profils[, bool $_enable = false ]) : array<string|int, user>
Parameters
- $_profils : string
- $_enable : bool = false
Return values
array<string|int, user> —Array of users with the specified profils
cleanExpiredRegisterDevices()
public
static cleanExpiredRegisterDevices() : void
cleanPasswordAndHashInput()
public
static cleanPasswordAndHashInput(array<string|int, mixed> $_params) : array<string|int, mixed>
Parameters
- $_params : array<string|int, mixed>
Return values
array<string|int, mixed>connect()
Return user object if login and password are correct, else return false
public
static connect(string $_login, string $_pswd) : user|false
Parameters
- $_login : string
-
login
- $_pswd : string
-
password in plain text
Return values
user|false —object user or false if authentication fails
connectToLDAP()
public
static connectToLDAP() : mixed
deadCmd()
public
static deadCmd() : array<string|int, mixed>
Return values
array<string|int, mixed>decrypt()
public
decrypt() : void
encrypt()
public
encrypt() : void
failedLogin()
public
static failedLogin([array<string|int, mixed> $_context = [] ]) : void
Parameters
- $_context : array<string|int, mixed> = []
getAccessKeyForReport()
public
static getAccessKeyForReport() : string
Return values
stringgetChanged()
public
getChanged() : mixed
getEnable()
public
getEnable() : mixed
getHash()
public
getHash() : string
Return values
stringgetId()
public
getId() : mixed
getLogin()
public
getLogin() : mixed
getOptions()
public
getOptions([mixed $_key = '' ][, mixed $_default = '' ]) : mixed
Parameters
- $_key : mixed = ''
- $_default : mixed = ''
getPassword()
public
getPassword() : string
Return values
stringgetProfils()
public
getProfils() : mixed
getRights()
public
getRights([mixed $_key = '' ][, mixed $_default = '' ]) : mixed
Parameters
- $_key : mixed = ''
- $_default : mixed = ''
is_Connected()
public
is_Connected() : bool
Tags
Return values
boolisBan()
public
static isBan() : bool
Return values
boolisValidAndEnabled()
public
isValidAndEnabled() : bool
Return values
boolisValidRegisteredDevice()
public
static isValidRegisteredDevice(array<string|int, mixed> $registeredDevices, string $key) : bool
Parameters
- $registeredDevices : array<string|int, mixed>
- $key : string
Return values
boolloginFromResetToken()
public
static loginFromResetToken(string $_key) : string
Parameters
- $_key : string
Return values
stringpostInsert()
public
postInsert() : void
postRemove()
public
postRemove() : void
postSave()
public
postSave() : void
preInsert()
public
preInsert() : void
preRemove()
public
preRemove() : void
preSave()
public
preSave() : void
preUpdate()
public
preUpdate() : void
raiseForInvalidLogin()
public
static raiseForInvalidLogin(string $_login) : void
Parameters
- $_login : string
refresh()
public
refresh() : void
regenerateHashes()
public
static regenerateHashes() : mixed
registerDeviceLifetime()
public
static registerDeviceLifetime() : int
Return values
intremove()
public
remove() : bool
Return values
boolremoveBanIp()
public
static removeBanIp() : void
resetPasswordFromToken()
public
static resetPasswordFromToken(string $_key, string $_newPassword) : bool
Parameters
- $_key : string
- $_newPassword : string
Return values
boolsave()
public
save() : bool
Return values
boolsearchByOptions()
Search users by options
public
static searchByOptions(string $_search) : array<string|int, user>
Parameters
- $_search : string
Return values
array<string|int, user> —Array of users with the specified options
searchByRight()
Search users by right
public
static searchByRight(string $_rights) : array<string|int, user>
Parameters
- $_rights : string
Return values
array<string|int, user> —Array of users with the specified right
sendResetPasswordLink()
public
sendResetPasswordLink() : void
setChanged()
public
setChanged(mixed $_changed) : self
Parameters
- $_changed : mixed
Return values
selfsetEnable()
public
setEnable(mixed $_enable) : self
Parameters
- $_enable : mixed
Return values
selfsetHash()
public
setHash(string $_hash) : mixed
Parameters
- $_hash : string
setId()
public
setId(mixed $_id) : self
Parameters
- $_id : mixed
Return values
selfsetLogin()
public
setLogin(mixed $_login) : self
Parameters
- $_login : mixed
Return values
selfsetOptions()
public
setOptions(mixed $_key, mixed $_value) : mixed
Parameters
- $_key : mixed
- $_value : mixed
setPassword()
public
setPassword(string $_password) : self
Parameters
- $_password : string
Return values
selfsetProfils()
public
setProfils(mixed $_profils) : self
Parameters
- $_profils : mixed
Return values
selfsetRights()
public
setRights(mixed $_key, mixed $_value) : self
Parameters
- $_key : mixed
- $_value : mixed
Return values
selfsupportAccess()
public
static supportAccess([mixed $_enable = true ]) : void
Parameters
- $_enable : mixed = true
toArray()
Convert user to array, stripping sensitive data (password hash, 2FA secret)
public
toArray() : array<string, mixed>
Return values
array<string, mixed>validateTwoFactorCode()
public
validateTwoFactorCode(mixed $_code) : mixed
Parameters
- $_code : mixed
regenerateHash()
private
regenerateHash() : mixed
traceChange()
private
traceChange(mixed $old, mixed $new, string $message) : void
Parameters
- $old : mixed
- $new : mixed
- $message : string