Elgg  Version 2.3
Public Member Functions | List of all members
Elgg\Database\SiteSecret Class Reference

Public Member Functions

 __construct (Datalist $datalist)
 Constructor. More...
 
 setTestingSecret ($secret)
 Set a secret to be used in testing. More...
 
 init ()
 Initialise the site secret (32 bytes: "z" to indicate format + 186-bit key in Base64 URL). More...
 
 get ($raw=false)
 Returns the site secret. More...
 
 getStrength ()
 Get the strength of the site secret. More...
 

Detailed Description

Definition at line 22 of file SiteSecret.php.

Constructor & Destructor Documentation

Elgg\Database\SiteSecret::__construct ( Datalist  $datalist)

Constructor.

Parameters
Datalist$datalistDatalist table

Definition at line 34 of file SiteSecret.php.

Member Function Documentation

Elgg\Database\SiteSecret::get (   $raw = false)

Returns the site secret.

Used to generate difficult to guess hashes for sessions and action tokens.

Parameters
bool$rawIf true, a binary key will be returned
Returns
string Site secret. private

Definition at line 83 of file SiteSecret.php.

Elgg\Database\SiteSecret::getStrength ( )

Get the strength of the site secret.

If "weak" or "moderate" is returned, this assumes we're running on the same system that created the key.

Returns
string "strong", "moderate", or "weak" private

Definition at line 121 of file SiteSecret.php.

Elgg\Database\SiteSecret::init ( )

Initialise the site secret (32 bytes: "z" to indicate format + 186-bit key in Base64 URL).

Used during installation and saves as a datalist.

Note: Old secrets were hex encoded.

Returns
mixed The site secret hash or false private

Definition at line 63 of file SiteSecret.php.

Elgg\Database\SiteSecret::setTestingSecret (   $secret)

Set a secret to be used in testing.

Parameters
string$secretTesting site secret. 32 alphanums starting with "z"
Returns
void

Definition at line 49 of file SiteSecret.php.


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