Skip to content

Commit f6f01d7

Browse files
committed
fix(issue): php warnings when anonymisation enabled
1 parent 9272cda commit f6f01d7

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

inc/issue.class.php

+19-7
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,25 @@ public function rawSearchOptions() {
493493
$hide_technician = false;
494494
$hide_technician_group = false;
495495
if (!Session::isCron()) {
496-
$user = new User();
497-
if (empty($user->getAnonymizedName(Session::getActiveEntity()))) {
498-
$hide_technician = true;
499-
}
500-
$group = new Group();
501-
if (empty($group->getAnonymizedName(Session::getActiveEntity()))) {
502-
$hide_technician_group = true;
496+
$anonymisation = Entity::getUsedConfig(
497+
'anonymize_support_agents',
498+
Session::getActiveEntity()
499+
);
500+
switch ($anonymisation) {
501+
case Entity::ANONYMIZE_USE_GENERIC:
502+
case Entity::ANONYMIZE_USE_NICKNAME:
503+
$hide_technician = true;
504+
$hide_technician_group = true;
505+
break;
506+
507+
case Entity::ANONYMIZE_USE_GENERIC_USER:
508+
case Entity::ANONYMIZE_USE_NICKNAME_USER:
509+
$hide_technician = true;
510+
break;
511+
512+
case Entity::ANONYMIZE_USE_GENERIC_GROUP:
513+
$hide_technician_group = true;
514+
break;
503515
}
504516
}
505517

0 commit comments

Comments
 (0)