pclib  3.3.0
Lightweight PHP framework
AuthBase Class Reference

Base class for most classes of authorization system. More...

Inheritance diagram for AuthBase:
BaseObject Auth AuthConsole AuthManager AuthHttp

Public Member Functions

 __construct ()
 Constructor - load config parameters.
 
 passwordHash (#[\SensitiveParameter] $password)
 Return password hash. More...
 
 passwordHashVerify (#[\SensitiveParameter] $password, #[\SensitiveParameter] $hash)
 Verify password hash. More...
 
 setError ($message,... $args)
 Add error message into ->errors variable. 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

 $errors = array()
 Array of error messages (if any)
 
 $secret
 Secret string used for enpowerment of md5 hash.
 
 $passwordAlgo
 Password algorhitm - can be 'md5', 'bcrypt', 'bcrypt-md5'.
 
 $passwordCost = 10
 Bcrypt cost.
 
 $throwsExceptions = false
 Throws exceptions instead of just collecting errors in ->errors.
 
- Data Fields inherited from BaseObject
 $serviceLocator
 var function() Return service object when requested with service().
 

Protected Member Functions

 log ($category, $messageId, $message=null, $itemId=null)
 log security issue using App->logger.
 
- Protected Member Functions inherited from BaseObject
 service ($service, $default=null)
 Try acquire $service and load it into property $this->$service. More...
 

Protected Attributes

 $app
 var App
 

Additional Inherited Members

- Static Public Member Functions inherited from BaseObject
static defaults (... $args)
 Set or retireve default parameters of the object. More...
 

Detailed Description

Base class for most classes of authorization system.

Member Function Documentation

◆ passwordHash()

passwordHash ( $password[\SensitiveParameter])

Return password hash.

Parameters
string$password
Returns
string $hash

◆ passwordHashVerify()

passwordHashVerify ( $password[\SensitiveParameter],
$hash[\SensitiveParameter] 
)

Verify password hash.

Parameters
string$password
string$hash
Returns
bool $valid

◆ setError()

setError (   $message,
  $args 
)

Add error message into ->errors variable.

Parameters
string$messageMessage with s placeholders

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