„LnxUser::setDefaultPasswordHash” változatai közötti eltérés
Innen: IT documentation
Nincs szerkesztési összefoglaló |
|||
| 1. sor: | 1. sor: | ||
== Description == | == Description == | ||
Object-oriented style<syntaxhighlight lang="php"> | Object-oriented style<syntaxhighlight lang="php"> | ||
public lnxUser::setDefaultPasswordHash( string $hash ): bool | |||
</syntaxhighlight>Procedural style<syntaxhighlight lang="php"> | </syntaxhighlight>Procedural style<syntaxhighlight lang="php"> | ||
public lnxSetDefaultPasswordHash( string $hash ): bool | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Set the default password hash method. | |||
MD5, SHA-256, SHA-512 password hash methods are implemented. | |||
== Parameters == | == Parameters == | ||
; | ; hash | ||
: | :: Hash algorithm type. Use [[LnxUser PHP Class Reference|LNX_PH family of constants]]. | ||
:: If empty will be used the default hash method. | |||
== Return Values == | == Return Values == | ||
Returns '''true''' if setting is success, '''false''' otherwise. | |||
== Changelog == | == Changelog == | ||
{| class="wikitable" | {| class="wikitable" | ||
| 26. sor: | 29. sor: | ||
== Examples == | == Examples == | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
$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 ); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Kategória:LnxUser]] | [[Kategória:LnxUser]] | ||
A lap 2021. szeptember 21., 20:32-kori változata
Description
Object-oriented style
public lnxUser::setDefaultPasswordHash( string $hash ): bool
Procedural style
public lnxSetDefaultPasswordHash( string $hash ): bool
Set the default password hash method.
MD5, SHA-256, SHA-512 password hash methods are implemented.
Parameters
- hash
-
- Hash algorithm type. Use LNX_PH family of constants.
- If empty will be used the default hash method.
Return Values
Returns true if setting is success, false otherwise.
Changelog
| Version (lnxUser) |
Description |
|---|---|
| 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 );