FRED™  3.0
FRED™: Framework for Rapid and Easy Development
User Class Reference
Inheritance diagram for User:
Component Thing

Public Member Functions

 authenticated ($auth_sets)
 Check if a user is authenticated. More...
 
 level ($right)
 Get the current user's right level. More...
 
 authorized ($right, $level=null)
 Check if the authenticated user has a certain right. More...
 
 invalidate ()
 Invalidate the current user. More...
 
 name ($id)
 Returns a user friendly name for an user ID. More...
 
 record ($id)
 Get the record (data) for a user. More...
 
 id ($code)
 Translate a user code (external ID) to a user ID (internal ID). More...
 
 __clone ()
 
- Public Member Functions inherited from Component
 __construct ($fred, $config=null)
 
 __destruct ()
 
 clientConfig ()
 Public configuration. More...
 
 config ($key, $default=null)
 Retrieve a config value. More...
 
 ping ()
 Ping function. More...
 
 filemtime ($filename)
 Filemtime with session cache. More...
 
 component ($name)
 Get a component (local or default). More...
 
 components (... $names)
 Get multiple components in an array. More...
 
- Public Member Functions inherited from Thing
 propertyExists ($property)
 Check if a property exists (public or published). More...
 
 constants ($prefix=null)
 Return all constants. More...
 
 get ($key)
 Get one or more properties. More...
 
 set ($key, $value=null)
 Set one or more properties. More...
 
 __get ($key)
 
 __set ($key, $value)
 

Data Fields

const RIGHT_LEVEL_READ = 'r'
 
const RIGHT_LEVEL_WRITE = 'w'
 
const RIGHT_LEVEL_EXECUTE = 'x'
 
const RIGHT_LEVEL_SEPARATOR = ':'
 Separator between right and level in a single string notation. More...
 
const EVENT_RIGHT_LEVEL = 'user:rightLevel'
 
const EVENT_INVALIDATE = 'user:invalidate'
 
const EVENT_NAME = 'user:name'
 
const EVENT_RECORD = 'user:record'
 
const EVENT_ID = 'user:id'
 
const EVENT_SET = 'user:set'
 
 $authorative = true
 
 $authenticationControllerName = null
 Set if the user has to provide more information for authentication. More...
 
 $filesClassName = __CLASS__ . '\\Files'
 Class name for the file manager. More...
 
- Data Fields inherited from Component
 $filemtimeTtl = 0
 
- Data Fields inherited from Thing
const HIDDEN = 0
 Property is hidden. More...
 
const READABLE = 1
 Property is readable. More...
 
const WRITEABLE = 2
 Property is writeable. More...
 
const READWRITE = 3
 Property is readable and writeable. More...
 

Protected Member Functions

 getAuthenticators ()
 
 setId ($value)
 
 getId ()
 
 getRecord ()
 
 getFiles ()
 
 _get ($key)
 
 _set ($key, $value)
 
- Protected Member Functions inherited from Component
 init ()
 
 done ()
 
 getSession ()
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). More...
 
 configure ($config)
 Configure the object. More...
 
 _get ($key)
 Default getter if no specific setter is defined, and the property is also not published (readable). More...
 
 _set ($key, $value)
 Default setter if no specific setter is defined, and the property is also not published (writeable). More...
 

Protected Attributes

 $_id = null
 
 $_authenticators = null
 Available authentication checks. More...
 
 $_record = null
 User data. More...
 
 $_files = null
 
- Protected Attributes inherited from Component
 $_fred = null
 
 $_config = null
 
 $_name = null
 
 $_components = []
 Local components (key = component name, value = component). More...
 
 $_session = null
 
- Protected Attributes inherited from Thing
 $_published = []
 Published properties (key = name of property, value = visibility). More...
 

Detailed Description

Definition at line 5 of file User.php.

Member Function Documentation

◆ __clone()

__clone ( )

Definition at line 159 of file User.php.

◆ _get()

_get (   $key)
protected

Definition at line 151 of file User.php.

◆ _set()

_set (   $key,
  $value 
)
protected

