Skip to content

Commit cedfe55

Browse files
committed
fix(issue): restrict user dropdowns to current user in service catalog
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent 44d061c commit cedfe55

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

inc/issue.class.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ public function rawSearchOptions() {
499499
}
500500
$tab[] = $newtab;
501501

502-
$tab[] = [
502+
$newtab = [
503503
'id' => '9',
504504
'table' => 'glpi_users',
505505
'field' => 'name',
@@ -508,6 +508,11 @@ public function rawSearchOptions() {
508508
'datatype' => 'dropdown',
509509
'massiveaction' => false
510510
];
511+
if (!Session::isCron() // no filter for cron
512+
&& Session::getCurrentInterface() == 'helpdesk') {
513+
$newtab['right'] = 'id';
514+
}
515+
$tab[] = $newtab;
511516

512517
$tab[] = [
513518
'id' => '10',
@@ -518,7 +523,7 @@ public function rawSearchOptions() {
518523
'massiveaction' => false
519524
];
520525

521-
$tab[] = [
526+
$newtab = [
522527
'id' => '11',
523528
'table' => 'glpi_users',
524529
'field' => 'name',
@@ -547,8 +552,13 @@ public function rawSearchOptions() {
547552
]
548553
]
549554
];
555+
if (!Session::isCron() // no filter for cron
556+
&& Session::getCurrentInterface() == 'helpdesk') {
557+
$newtab['right'] = 'id';
558+
}
559+
$tab[] = $newtab;
550560

551-
$tab[] = [
561+
$newtab = [
552562
'id' => '14',
553563
'table' => User::getTable(),
554564
'field' => 'name',
@@ -569,6 +579,11 @@ public function rawSearchOptions() {
569579
]
570580
]
571581
];
582+
if (!Session::isCron() // no filter for cron
583+
&& Session::getCurrentInterface() == 'helpdesk') {
584+
$newtab['right'] = 'id';
585+
}
586+
$tab[] = $newtab;
572587

573588
$tab[] = [
574589
'id' => '15',

0 commit comments

Comments
 (0)