public function getLdapData($matriculationNumber) { $user = array(); //[matnr][imtLogin][LastName][FirstName] require_once PATH_CLASSES . "lms_ldap.class.php"; try { $lms_ldap = new lms_ldap(); $lms_ldap->bind(LDAP_LOGIN, LDAP_PASSWORD); } catch (Exception $e) { //paul_sync_log("PAUL_SYNC\t" . $e->getMessage(), PAUL_SYNC_LOGLEVEL_ERROR ); return FALSE; } $uid = $lms_ldap->studentid2uid($matriculationNumber); $user["imtLogin"] = $uid; $ldap_attributes = $lms_ldap->get_ldap_attribute(array("sn", "givenName", "upbMailPreferredAddress"), $uid); $user["upbMailPreferredAddress"] = $ldap_attributes["upbMailPreferredAddress"]; $user["firstname"] = $ldap_attributes["givenName"]; $user["lastname"] = $ldap_attributes["sn"]; $user["mnr"] = $matriculationNumber; if (!isset($user["firstname"])) { return FALSE; } if (!isset($user["lastname"])) { return FALSE; } if (!isset($user["mnr"])) { return FALSE; } //return ldap data return $user; }