Project

General

Profile

« Previous | Next » 

Revision 842

Added by bojilova almost 23 years ago

fixed to get groupnames for a user using any identifying name

View differences:

src/edu/ucsb/nceas/metacat/AuthLdap.java
646 646

  
647 647
        // Specify the attributes to match.
648 648
        // Groups are objects with attribute objectclass=groupofuniquenames.
649
        // and have attribute uniquemember=foruser,ldapbase.
649
        // and have attribute uniquemember: uid=foruser,ldapbase.
650 650
        Attributes matchAttrs = new BasicAttributes(true); // ignore case
651 651
        matchAttrs.put(new BasicAttribute("objectclass", "groupofuniquenames"));
652
        matchAttrs.put(new BasicAttribute("uniquemember",foruser+","+ldapBase));
653

  
652
        String dn = getIdentifyingName(foruser, ldapUrl, ldapBase);
653
// System.out.println("Identifying Name: " + dn);
654
        matchAttrs.put(new BasicAttribute("uniquemember",dn+","+ldapBase));
654 655
        // Search for objects in the current context
655 656
        NamingEnumeration enum = ctx.search("", matchAttrs, attrIDs);
656 657

  
......
933 934

  
934 935
      if (isValid) {
935 936
        //String group = args[2];
936
        HashMap userInfo = authservice.getAttributes(user, password, user);
937
        HashMap userInfo = authservice.getAttributes(user, password, "knb");
937 938
        // Print all of the attributes
938 939
        Iterator attList = (Iterator)(((Set)userInfo.keySet()).iterator());
939 940
        while (attList.hasNext()) {

Also available in: Unified diff