Phpxforms documentation

UserSession
in package

Administration session with user rights

Tags
author

DaVee

version
0.87dev
license

Lesser General Public License 2.1 or later; see http://www.gnu.org/licenses/lgpl-2.1.html

Table of Contents

Properties

$db  : SQL
$log  : Logger|null
$logged  : bool
$modules  : array<string, array<string, mixed>>

Methods

__construct()  : mixed
delete()  : void
Unset session value
get()  : mixed|null
Get session value
getCustom()  : array<string, mixed>|string|null
Get module settings
getId()  : int|null
Get logged user Id
getMark()  : string
getModule()  : array<string, mixed>|string|null
Get module info
getModuleId()  : int|null
Get module id
getModuleList()  : array<string, mixed>
Get user module list
getSettings()  : array<string, mixed>|string|int|bool|null
haveRights()  : bool
Get user right for selected module
isCsrf()  : bool
Check CSRF, returns null on unset csrf
isLogged()  : bool
Is user logged in
login()  : string
Use crypt instead of hash, delay 2 sec on wrong login
logout()  : void
User logout
set()  : void
Set session value
create()  : void
Create user session
exists()  : bool
Check existence
getIPs()  : array<string|int, string>
loadModules()  : void
Load user modules
reLoad()  : bool
Check user login
verifyAndUpdate()  : bool
Check password / optionally update old SHA1 password to BCRYPT

Properties

$modules

protected array<string, array<string, mixed>> $modules = []

Methods

delete()

Unset session value

public delete(string $mark) : void
Parameters
$mark : string

get()

Get session value

public get(string $mark) : mixed|null
Parameters
$mark : string
Return values
mixed|null

getCustom()

Get module settings

public getCustom(string $file[, string|null $col = null ]) : array<string, mixed>|string|null
Parameters
$file : string
$col : string|null = null
Return values
array<string, mixed>|string|null

getId()

Get logged user Id

public getId() : int|null
Return values
int|null

getMark()

public getMark() : string
Return values
string

getModule()

Get module info

public getModule(string $file[, string|null $col = null ]) : array<string, mixed>|string|null
Parameters
$file : string
$col : string|null = null
Return values
array<string, mixed>|string|null

getModuleId()

Get module id

public getModuleId(string $file) : int|null
Parameters
$file : string
Return values
int|null

getModuleList()

Get user module list

public getModuleList([array<string|int, string> $type = null ][, string|null $col = 'name' ]) : array<string, mixed>
Parameters
$type : array<string|int, string> = null
$col : string|null = 'name'
Return values
array<string, mixed>

getSettings()

public getSettings(string $mark) : array<string, mixed>|string|int|bool|null
Parameters
$mark : string
Return values
array<string, mixed>|string|int|bool|null

haveRights()

Get user right for selected module

public haveRights(string $file, string $right) : bool
Parameters
$file : string
$right : string
Return values
bool

isCsrf()

Check CSRF, returns null on unset csrf

public isCsrf() : bool
Return values
bool

isLogged()

Is user logged in

public isLogged() : bool
Return values
bool

login()

Use crypt instead of hash, delay 2 sec on wrong login

public login(string $login, string $password[, mixed|string $salt = '' ]) : string
Parameters
$login : string
$password : string
$salt : mixed|string = ''

Deprecated !!!

Return values
string

set()

Set session value

public set(string $mark, mixed $value) : void
Parameters
$mark : string
$value : mixed

create()

Create user session

protected create(int $id, string $name, string $hash, string $type, mixed $custom) : void
Parameters
$id : int
$name : string
$hash : string
$type : string
$custom : mixed

exists()

Check existence

protected exists([string $mark = 'USER' ]) : bool
Parameters
$mark : string = 'USER'
Return values
bool

getIPs()

protected getIPs() : array<string|int, string>
Return values
array<string|int, string>

loadModules()

Load user modules

protected loadModules() : void

reLoad()

Check user login

protected reLoad() : bool
Return values
bool

verifyAndUpdate()

Check password / optionally update old SHA1 password to BCRYPT

protected verifyAndUpdate(string $password, string &$hash, array<string, string>|string $salt) : bool
Parameters
$password : string
$hash : string
$salt : array<string, string>|string
Return values
bool

        
On this page

Search results