LnxUser::deleteUser
Innen: IT documentation
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 );