pclib  2.9.5
Lightweight PHP framework
Public Member Functions
AuthHttp Class Reference

Http authentication. More...

Inheritance diagram for AuthHttp:
Auth AuthBase BaseObject

Public Member Functions

 loginHttp ()
 Show http-login dialog, or verify client credentials.
 
 logout ()
 Logout active user.
 
- Public Member Functions inherited from Auth
 setLoggedUser (pclib\AuthUser $user=null)
 Take $user and log him in. More...
 
 getUser ($userName=null)
 Without parameter it returns logged user, user $userName otherwise. More...
 
 reloadLoggedUser ()
 Reload logged user from database. More...
 
 exists ($userName)
 Check if user $userName exists. More...
 
 getStorage ()
 Return storage object - if not exists, create one.
 
 login ($userName, $password)
 Authenticate user $userName with password $password. More...
 
 testRight ($name, $objectId=0)
 Check if logged user has permission $name. More...
 
 isLogged ()
 Check if someone is logged in.
 
 hasRight ($name, $objectId=0)
 Check if logged user has permission $name. More...
 
 hasRole ($role)
 Check if logged user has role $role. More...
 
- Public Member Functions inherited from AuthBase
 __construct ()
 Constructor - load config parameters.
 
 passwordHash ($password)
 Return password hash. More...
 
 passwordHashVerify ($password, $hash)
 Verify password hash. More...
 
 setError ($message)
 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from BaseObject
static defaults ()
 Set or retireve default parameters of the object. More...
 
- Data Fields inherited from Auth
 $storage
 var AuthDbStorage
 
 $realm
 Apps with the same realm share authentization session.
 
 $verifyRemote = true
 Check if remote address changed.
 
 $cleanDefaultPassword = true
 Delete plain-text default password from database on first login.
 
 $loggedUser
 var AuthUser User which is logged in.
 
- Data Fields inherited from AuthBase
 $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 inherited from Auth
 getUserIp (pclib\AuthUser $user)
 Get user ip-address, check if changed and log notice if so.
 
 getSessionUser ()
 Load user from session storage, check session validity. More...
 
 setSessionUser (pclib\AuthUser $user=null)
 Store user to session. More...
 
- Protected Member Functions inherited from AuthBase
 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 inherited from AuthBase
 $app
 var App
 

Detailed Description

Http authentication.

Usage: Call $auth->loginHttp(); before any protected page of the web.


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