pclib  2.3.2
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...
 
 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...
 
 passwordVerify ($password)
 Verify 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...
 
 addEvent ($name, $callback)
 Add event handler to $object->$name property. More...
 
 toArray ()
 Convert object to array. More...
 

Data Fields

 $values
 array User account values
 
 $auth
 var Auth
 
- Data Fields inherited from BaseObject
 $onNewInstance
 Occurs when new instance of the class is created. More...
 
 $onMissingMethod
 Occurs when called method does not exist. More...
 
 $serviceLocator
 var function() Return service object when requested with service(). More...
 

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
 fireEvent ($name, array $args=array())
 Run all event handlers in $object->$name property. More...
 
 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

getCredentials ( )

Return array [userName, password, defaultPassword].

Returns
array $credentials
getValues ( )

Return user values.

Returns
array $values
hasDefaultPassword ( )

Check if user uses default password.

Returns
bool $yes
hasRight (   $name,
  $objectId = 0 
)

Check if user has permission $name.

Parameters
string$namePermission
int$objectIdResource object id
Returns
bool $yes
hasRole (   $role)

Check if user has role $role.

Parameters
string$roleRole
Returns
bool $yes
isLogged ( )

Check if user is logged in.

Returns
bool $yes
isValid ( )

Check if user exists and he is active.

Returns
bool $yes
passwordVerify (   $password)

Verify user password.

Parameters
string$password
Returns
bool $valid

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