„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…”) |
Nincs szerkesztési összefoglaló |
||
| 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 == | ||
; <code>user</code> | |||
: User Name or User ID or an associative array what contains the parameters of deleting user. Structure of the array: [ | |||
:; <code>'name'</code> => string | |||
:: Mantandory! Name of linux user. | |||
:; <code>'remove'</code> => bool | |||
:: Optional. If '''<code>true</code>''' remove home directory and mail spool. | |||
:; <code>'force'</code> => 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. ] | |||
== Return Values == | == Return Values == | ||
Returns '''true''' if user is deleted, '''false''' otherwise. | |||
== Changelog == | == Changelog == | ||
{| class="wikitable" | {| class="wikitable" | ||
| 25. sor: | 33. sor: | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
$user = 'testUser'; | $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 ); | |||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Kategória:LnxUser]] | [[Kategória:LnxUser]] | ||
A lap 2021. szeptember 19., 16:07-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. Structure of the array: [
'name'=> string- Mantandory! Name of linux user.
'remove'=> bool- Optional. If
trueremove 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 );