private function getLdapDataForMatriculationNumbers($arrayOfMatriculationNumbers = TRUE) { if ($arrayOfMatriculationNumbers == FALSE) { return FALSE; } $filterString = ""; $filterStringFirst = TRUE; //build a filter string foreach ($arrayOfMatriculationNumbers as $matriculationNumber) { if ($filterStringFirst) { $filterString = "(upbStudentID=" . $matriculationNumber . ")"; } else { $filterString = "(|" . $filterString . "(upbStudentID=" . $matriculationNumber . "))"; } $filterStringFirst = FALSE; } //$filter = "(|(upbStudentID=6105319)(uid=birger))"; //sample filter string require_once PATH_CLASSES . "lms_ldap.class.php"; try { $lms_ldap = new lms_ldap(); $lms_ldap->bind(LDAP_LOGIN, LDAP_PASSWORD); } catch (Exception $e) { return FALSE; } $ldap_attributes = $lms_ldap->get_ldap_attribute_for_various_data(array("sn", "givenName", "upbStudentID", "uid", "upbMailPreferredAddress"), $filterString); return $ldap_attributes; }