„LnxUser::deleteUser” 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…”)
 
 
(Egy 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::deleteUser ( string | int | array $user ): bool
</syntaxhighlight>Procedural style<syntaxhighlight lang="php">
</syntaxhighlight>Procedural style<syntaxhighlight lang="php">
 
lnxDeleteUser ( string | int | array $user ): bool
</syntaxhighlight>
</syntaxhighlight>


 
Delete a linux user.
== Parameters ==
== Parameters ==


; user
: User Name or User ID or an associative array what contains the parameters of deleting user.
: The sructure of the the array:
: [
:; 'name' => string
:: Mantandory! Name of linux user.
:; 'remove' => bool
:: Optional. If '''true''' remove home directory and mail spool.
:; 'force' => bool
:: Optional. If '''true''', force removal of files, even if not owned by user and remove user, even if the user is logged in.
: ]


== Return Values ==
== Return Values ==


 
Returns '''true''' if user is deleted, '''false''' otherwise.
== Changelog ==
== Changelog ==
{| class="wikitable"
{| class="wikitable"
25. sor: 36. sor:
<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
$user = 'testUser';
$user = 'testUser';
$group = 'testGroup';
 
# Delete linux user
 
if ( ! lnxDeleteUser ( $user ) )
print( "Something went wrong during Delete user!" . PHP_EOL );
 
else
print( "'$user' user is deleted." . PHP_EOL );


</syntaxhighlight>
</syntaxhighlight>
[[Kategória:LnxUser]]
[[Kategória:LnxUser]]

A lap jelenlegi, 2021. szeptember 19., 16:08-kori változata

Description

Object-oriented style

public lnxUser::deleteUser ( string | int | array $user ): bool

Procedural style

lnxDeleteUser ( string | int | array $user ): bool

Delete a linux user.

Parameters

user
User Name or User ID or an associative array what contains the parameters of deleting user.
The sructure of the the array:
[
'name' => string
Mantandory! Name of linux user.
'remove' => bool
Optional. If true remove home directory and mail spool.
'force' => bool
Optional. If true, force removal of files, even if not owned by user and remove user, even if the user is logged in.
]

Return Values

Returns true if user is deleted, false otherwise.

Changelog

Version
(lnxUser)
Description
1.00 available

Examples

$user	= 'testUser';

# Delete linux user

if ( ! lnxDeleteUser ( $user ) )
	
	print( "Something went wrong during Delete user!" . PHP_EOL );

else
	
	print( "'$user' user is deleted." . PHP_EOL );