phpBB API Documentation
Class

phpbb\passwords\manager

class manager

Properties

$algorithms Service collection of hashing algorithms Needs to be public for passwords helper
$convert_flag Password convert flag.

Methods

__construct(config $config, array $hashing_algorithms, helper $helper, array $defaults)

Construct a passwords object

object|bool detect_algorithm(string $hash)

Detect the hash type of the supplied hash

string|bool hash(string $password, string $type = '')

Hash supplied password

string|bool check(string $password, string $hash, array $user_row = array())

Check supplied password against hash and set convert_flag if password needs to be converted to different format (preferrably newer one)

string|bool combined_hash_password(string $password_hash, string $type)

Create combined hash from already hashed password

bool check_combined_hash(string $password, array $stored_hash_type, string $hash)

Check combined password hash against the supplied password

Details

at line 75
public __construct(config $config, array $hashing_algorithms, helper $helper, array $defaults)

Construct a passwords object

Parameters

config $config phpBB configuration
array $hashing_algorithms Hashing driver service collection
helper $helper Passwords helper object
array $defaults List of default driver types

at line 160
public object|bool detect_algorithm(string $hash)

Detect the hash type of the supplied hash

Parameters

string $hash Password hash that should be checked

Return Value

object|bool The hash type object or false if the specified type is not supported

at line 214
public string|bool hash(string $password, string $type = '')

Hash supplied password

Parameters

string $password Password that should be hashed
string $type Hash type. Will default to standard hash type if none is supplied

Return Value

string|bool Password hash of supplied password or false if if something went wrong during hashing

at line 260
public string|bool check(string $password, string $hash, array $user_row = array())

Check supplied password against hash and set convert_flag if password needs to be converted to different format (preferrably newer one)

Parameters

string $password Password that should be checked
string $hash Stored hash
array $user_row User's row in users table

Return Value

string|bool True if password is correct, false if not

at line 337
public string|bool combined_hash_password(string $password_hash, string $type)

Create combined hash from already hashed password

Parameters

string $password_hash Complete current password hash
string $type Type of the hashing algorithm the password hash should be combined with

Return Value

string|bool Combined password hash if combined hashing was successful, else false

at line 388
public bool check_combined_hash(string $password, array $stored_hash_type, string $hash)

Check combined password hash against the supplied password

Parameters

string $password Password entered by user
array $stored_hash_type An array containing the hash types as described by stored password hash
string $hash Stored password hash

Return Value

bool True if password is correct, false if not