From d79144298d7aeca8a94928e513983fa5b8860507 Mon Sep 17 00:00:00 2001 From: Thetsmr Date: Thu, 19 Dec 2024 11:40:20 +0100 Subject: [PATCH 1/2] Fix Anonymization For Requesters / Observers --- src/CommonITILObject.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/CommonITILObject.php b/src/CommonITILObject.php index 51439fdb49c..8248259ab6e 100644 --- a/src/CommonITILObject.php +++ b/src/CommonITILObject.php @@ -494,7 +494,12 @@ public function getActorsForType(int $actortype = 1, array $params = []): array // load existing actors (from existing itilobject) if (isset($this->users[$actortype])) { foreach ($this->users[$actortype] as $user) { - $name = getUserName($user['users_id']); + $disable_anonymize = false; + if ($actortype == CommonITILActor::REQUESTER + || $actortype == CommonITILActor::OBSERVER) { + $disable_anonymize = true; + } + $name = getUserName($user['users_id'], 0, $disable_anonymize); $actors[] = [ 'id' => $user['id'], 'items_id' => $user['users_id'], From 03a8e3accbcdf47d47e222220117c421ad8dd54f Mon Sep 17 00:00:00 2001 From: Thetsmr Date: Thu, 19 Dec 2024 12:19:30 +0100 Subject: [PATCH 2/2] Fix CS --- src/CommonITILObject.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CommonITILObject.php b/src/CommonITILObject.php index 8248259ab6e..9d92145d0ce 100644 --- a/src/CommonITILObject.php +++ b/src/CommonITILObject.php @@ -495,8 +495,10 @@ public function getActorsForType(int $actortype = 1, array $params = []): array if (isset($this->users[$actortype])) { foreach ($this->users[$actortype] as $user) { $disable_anonymize = false; - if ($actortype == CommonITILActor::REQUESTER - || $actortype == CommonITILActor::OBSERVER) { + if ( + $actortype == CommonITILActor::REQUESTER + || $actortype == CommonITILActor::OBSERVER + ) { $disable_anonymize = true; } $name = getUserName($user['users_id'], 0, $disable_anonymize);