import javax.naming.ldap.Rdn;
import org.argeo.api.NodeConstants;
-import org.argeo.cms.CmsException;
import org.argeo.naming.LdapAttrs;
import org.osgi.service.useradmin.Role;
import org.osgi.service.useradmin.User;
|| last.getType().toLowerCase().equals(LdapAttrs.cn.name()))
return (String) last.getValue();
else
- throw new CmsException("Cannot retrieve user local id, non valid dn: " + dn);
+ throw new IllegalArgumentException("Cannot retrieve user local id, non valid dn: " + dn);
}
/**
try {
return new LdapName(dn);
} catch (InvalidNameException e) {
- throw new CmsException("Cannot parse LDAP name " + dn, e);
+ throw new IllegalArgumentException("Cannot parse LDAP name " + dn, e);
}
}
int i = 0;
loop: while (i < rdns.size()) {
Rdn currrRdn = rdns.get(i);
- if (!LdapAttrs.dc.name().equals(currrRdn.getType()))
+ if (LdapAttrs.uid.name().equals(currrRdn.getType()) || LdapAttrs.cn.name().equals(currrRdn.getType())
+ || LdapAttrs.ou.name().equals(currrRdn.getType()))
break loop;
else {
String currVal = (String) currrRdn.getValue();
}
return dname;
} catch (InvalidNameException e) {
- throw new CmsException("Unable to get domain name for " + dn, e);
+ throw new IllegalArgumentException("Unable to get domain name for " + dn, e);
}
}