File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 36
36
use AuthLDAP ;
37
37
use Dropdown ;
38
38
use Exception ;
39
+ use Entity ;
39
40
use Html ;
41
+ use QuerySubQuery ;
40
42
use Session ;
41
43
use RuleRightParameter ;
42
44
@@ -53,10 +55,17 @@ public function getDesignSpecializationField(): array {
53
55
if ($ ldap_values === null ) {
54
56
$ ldap_values = [];
55
57
}
56
- $ current_entity = $ _SESSION [ ' glpiactive_entity ' ] ;
58
+ $ current_entity = Session:: getActiveEntity () ;
57
59
$ auth_ldap_condition = '' ;
58
60
if ($ current_entity != 0 ) {
59
- $ auth_ldap_condition = "glpi_authldaps.id = (select glpi_entities.authldaps_id from glpi_entities where id= $ {current_entity}) " ;
61
+ $ entityTable = Entity::getTable ();
62
+ $ auth_ldap_condition = [
63
+ 'glpi_authldaps.id ' => new QuerySubQuery ([
64
+ 'SELECT ' => "$ entityTable.authldaps_id " ,
65
+ 'FROM ' => $ entityTable ,
66
+ 'WHERE ' => ['id ' => $ current_entity ],
67
+ ])
68
+ ];
60
69
}
61
70
$ field = Dropdown::show (AuthLDAP::class, [
62
71
'name ' => 'ldap_auth ' ,
You can’t perform that action at this time.
0 commit comments