Skip to content

Commit

Permalink
fix(issue): php warnings when anonymisation enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Jun 23, 2023
1 parent 9272cda commit f6f01d7
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions inc/issue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -493,13 +493,25 @@ public function rawSearchOptions() {
$hide_technician = false;
$hide_technician_group = false;
if (!Session::isCron()) {
$user = new User();
if (empty($user->getAnonymizedName(Session::getActiveEntity()))) {
$hide_technician = true;
}
$group = new Group();
if (empty($group->getAnonymizedName(Session::getActiveEntity()))) {
$hide_technician_group = true;
$anonymisation = Entity::getUsedConfig(
'anonymize_support_agents',
Session::getActiveEntity()
);
switch ($anonymisation) {
case Entity::ANONYMIZE_USE_GENERIC:
case Entity::ANONYMIZE_USE_NICKNAME:
$hide_technician = true;
$hide_technician_group = true;
break;

case Entity::ANONYMIZE_USE_GENERIC_USER:
case Entity::ANONYMIZE_USE_NICKNAME_USER:
$hide_technician = true;
break;

case Entity::ANONYMIZE_USE_GENERIC_GROUP:
$hide_technician_group = true;
break;
}
}

Expand Down

0 comments on commit f6f01d7

Please sign in to comment.