BUG 9894 Active Directory User Import not working SOLVED

- Fields deprecated and wrong default filter for the ldap class
- Those parameters are not used, now it is only used the additional filter, with this field you can create the same filters or more complex filters.

Also, we've detected that the filter by default we are using the following condition: (objectCategory=person)

So, your filter is not working anymore, now we have been removed that condition to search in all objects and if you want to limit the objects on which searches can be done, you have to add your own filter.
This commit is contained in:
Julio Cesar Laura
2012-11-27 16:32:20 -04:00
parent 86087f7993
commit 6d7c9f5da7
3 changed files with 60 additions and 134 deletions

View File

@@ -148,9 +148,9 @@ class LDAP
}
}
$sFilter = '(&(|(objectClass=*))';
if ( isset( $aAuthSource['AUTH_SOURCE_DATA']['LDAP_TYPE']) && $aAuthSource['AUTH_SOURCE_DATA']['LDAP_TYPE'] == 'ad' ) {
$sFilter = "(&(|(objectClass=*))(|(samaccountname=$sKeyword)(userprincipalname=$sKeyword))(objectCategory=person))";
$sFilter = "(&(|(objectClass=*))(|(samaccountname=$sKeyword)(userprincipalname=$sKeyword)))";
}
else
$sFilter = "(&(|(objectClass=*))(|(uid=$sKeyword)(cn=$sKeyword)))";
@@ -158,7 +158,7 @@ class LDAP
//G::pr($sFilter);
$aUsers = array();
$oSearch = @ldap_search($oLink, $aAuthSource['AUTH_SOURCE_BASE_DN'], $sFilter, array('dn','uid','samaccountname', 'cn','givenname','sn','mail','userprincipalname','objectcategory', 'manager'));
if ($oError = @ldap_errno($oLink)) {
return $aUsers;
}
@@ -179,7 +179,7 @@ class LDAP
'sFirstname' => isset($aAttr['givenname']) ? $aAttr['givenname'] : '',
'sLastname' => isset($aAttr['sn']) ? $aAttr['sn'] : '',
'sEmail' => isset($aAttr['mail']) ? $aAttr['mail'] : ( isset($aAttr['userprincipalname'])?$aAttr['userprincipalname'] : '') ,
'sDN' => $aAttr['dn'] );
'sDN' => $aAttr['dn'] );
}
} while ($oEntry = @ldap_next_entry($oLink, $oEntry));
}