„LnxUser::modifyGroup” 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::modifyGroup ( array $group ): bool
</syntaxhighlight>Procedural style<syntaxhighlight lang="php">
</syntaxhighlight>Procedural style<syntaxhighlight lang="php">
 
lnxModifyGroup ( array $group ): bool
</syntaxhighlight>
</syntaxhighlight>


 
Modify a linux group with '''group''' parameters
== Parameters ==
== Parameters ==


; <code>group</code>
: Associative array what contains the group's parameters what needs to be modified.  The structure of the array: [
:; <code>'name'</code> => string
:: Mantandory! Name of linux group.
:; <code>'rename'</code> => string
:: Optional. New name of the linux group.
:; <code>'gid'</code> => int
:: Optional. Group ID of linux group. The ID must not exist!
:; <code>'nonunique'</code> => bool
:: Optional. If '''<code>true</code>''' allow to create groups with duplicate (non-unique) Group ID ]


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


 
Returns '''true''' if group is modified, '''false''' otherwise.
== Changelog ==
== Changelog ==
{| class="wikitable"
{| class="wikitable"
24. sor: 34. sor:
== Examples ==
== Examples ==
<syntaxhighlight lang="php">
<syntaxhighlight lang="php">
$user = 'testUser';
$group = 'testGroup';
$group = 'testGroup';
# Modify linux group
if ( ! lnxModifyGroup ( [
'name' => $group, // Mantandory! Name of linux group.
//'rename' => 'RenamedTestGroup', // Optional. New name of the linux group.
'gid' => 1200, // Optional. Group ID of linux group. The ID must not exist!
//'nonunique' => true, // Optional. If true allow to create groups with duplicate (non-unique) Group ID
] ) )
print( "Something went wrong during Modify group!" . PHP_EOL );
else
print( "'$group' group is modified." . PHP_EOL );


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

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

Description

Object-oriented style

public lnxUser::modifyGroup ( array $group ): bool

Procedural style

lnxModifyGroup ( array $group ): bool

Modify a linux group with group parameters

Parameters

group
Associative array what contains the group's parameters what needs to be modified. The structure of the array: [
'name' => string
Mantandory! Name of linux group.
'rename' => string
Optional. New name of the linux group.
'gid' => int
Optional. Group ID of linux group. The ID must not exist!
'nonunique' => bool
Optional. If true allow to create groups with duplicate (non-unique) Group ID ]

Return Values

Returns true if group is modified, false otherwise.

Changelog

Version
(lnxUser)
Description
1.00 available

Examples

$group	= 'testGroup';

# Modify linux group

if ( ! lnxModifyGroup ( [

	'name'			=> $group,				// Mantandory! Name of linux group.
	//'rename'		=> 'RenamedTestGroup',	// Optional. New name of the linux group.
	'gid'			=> 1200,				// Optional. Group ID of linux group. The ID must not exist!
	//'nonunique'	=> true,				// Optional. If true allow to create groups with duplicate (non-unique) Group ID
	
	] ) )
	
	print( "Something went wrong during Modify group!" . PHP_EOL );

else
	
	print( "'$group' group is modified." . PHP_EOL );