„LnxUser::authUser” változatai közötti eltérés
Innen: IT documentation
(Új oldal, tartalma: „== Description == Object-oriented style<syntaxhighlight lang="php"> </syntaxhighlight>Procedural style<syntaxhighlight lang="php"> </syntaxhighlight> == Parameters…”) |
|||
| (3 közbenső módosítás ugyanattól a szerkesztőtől nincs mutatva) | |||
| 1. sor: | 1. sor: | ||
== Description == | == Description == | ||
Object-oriented style<syntaxhighlight lang="php"> | Object-oriented style<syntaxhighlight lang="php"> | ||
public lnxUser::authUser ( string $user, string $password ): bool | |||
</syntaxhighlight>Procedural style<syntaxhighlight lang="php"> | </syntaxhighlight>Procedural style<syntaxhighlight lang="php"> | ||
lnxAuthUser ( string $user, string $password ): bool | |||
</syntaxhighlight> | |||
Authenticate a linux user. | |||
DES, MD5, BLOWFISH, SHA-256, SHA-512 password hash methods are implemented. | |||
== Parameters == | == Parameters == | ||
; user | |||
: Name of the linux user | |||
; password | |||
: Password of the linux user | |||
== Return Values == | == Return Values == | ||
Returns '''true''' if user authenticate is success, '''false''' otherwise. | |||
== Changelog == | == Changelog == | ||
{| class="wikitable" | {| class="wikitable" | ||
!Version<br>(lnxUser) | !Version<br>(lnxUser) | ||
!Description | !Description | ||
|- | |||
|1.1 | |||
|add: use systemlog | |||
|- | |- | ||
|1.00 | |1.00 | ||
| 25. sor: | 35. sor: | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
$user = 'testUser'; | $user = 'testUser'; | ||
$ | |||
# Authenticate linux user | |||
if ( lnxAuthUser( $user, 'HelloNSA' ) ) | |||
print( "'$user' user authentication is success!" . PHP_EOL ); | |||
else | |||
print( "'$user' user authentication is failed!" . PHP_EOL ); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Kategória:LnxUser]] | [[Kategória:LnxUser]] | ||
A lap jelenlegi, 2021. szeptember 24., 11:24-kori változata
Description
Object-oriented style
public lnxUser::authUser ( string $user, string $password ): bool
Procedural style
lnxAuthUser ( string $user, string $password ): bool
Authenticate a linux user.
DES, MD5, BLOWFISH, SHA-256, SHA-512 password hash methods are implemented.
Parameters
- user
- Name of the linux user
- password
- Password of the linux user
Return Values
Returns true if user authenticate is success, false otherwise.
Changelog
| Version (lnxUser) |
Description |
|---|---|
| 1.1 | add: use systemlog |
| 1.00 | available |
Examples
$user = 'testUser';
# Authenticate linux user
if ( lnxAuthUser( $user, 'HelloNSA' ) )
print( "'$user' user authentication is success!" . PHP_EOL );
else
print( "'$user' user authentication is failed!" . PHP_EOL );