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

Public Member Functions

 hash ($password)
 Create a password hash. More...
 
 needsRehash ($hash)
 Check if a hash needs rehashing. More...
 
 verify ($password, $hash)
 Verify a password. More...
 
 known ($password)
 Check if a password is a 'known' password (found on public available lists). More...
 
 strength ($password)
 Calculate password strength. More...
 
- Public Member Functions inherited from Authenticator
 verified ($result)
 Process the result of a verification. More...
 
 regenerateSessionId ()
 
 invalidate ()
 
- 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

 $passwordAlgo = PASSWORD_DEFAULT
 
 $strengthKeyboard
 
 $strengthCharSets
 
 $strengthCharSetChangeScore = 5
 
- Data Fields inherited from Authenticator
 $maxSessionTime = null
 Maximum duration of a session (minutes; empty = infinite). More...
 
 $maxInactiveTime = null
 Maximum period of inactivity (minutes; empty = infinite). More...
 
 $controllerName = null
 Controller to redirect the user to if more information is required (e.g. a username and. 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

 check ()
 
- Protected Member Functions inherited from Authenticator
 check ()
 Perform the check. More...
 
 getAuthenticated ()
 
 getChecked ()
 
 setChecked ($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...
 

Additional Inherited Members

- 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 Password.php.

Member Function Documentation

◆ check()

check ( )
protected

Definition at line 24 of file Password.php.

◆ hash()

hash (   $password)

Create a password hash.

Parameters
string$password
Returns
string Password hash.
See also
http://php.net/password_hash

Definition at line 33 of file Password.php.

◆ known()

known (   $password)

Check if a password is a 'known' password (found on public available lists).

Parameters
string$passwordUser password.
Returns
bool True if the password was found on a list.

Definition at line 61 of file Password.php.

◆ needsRehash()

needsRehash (   $hash)

Check if a hash needs rehashing.

Parameters
string$hashStored hash.
Returns
bool True if rehashing is advised.
See also
http://php.net/password_needs_rehash

Definition at line 42 of file Password.php.

◆ strength()

strength (   $password)

Calculate password strength.

Parameters
string$passwordUser password.
Returns
int Calculated strength, based on score settings.

Definition at line 69 of file Password.php.

◆ verify()

verify (   $password,
  $hash 
)

Verify a password.

Parameters
string$passwordUser password.
string$hashStored hash.
Returns
bool True if the password and hash match.
See also
http://php.net/password_verify

Definition at line 52 of file Password.php.

Field Documentation

◆ $passwordAlgo

$passwordAlgo = PASSWORD_DEFAULT

Definition at line 7 of file Password.php.

◆ $strengthCharSetChangeScore

$strengthCharSetChangeScore = 5

Definition at line 22 of file Password.php.

◆ $strengthCharSets

$strengthCharSets
Initial value:
= [
'abcdefghijklmnopqrstuvwxyz' => 1

Definition at line 15 of file Password.php.

◆ $strengthKeyboard

$strengthKeyboard
Initial value:
= [
['`~','1!','2@','3#','4$','5%','6^','7&','8*','9(','0)','-_','=+'],
[null,'qQ','wW','eE','rR','tT','yY','uU','iI','oO','pP','[{',']}','\\|'],
[null,'aA','sS','dD','fF','gG','hH','jJ','kK','lL',';:','\'"'],
[null,'zZ','xX','cC','vV','bB','nN','mM',',<','.>','/?']
]

Definition at line 9 of file Password.php.


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