Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions resources/lib/UnityGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,6 @@ public function approveUser(UnityUser $new_user, bool $send_mail = true): void
\ensure($new_user->exists());
$this->addMemberUID($new_user->uid);
$this->SQL->removeRequest($new_user->uid, $this->gid);
$this->SQL->addLog(
"approved_user",
_json_encode(["user" => $new_user->uid, "group" => $this->gid]),
);
if ($send_mail) {
$this->MAILER->sendMail($new_user->getMail(), "group_user_added", [
"group" => $this->gid,
Expand Down Expand Up @@ -255,10 +251,6 @@ public function removeUser(UnityUser $new_user, bool $send_mail = true): void
throw new Exception("Cannot delete group owner from group. Disable group instead");
}
$this->removeMemberUID($new_user->uid);
$this->SQL->addLog(
"removed_user",
_json_encode(["user" => $new_user->uid, "group" => $this->gid]),
);
if ($send_mail) {
$this->MAILER->sendMail($new_user->getMail(), "group_user_removed", [
"group" => $this->gid,
Expand Down Expand Up @@ -482,12 +474,19 @@ public function getManagerUIDs(): array
return $this->entry->getAttribute("managerUid");
}

public function addMemberUID(string $uid): void
{
parent::addMemberUID($uid);
$this->SQL->addLog("added_user", _json_encode(["user" => $uid, "group" => $this->gid]));
}

public function removeMemberUID(string $uid): void
{
if ($this->managerUIDExists($uid)) {
$this->removeManagerUID($uid);
}
parent::removeMemberUID($uid);
$this->SQL->addLog("removed_user", _json_encode(["user" => $uid, "group" => $this->gid]));
}

public function addPlusAddressToMail(string $mail): string
Expand Down