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

Innen: IT documentation
Nincs szerkesztési összefoglaló
Nincs szerkesztési összefoglaló
 
1. sor: 1. sor:
== Description ==
== Description ==
Object-oriented style<syntaxhighlight lang="php">
Object-oriented style<syntaxhighlight lang="php">
 
public lnxUser::isMember ( string $user, string $group ): bool
</syntaxhighlight>Procedural style<syntaxhighlight lang="php">
</syntaxhighlight>Procedural style<syntaxhighlight lang="php">
 
lnxIsMember ( string $user, string $group ): bool
</syntaxhighlight>
</syntaxhighlight>


 
Determines if a linux user is member of a group.
== Parameters ==
== Parameters ==


; user
: Name of the linux user
; group
: Name of the linux group


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


 
Returns '''true''' if the user is member of the group, '''false''' otherwise.
== Changelog ==
== Changelog ==
{| class="wikitable"
{| class="wikitable"
27. sor: 31. sor:
$group = 'testGroup';
$group = 'testGroup';


# Examine if user is a member of the group
if ( lnxIsMember( $user, $group ) )
print( "'$user' user is in the '$group' group." . PHP_EOL );
else
print( "'$user' user is not in the '$group' group." . PHP_EOL );
</syntaxhighlight>
</syntaxhighlight>
[[Kategória:LnxUser]]
[[Kategória:LnxUser]]

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

Description

Object-oriented style

public lnxUser::isMember ( string $user, string $group ): bool

Procedural style

lnxIsMember ( string $user, string $group ): bool

Determines if a linux user is member of a group.

Parameters

user
Name of the linux user
group
Name of the linux group

Return Values

Returns true if the user is member of the group, false otherwise.

Changelog

Version
(lnxUser)
Description
1.00 available

Examples

$user	= 'testUser';
$group	= 'testGroup';

# Examine if user is a member of the group

if ( lnxIsMember( $user, $group ) )

	print( "'$user' user is in the '$group' group." . PHP_EOL );

else
	
	print( "'$user' user is not in the '$group' group." . PHP_EOL );