„LnxUser::getGroup” 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::getGroup ( string | int $group ): array
</syntaxhighlight>Procedural style<syntaxhighlight lang="php">
</syntaxhighlight>Procedural style<syntaxhighlight lang="php">
 
lnxGetGroup ( string | int $group ): array
</syntaxhighlight>
</syntaxhighlight>


Returns informations about the linux group.
== Parameters ==


== Parameters ==
; group
: Name or Group ID of linux group.


== Return Values ==
== Return Values ==
Returns an '''array''' what contains the information about group, or '''false''' if group is not exists.
Structure of array:
[
; 'name' => string
: Name of linux group.
; 'gid' => int
: Group ID of linux group.
; 'members' => array
: It is a simple indexed array what contains the users who is member of this group.  Note: Contains the users too to whom this group is primary group!
]


== Changelog ==
== Changelog ==
22. sor: 39. sor:
== Examples ==
== Examples ==
<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
$user = 'testUser';
$group = 'testGroup';
$group = 'testGroup';
# Query information about the linux group
print( "Information of '$group' group:" . PHP_EOL );
if ( lnxExistsGroup( $group ) )
foreach ( lnxGetGroup ( $group ) as $key => $value ) {
print( $key . ' : ' );
if ( is_array( $value ) )
print( implode ( ',', $value ) );
else
print( $value );
print( PHP_EOL );
}


</syntaxhighlight>
</syntaxhighlight>
[[Kategória:LnxUser]]
[[Kategória:LnxUser]]

A lap jelenlegi, 2021. szeptember 19., 15:42-kori változata

Description

Object-oriented style

public lnxUser::getGroup ( string | int $group ): array

Procedural style

lnxGetGroup ( string | int $group ): array

Returns informations about the linux group.

Parameters

group
Name or Group ID of linux group.

Return Values

Returns an array what contains the information about group, or false if group is not exists.

Structure of array:

[

'name' => string
Name of linux group.
'gid' => int
Group ID of linux group.
'members' => array
It is a simple indexed array what contains the users who is member of this group. Note: Contains the users too to whom this group is primary group!

]

Changelog

Version
(lnxUser)
Description
1.00 available

Examples

$group	= 'testGroup';

# Query information about the linux group

print( "Information of '$group' group:" . PHP_EOL );

if ( lnxExistsGroup( $group ) )

	foreach ( lnxGetGroup ( $group ) as $key => $value ) {

		print( $key . ' : ' );

		if ( is_array( $value ) ) 

			print( implode ( ',', $value ) );

		else

			print( $value );

		print( PHP_EOL );

	}