pclib  3.0.0
Lightweight PHP framework
Public Member Functions | Data Fields
AuthUser Class Reference

Provides access to user account, user roles and permissions. More...

Inheritance diagram for AuthUser:
BaseObject

Public Member Functions

 isLogged ()
 Check if user is logged in. More...
 
 isValid ()
 Check if user exists and he is active. More...
 
 asObject ($className)
 Create new instance of $className and copy user data into. More...
 
 hasRight ($name, $objectId=0)
 Check if user has permission $name. More...
 
 hasRole ($role)
 Check if user has role $role. More...
 
 hasDefaultPassword ()
 Check if user uses default password. More...
 
 getValues ()
 Return user values. More...
 
 getCredentials ()
 Return array [userName, password, defaultPassword]. More...
 
 __get ($name)
 PHP magic method. More...
 
 passwordVerify ($password)
 Verify user password. More...
 
 changePassword ($password)
 Change user password. More...
 
- Public Member Functions inherited from BaseObject
 loadDefaults ($className=null)
 Load default parameters of class $className into object instance.
 
 setProperties (array $defaults)
 Set public properties of object from the array. More...
 
 toArray ()
 Convert object to array. More...
 

Data Fields

 $values
 array User account values
 
 $auth
 var Auth
 
- Data Fields inherited from BaseObject
 $serviceLocator
 var function() Return service object when requested with service().
 

Additional Inherited Members

- Static Public Member Functions inherited from BaseObject
static defaults ()
 Set or retireve default parameters of the object. More...
 
- Protected Member Functions inherited from BaseObject
 service ($service, $default=null)
 Try acquire $service and load it into property $this->$service. More...
 

Detailed Description

Provides access to user account, user roles and permissions.

When Auth->login() is successfull, Auth stores user object as Auth->loggedUser. You can get user object for any $userName with Auth->getUser($userName).

Member Function Documentation

◆ __get()

__get (   $name)

PHP magic method.

Implements following features:

  • Access to column value as $model->columnName

Reimplemented from BaseObject.

◆ asObject()

asObject (   $className)

Create new instance of $className and copy user data into.

Returns
object AuthUserClass

◆ changePassword()

changePassword (   $password)

Change user password.

Parameters
string$password

◆ getCredentials()

getCredentials ( )

Return array [userName, password, defaultPassword].

Returns
array $credentials

◆ getValues()

getValues ( )

Return user values.

Returns
array $values

◆ hasDefaultPassword()

hasDefaultPassword ( )

Check if user uses default password.

Returns
bool $yes

◆ hasRight()

hasRight (   $name,
  $objectId = 0 
)

Check if user has permission $name.

Parameters
string$namePermission
int$objectIdResource object id
Returns
bool $yes

◆ hasRole()

hasRole (   $role)

Check if user has role $role.

Parameters
string$roleRole
Returns
bool $yes

◆ isLogged()

isLogged ( )

Check if user is logged in.

Returns
bool $yes

◆ isValid()

isValid ( )

Check if user exists and he is active.

Returns
bool $yes

◆ passwordVerify()

passwordVerify (   $password)

Verify user password.

Parameters
string$password
Returns
bool $valid

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