/** * Queries the LDAP server and returns the DN for the specified OMERO user * ID. The LDAP server is queried and the DN returned only for IDs that have * the <code>ldap</code> flag enabled. * * @param id * The user ID. * @return The DN as a String. Null if user isn't from LDAP. */ public String lookupLdapAuthExperimenter(Long id) { // First, check that the supplied user ID is an LDAP user String dn = null; Experimenter experimenter = iQuery.get(Experimenter.class, id); if (experimenter.getLdap()) { dn = findDN(experimenter.getOmeName()); } return dn; }
return getInstitution(); } else if (field.equals(LDAP)) { return getLdap(); } else if (field.equals(EMAIL)) { return getEmail();
protected Experimenter copyUser(Experimenter e) { if (e.getOmeName() == null) { throw new ValidationException("OmeName may not be null."); } Experimenter copy = new Experimenter(); copy.setOmeName(e.getOmeName()); copy.setFirstName(e.getFirstName()); copy.setMiddleName(e.getMiddleName()); copy.setLastName(e.getLastName()); copy.setEmail(e.getEmail()); copy.setInstitution(e.getInstitution()); copy.setLdap(e.getLdap()); copy.setConfig(e.getConfig()); if (e.getDetails() != null && e.getDetails().getPermissions() != null) { copy.getDetails().setPermissions(e.getDetails().getPermissions()); } // TODO make ShallowCopy-like which ignores collections and details. // if possible, values should be validated. i.e. iTypes should say what // is non-null return copy; }