Definition at line 155 of file User.php.

◆ authenticated()

authenticated (   $auth_sets)

Check if a user is authenticated.

Parameters
array$auth_setsPossible sets of authentication checks (array of arrays).
Returns
bool Null if the user has to provide some more information. The $authenticationControllerName can be used for this purpose.

Definition at line 34 of file User.php.

◆ authorized()

authorized (   $right,
  $level = null 
)

Check if the authenticated user has a certain right.

Parameters
string$rightRight to check, optionally completed with the minimal level the user must have.
string$levelDifferent level (overrules optional level in the right).
Returns
bool

Definition at line 74 of file User.php.

◆ getAuthenticators()

getAuthenticators ( )
protected

Definition at line 115 of file User.php.

◆ getFiles()

getFiles ( )
protected

Definition at line 143 of file User.php.

◆ getId()

getId ( )
protected

Definition at line 134 of file User.php.

◆ getRecord()

getRecord ( )
protected

Definition at line 138 of file User.php.

◆ id()

id (   $code)

Translate a user code (external ID) to a user ID (internal ID).

Parameters
string$codeUser code.
Returns
string User ID.

Definition at line 111 of file User.php.

◆ invalidate()

invalidate ( )

Invalidate the current user.

Definition at line 82 of file User.php.

◆ level()

level (   $right)

Get the current user's right level.

Parameters
string$rightRight to check
Returns
string Level

Definition at line 65 of file User.php.

◆ name()

name (   $id)

Returns a user friendly name for an user ID.

Parameters
mixed$idUser ID.
Returns
string

Definition at line 95 of file User.php.

◆ record()

record (   $id)

Get the record (data) for a user.

Parameters
mixed$idUser ID.
Returns
array Assoc.array (false when not found).

Definition at line 103 of file User.php.

◆ setId()

setId (   $value)
protected

Definition at line 126 of file User.php.

Field Documentation

◆ $_authenticators

$_authenticators = null
protected

Available authentication checks.

Definition at line 24 of file User.php.

◆ $_files

$_files = null
protected

Definition at line 26 of file User.php.

◆ $_id

$_id = null
protected

Definition at line 23 of file User.php.

◆ $_record

$_record = null
protected

User data.

Definition at line 25 of file User.php.

◆ $authenticationControllerName

$authenticationControllerName = null

Set if the user has to provide more information for authentication.

Definition at line 20 of file User.php.

◆ $authorative

$authorative = true

Definition at line 19 of file User.php.

◆ $filesClassName

$filesClassName = __CLASS__ . '\\Files'

Class name for the file manager.

Definition at line 21 of file User.php.

◆ EVENT_ID

const EVENT_ID = 'user:id'

Definition at line 16 of file User.php.

◆ EVENT_INVALIDATE

const EVENT_INVALIDATE = 'user:invalidate'

Definition at line 13 of file User.php.

◆ EVENT_NAME

const EVENT_NAME = 'user:name'

Definition at line 14 of file User.php.

◆ EVENT_RECORD

const EVENT_RECORD = 'user:record'

Definition at line 15 of file User.php.

◆ EVENT_RIGHT_LEVEL

const EVENT_RIGHT_LEVEL = 'user:rightLevel'

Definition at line 12 of file User.php.

◆ EVENT_SET

const EVENT_SET = 'user:set'

Definition at line 17 of file User.php.

◆ RIGHT_LEVEL_EXECUTE

const RIGHT_LEVEL_EXECUTE = 'x'

Definition at line 9 of file User.php.

◆ RIGHT_LEVEL_READ

const RIGHT_LEVEL_READ = 'r'

Definition at line 7 of file User.php.

◆ RIGHT_LEVEL_SEPARATOR

const RIGHT_LEVEL_SEPARATOR = ':'

Separator between right and level in a single string notation.

Definition at line 10 of file User.php.

◆ RIGHT_LEVEL_WRITE

const RIGHT_LEVEL_WRITE = 'w'

Definition at line 8 of file User.php.


The documentation for this class was generated from the following file: