LnxUser::setDefaultPasswordHash

Innen: IT documentation

Description

Object-oriented style

public lnxUser::setDefaultPasswordHash( string $hash, string $salt = '', string | int $round = '' ): bool

Procedural style

public lnxSetDefaultPasswordHash( string $hash, string $salt = '', string | int $round = '' ): bool

Set the default password hash method.

DES, MD5, BLOWFISH, SHA-256, SHA-512 password hash methods are implemented.

Parameters

hash
Hash algorithm type. Use LNX_PH family of constants.
salt
Default password hash salt
round
Default password hash round

You can read about password hash, salt, round relationships and requirements here.

Return Values

Returns true if setting is success, false otherwise.

Changelog

Version
(lnxUser)
Description
1.2 add: default salt and round
1.1 available

Examples

$user	= 'testUser';

lnxAddUser( [
	'name'			=> $user,		
	'password'		=> 'HelloNSA',
	] );

$array = lnxGetUser ( $user );
print( $array['password'] . PHP_EOL );

lnxSetDefaultPasswordHash( LNX_PH_MD5 );

lnxModifyUser ( [
	'name'			=> $user,
	'password'		=> 'HelloAgainNSA',	
	] );
	
$array = lnxGetUser ( $user );
print( $array['password'] . PHP_EOL );