code: public static List<CmsOrganizationalUnit> getOrgUnitsForLoginDialog(CmsObject cms, String predefOu) {
  
          List<CmsOrganizationalUnit> result = new ArrayList<CmsOrganizationalUnit>();
          try {
              if (predefOu == null) {
                  result.add(OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, ""));
                  result.addAll(OpenCms.getOrgUnitManager().getOrganizationalUnits(cms, "", true));
                  Iterator<CmsOrganizationalUnit> itOus = result.iterator();
                  while (itOus.hasNext()) {
                      CmsOrganizationalUnit ou = itOus.next();
                      if (ou.hasFlagHideLogin() || ou.hasFlagWebuser()) {
                          itOus.remove();
                      }
                  }
              } else {
                  result.add(OpenCms.getOrgUnitManager().readOrganizationalUnit(cms, predefOu));
              }
          } catch (CmsException e) {
              LOG.error(e.getLocalizedMessage(), e);
          }
          return result;
  
      }
docs: Gets the list of OUs which should be selectable in the login dialog.<p>
  
  @param cms the CMS context to use
  @param predefOu the predefined OU
  
  @return the list of organizational units for the OU selector