Skip to content

Commit 0da224d

Browse files
committed
add batch member add/rm functions
1 parent 42c7a08 commit 0da224d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

resources/lib/PosixGroup.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,28 @@ public function addMemberUID(string $uid): void
6060
$this->entry->write();
6161
}
6262

63+
public function addMemberUIDs(array $uids): void
64+
{
65+
foreach ($uids as $uid) {
66+
$this->entry->appendAttribute("memberuid", $uid);
67+
}
68+
$this->entry->write();
69+
}
70+
6371
public function removeMemberUID(string $uid): void
6472
{
6573
$this->entry->removeAttributeEntryByValue("memberuid", $uid);
6674
$this->entry->write();
6775
}
6876

77+
public function removeMemberUIDs(array $uids): void
78+
{
79+
foreach ($uids as $uid) {
80+
$this->entry->removeAttributeEntryByValue("memberuid", $uid);
81+
}
82+
$this->entry->write();
83+
}
84+
6985
public function mermberUIDExists(string $uid): bool
7086
{
7187
return in_array($uid, $this->getMemberUIDs());

0 commit comments

Comments
 (0)