X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.util%2Fsrc%2Forg%2Fargeo%2Fosgi%2Fuseradmin%2FOsUserDirectory.java;h=e1ad5edf5372a7ce5eb17996f6e7faffa4de194c;hb=1d6840195189cbdbf632ca2800b6179d3b6349df;hp=1adc7e0dfe6f1806b0b7186a8a5ef2d75e6aa5f7;hpb=dc27b57704278684e72efcaf72b01c5b91df39f8;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.util/src/org/argeo/osgi/useradmin/OsUserDirectory.java b/org.argeo.util/src/org/argeo/osgi/useradmin/OsUserDirectory.java index 1adc7e0df..e1ad5edf5 100644 --- a/org.argeo.util/src/org/argeo/osgi/useradmin/OsUserDirectory.java +++ b/org.argeo.util/src/org/argeo/osgi/useradmin/OsUserDirectory.java @@ -6,7 +6,6 @@ import java.util.List; import javax.naming.NameNotFoundException; import javax.naming.NamingException; import javax.naming.directory.Attributes; -import javax.naming.directory.BasicAttributes; import javax.naming.ldap.LdapName; import org.argeo.util.directory.HierarchyUnit; @@ -27,9 +26,9 @@ public class OsUserDirectory extends AbstractLdapDirectoryDao { try { osUserDn = new LdapName(LdapAttrs.uid.name() + "=" + osUsername + "," + directory.getUserBaseRdn() + "," + directory.getBaseDn()); - Attributes attributes = new BasicAttributes(); - attributes.put(LdapAttrs.uid.name(), osUsername); - osUser = newUser(osUserDn, attributes); +// Attributes attributes = new BasicAttributes(); +// attributes.put(LdapAttrs.uid.name(), osUsername); + osUser = newUser(osUserDn); } catch (NamingException e) { throw new IllegalStateException("Cannot create system user", e); } @@ -41,12 +40,12 @@ public class OsUserDirectory extends AbstractLdapDirectoryDao { } @Override - public Boolean daoHasEntry(LdapName dn) { + public Boolean entryExists(LdapName dn) { return osUserDn.equals(dn); } @Override - public LdapEntry daoGetEntry(LdapName key) throws NameNotFoundException { + public LdapEntry doGetEntry(LdapName key) throws NameNotFoundException { if (osUserDn.equals(key)) return osUser; else @@ -95,5 +94,13 @@ public class OsUserDirectory extends AbstractLdapDirectoryDao { } + @Override + public Attributes doGetAttributes(LdapName name) { + try { + return doGetEntry(name).getAttributes(); + } catch (NameNotFoundException e) { + throw new IllegalStateException(name + " doe not exist in " + getDirectory().getBaseDn(), e); + } + } }