Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-2496

getAllUsers method from MgnlUserManager not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Neutral Neutral
    • None
    • 3.6.3
    • security
    • windows XP, java 1.5, JBoss 4.0.4

      The method getAllUsers method from MgnlUserManager in the package info.magnolia.cms.security because of the new structure of the users repository.

      The method could be changed as shown behind in order to work :

      getAllUsers
          /**
           * All users
           */
          public Collection getAllUsers() {
              Collection users = new ArrayList();
              try {
                  Collection nodes = getHierarchyManager().getContent("/admin").getChildren(ItemType.USER);
                  Collection nodes2= getHierarchyManager().getContent("/system").getChildren(ItemType.USER);
                  //we always have a superuser so nodes2 can't be null right? 
                  //and because some collections refuse to add null elements
                  if (nodes !=null)  
                  	nodes2.addAll(nodes);
                  for (Iterator iter = nodes2.iterator(); iter.hasNext();) {
                      users.add(new MgnlUser((Content) iter.next()));
                  }
              }
              catch (Exception e) {
                  log.error("can't find user");
              }
              return users;
          }
      
      

        Acceptance criteria

              Unassigned Unassigned
              alvaro Alvaro Arce
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD