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 3636use AuthLDAP ;
3737use Dropdown ;
3838use Exception ;
39+ use Entity ;
3940use Html ;
41+ use QuerySubQuery ;
4042use Session ;
4143use RuleRightParameter ;
4244
@@ -53,10 +55,17 @@ public function getDesignSpecializationField(): array {
5355 if ($ ldap_values === null ) {
5456 $ ldap_values = [];
5557 }
56- $ current_entity = $ _SESSION [ ' glpiactive_entity ' ] ;
58+ $ current_entity = Session:: getActiveEntity () ;
5759 $ auth_ldap_condition = '' ;
5860 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+ ];
6069 }
6170 $ field = Dropdown::show (AuthLDAP::class, [
6271 'name ' => 'ldap_auth ' ,
You can’t perform that action at this time.
0 commit comments