Skip to content

Commit

Permalink
fix(issue): restrict user dropdowns to current user in service catalog
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <[email protected]>
  • Loading branch information
btry committed Apr 16, 2021
1 parent 44d061c commit cedfe55
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions inc/issue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ public function rawSearchOptions() {
}
$tab[] = $newtab;

$tab[] = [
$newtab = [
'id' => '9',
'table' => 'glpi_users',
'field' => 'name',
Expand All @@ -508,6 +508,11 @@ public function rawSearchOptions() {
'datatype' => 'dropdown',
'massiveaction' => false
];
if (!Session::isCron() // no filter for cron
&& Session::getCurrentInterface() == 'helpdesk') {
$newtab['right'] = 'id';
}
$tab[] = $newtab;

$tab[] = [
'id' => '10',
Expand All @@ -518,7 +523,7 @@ public function rawSearchOptions() {
'massiveaction' => false
];

$tab[] = [
$newtab = [
'id' => '11',
'table' => 'glpi_users',
'field' => 'name',
Expand Down Expand Up @@ -547,8 +552,13 @@ public function rawSearchOptions() {
]
]
];
if (!Session::isCron() // no filter for cron
&& Session::getCurrentInterface() == 'helpdesk') {
$newtab['right'] = 'id';
}
$tab[] = $newtab;

$tab[] = [
$newtab = [
'id' => '14',
'table' => User::getTable(),
'field' => 'name',
Expand All @@ -569,6 +579,11 @@ public function rawSearchOptions() {
]
]
];
if (!Session::isCron() // no filter for cron
&& Session::getCurrentInterface() == 'helpdesk') {
$newtab['right'] = 'id';
}
$tab[] = $newtab;

$tab[] = [
'id' => '15',
Expand Down

0 comments on commit cedfe55

Please sign in to comment.