SsoUser

package sso\lib\dao

 Methods

Convert a timeout array in second

arrayToIntTimeout(array<mixed,integer> $data) : integer
Static

Parameters

$data

array<mixed,integer>

unit => value

Returns

integerseconds

Retrieve user by ID

findFromId(string $id) : \sso\SsoUser | NULL
Static

Parameters

$id

string

user Id to retrieve

Returns

\sso\SsoUserNULLreturn NULL if user table does not exists at all, return a new SsoUser if the user does not exists in table

Return group element type

getGroupType() 
Static
see
inherited_from \sso\SsoGroupable::getGroupType()

Retrieve the user based of SSO database informations, used for initialize the SSO

getInitUser() : \sso\SsoUser
Static

Returns

\sso\SsoUserA user with login and password of the database

Field name that contain name of group element

getNameField() 
see
inherited_from \sso\SsoGroupable::getNameField()

Convert seconds to timeout array

intTimeoutToArray(integer $int) : array<mixed,integer>
Static

Parameters

$int

integer

timeout in seconds

Returns

array<mixed,integer>data timeout as unit => value

Check a user is enabled

isEnabled() : boolean

Returns

booleanTRUE if user enabled, FALSE otherwise

Return a range for a unit

unitRange(string $unit) : array<mixed,integer>
Static

Parameters

$unit

string

unit in [dhm] (day, hours, minutes)

Returns

array<mixed,integer>range for the unit : hours will return array(0, ..., 23)

Register a failed login attempt

updateLoginFailed(string $id) : boolean
Static

Parameters

$id

string

user ID

Returns

booleanTRUE if user exists

Register a successfull access for user

updateLoginOk(string $id, \sso\AuthUser $authUser) : \sso\SsoUser
Static

Parameters

$id

string

User ID

$authUser

\sso\AuthUser

The AuthUser object from an auth method

Exceptions

\sso\Exception

Returns

\sso\SsoUserThe SsoUser (created if it's his first access)

 Properties

 

Used to convert interval data to timeout

$CONVERT_TIMEOUT 

Default

array('d' => 86400, 'h' => 3600, 'm' => 60)
Static
 

Used to generate select of timeout element

$TIME_RANGE 

Default

array('d' => 7, 'h' => 23, 'm' => 59)
Static
 

$admin

$admin : boolean

Default

magic
property
 

$auth

$auth : integer

Default

magic
property
 

$auth_group

$auth_group : integer

Default

magic
property
 

$can_ask

$can_ask : boolean

Default

magic
property
   

$id

$id : string

Default

magic
property
 

$lang

$lang : string

Default

magic
property
       

$name

$name : string

Default

magic
property
 

$password

$password : string

Default

magic
property
 

$restrictAgent

$restrictAgent : boolean

Default

magic
property
 

$restrictIP

$restrictIP : boolean

Default

magic
property
 

$state

$state : integer

Default

magic
property
 

$timeout

$timeout : integer

Default

magic
property

 Constants

 

Default timeout

DEFAULT_TIMEOUT = 259200 
 

State disabled

STATE_DISABLED = 0 
 

State enabled

STATE_ENABLED = 1 
 

State pending to administrator validation

STATE_TO_VALIDATE = 2