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

Innen: IT documentation
a (Moszat átnevezte a(z) LnxUser existsUser lapot LnxUse::existsUser lapra átirányítás nélkül)
a (Moszat átnevezte a(z) LnxUse::existsUser lapot LnxUser::existsUser lapra átirányítás nélkül)

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

Description

Object-oriented style

public lnxUser::existsUser ( string | int $user ): bool

Procedural style

lnxExistsUser ( string | int $user ): bool

Examine that the linux user is exists.

Parameters

user
Name or User ID of linux user.

Return Values

Returns true if user exists, false otherwise.

Changelog

Version

(lnxUser)

Description
1.00 available

Examples

$user	= 'testUser';

# Add linux user

if ( ! lnxAddUser( [
	
	'name'			=> $user,		// Mantandory! Name of linux user.
	'password'		=> 'HelloNSA',	// Mantandory! Password of linux user.
	//'uid'			=> 1100,		// Optional. User ID of linux user. The ID must not exist!
	//'gid'			=> 1100,		// Optional. Primary group of the linux user. The group must exist! If this parameter is not present the Group name will be the User name and the Group ID will be the User ID or the first free ID.
	'groups'		=> [ 'users' ],	// Optional. Group membership of the linux user. It must be a simple indexed array what contains the groups in what the user will be member. The groups must exist.
	//'nogroup'		=> true,		// Optional. If true the Primary group will not be created. If 'gid' is present this parameter will be ineffective.
	'comment'		=> 'test user',	// Optional. Comment (display name) of linux user.
	//'home'		=> '/home/test',// Optional. Absolute path of Home directory of linux user.
	//'createhome'	=> true,		// Optional. If false the Home directory will not be created.
	//'shell'		=> '/bin/bash',	// Optional. Absolute path of shell for linux user.
	//'inactive'	=> 90,			// Optional. The number of days after password expires that account is disabled.
	//'expire'		=> 1640995199,	// Optional. Date when account will be disabled. Format: timestamp.
	//'system'		=> true,		// Optional. If true create a system account. User ID will be under 1000. If 'uid' is present this parameter will be ineffective.
	//'nonunique'	=> true	,		// Optional. If true allow to create users with duplicate (non-unique) User ID.
	
	] ) )
	
	print( "Something went wrong during Add user!" . PHP_EOL );

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