LSldapObject: specify object type filter on loading data

This commit is contained in:
Benjamin Renard 2020-05-14 11:07:18 +02:00
parent f7c4050b70
commit 510f3d4bdc

View file

@ -92,8 +92,8 @@ class LSldapObject extends LSlog_staticLoggerClass {
*/
public function loadData($dn) {
$this -> dn = $dn;
$data = LSldap :: getAttrs($dn);
if(!empty($data)) {
$data = LSldap :: getAttrs($dn, $this -> getObjectFilter());
if(is_array($data) && !empty($data)) {
foreach($this -> attrs as $attr_name => $attr) {
if( !$this -> attrs[$attr_name] -> loadData( (isset($data[$attr_name])?$data[$attr_name]:NULL) ) )
return;