„LnxUser::deleteUser” változatai közötti eltérés

Innen: IT documentation
Nincs szerkesztési összefoglaló
 
9. sor: 9. sor:
== Parameters ==
== Parameters ==


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

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 );