Пример #1
0
  /**
   * The packet is a typical 'set' or 'get' update targeted at the server. Notice that the set could
   * be a roster removal in which case we have to generate a local roster removal update as well as
   * a new roster removal to send to the the roster item's owner.
   *
   * @param packet The packet that triggered this update
   * @return Either a response to the roster update or null if the packet is corrupt and the session
   *     was closed down
   */
  private IQ manageRoster(org.xmpp.packet.Roster packet)
      throws UnauthorizedException, UserAlreadyExistsException, SharedGroupException {

    IQ returnPacket = null;
    JID sender = packet.getFrom();
    IQ.Type type = packet.getType();

    try {
      if ((sender.getNode() == null
              || !RosterManager.isRosterServiceEnabled()
              || !userManager.isRegisteredUser(sender.getNode()))
          && IQ.Type.get == type) {
        // If anonymous user asks for his roster or roster service is disabled then
        // return an empty roster
        IQ reply = IQ.createResultIQ(packet);
        reply.setChildElement("query", "jabber:iq:roster");
        return reply;
      }
      if (!localServer.isLocal(sender)) {
        // Sender belongs to a remote server so discard this IQ request
        Log.warn("Discarding IQ roster packet of remote user: " + packet);
        return null;
      }

      Roster cachedRoster = userManager.getUser(sender.getNode()).getRoster();
      if (IQ.Type.get == type) {
        returnPacket = cachedRoster.getReset();
        returnPacket.setType(IQ.Type.result);
        returnPacket.setTo(sender);
        returnPacket.setID(packet.getID());
        // Force delivery of the response because we need to trigger
        // a presence probe from all contacts
        deliverer.deliver(returnPacket);
        returnPacket = null;
      } else if (IQ.Type.set == type) {

        for (org.xmpp.packet.Roster.Item item : packet.getItems()) {
          if (item.getSubscription() == org.xmpp.packet.Roster.Subscription.remove) {
            removeItem(cachedRoster, packet.getFrom(), item);
          } else {
            if (cachedRoster.isRosterItem(item.getJID())) {
              // existing item
              RosterItem cachedItem = cachedRoster.getRosterItem(item.getJID());
              cachedItem.setAsCopyOf(item);
              cachedRoster.updateRosterItem(cachedItem);
            } else {
              // new item
              cachedRoster.createRosterItem(item);
            }
          }
        }
        returnPacket = IQ.createResultIQ(packet);
      }
    } catch (UserNotFoundException e) {
      throw new UnauthorizedException(e);
    }

    return returnPacket;
  }
 /**
  * Manage the subscription request. This method updates a user's roster state, storing any changes
  * made, and updating the roster owner if changes occured.
  *
  * @param target The roster target's jid (the item's jid to be changed)
  * @param isSending True if the request is being sent by the owner
  * @param type The subscription change type (subscribe, unsubscribe, etc.)
  * @param roster The Roster that is updated.
  * @return <tt>true</tt> if the subscription state has changed.
  */
 private boolean manageSub(JID target, boolean isSending, Presence.Type type, Roster roster)
     throws UserAlreadyExistsException, SharedGroupException {
   RosterItem item = null;
   RosterItem.AskType oldAsk;
   RosterItem.SubType oldSub = null;
   RosterItem.RecvType oldRecv;
   boolean newItem = false;
   try {
     if (roster.isRosterItem(target)) {
       item = roster.getRosterItem(target);
     } else {
       if (Presence.Type.unsubscribed == type
           || Presence.Type.unsubscribe == type
           || Presence.Type.subscribed == type) {
         // Do not create a roster item when processing a confirmation of
         // an unsubscription or receiving an unsubscription request or a
         // subscription approval from an unknown user
         return false;
       }
       item = roster.createRosterItem(target, false, true);
       newItem = true;
     }
     // Get a snapshot of the item state
     oldAsk = item.getAskStatus();
     oldSub = item.getSubStatus();
     oldRecv = item.getRecvStatus();
     // Update the item state based in the received presence type
     updateState(item, type, isSending);
     // Update the roster IF the item state has changed
     if (oldAsk != item.getAskStatus()
         || oldSub != item.getSubStatus()
         || oldRecv != item.getRecvStatus()) {
       roster.updateRosterItem(item);
     } else if (newItem) {
       // Do not push items with a state of "None + Pending In"
       if (item.getSubStatus() != RosterItem.SUB_NONE
           || item.getRecvStatus() != RosterItem.RECV_SUBSCRIBE) {
         roster.broadcast(item, false);
       }
     }
   } catch (UserNotFoundException e) {
     // Should be there because we just checked that it's an item
     Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
   }
   return oldSub != item.getSubStatus();
 }
Пример #3
0
  /**
   * Remove a roster item. At this stage, this is recipient who has received a roster update. We
   * must check that it is a removal, and if so, remove the roster item based on the sender's id
   * rather than what is in the item listing itself.
   *
   * @param packet The packet suspected of containing a roster removal
   */
  private void removeRosterItem(org.xmpp.packet.Roster packet)
      throws UnauthorizedException, SharedGroupException {
    JID recipientJID = packet.getTo();
    JID senderJID = packet.getFrom();
    try {
      for (org.xmpp.packet.Roster.Item packetItem : packet.getItems()) {
        if (packetItem.getSubscription() == org.xmpp.packet.Roster.Subscription.remove) {
          Roster roster = userManager.getUser(recipientJID.getNode()).getRoster();
          RosterItem item = roster.getRosterItem(senderJID);
          roster.deleteRosterItem(senderJID, true);
          item.setSubStatus(RosterItem.SUB_REMOVE);
          item.setSubStatus(RosterItem.SUB_NONE);

          Packet itemPacket = packet.createCopy();
          sessionManager.userBroadcast(recipientJID.getNode(), itemPacket);
        }
      }
    } catch (UserNotFoundException e) {
      throw new UnauthorizedException(e);
    }
  }
 /**
  * Determine and call the update method based on the item's subscription state. The method also
  * turns the action and sending status into an integer code for easier processing (switch
  * statements).
  *
  * <p>Code relies on states being in numerical order without skipping. In addition, the receive
  * states must parallel the send states so that (send state X) + STATE_RECV_SUBSCRIBE == (receive
  * state X) where X is subscribe, subscribed, etc.
  *
  * @param item The item to be updated
  * @param action The new state change request
  * @param isSending True if the roster owner of the item is sending the new state change request
  */
 private static void updateState(RosterItem item, Presence.Type action, boolean isSending) {
   Map<String, Map<Presence.Type, Change>> srTable = stateTable.get(item.getSubStatus());
   Map<Presence.Type, Change> changeTable = srTable.get(isSending ? "send" : "recv");
   Change change = changeTable.get(action);
   if (change.newAsk != null && change.newAsk != item.getAskStatus()) {
     item.setAskStatus(change.newAsk);
   }
   if (change.newSub != null && change.newSub != item.getSubStatus()) {
     item.setSubStatus(change.newSub);
   }
   if (change.newRecv != null && change.newRecv != item.getRecvStatus()) {
     item.setRecvStatus(change.newRecv);
   }
 }
  /* (non-Javadoc)
   * @see org.jivesoftware.openfire.roster.RosterItemProvider#createItem(java.lang.String, org.jivesoftware.openfire.roster.RosterItem)
   */
  public RosterItem createItem(String username, RosterItem item) throws UserAlreadyExistsException {
    Connection con = null;
    PreparedStatement pstmt = null;
    try {
      con = DbConnectionManager.getConnection();

      long rosterID = SequenceManager.nextID(JiveConstants.ROSTER);
      pstmt = con.prepareStatement(CREATE_ROSTER_ITEM);
      pstmt.setString(1, username);
      pstmt.setLong(2, rosterID);
      pstmt.setString(3, item.getJid().toBareJID());
      pstmt.setInt(4, item.getSubStatus().getValue());
      pstmt.setInt(5, item.getAskStatus().getValue());
      pstmt.setInt(6, item.getRecvStatus().getValue());
      pstmt.setString(7, item.getNickname());
      pstmt.executeUpdate();

      item.setID(rosterID);
      insertGroups(rosterID, item.getGroups().iterator(), con);
    } catch (SQLException e) {
      throw new UserAlreadyExistsException(item.getJid().toBareJID());
    } finally {
      try {
        if (pstmt != null) {
          pstmt.close();
        }
      } catch (Exception e) {
        Log.error(e);
      }
      try {
        if (con != null) {
          con.close();
        }
      } catch (Exception e) {
        Log.error(e);
      }
    }
    return item;
  }
  /* (non-Javadoc)
   * @see org.jivesoftware.openfire.roster.RosterItemProvider#updateItem(java.lang.String, org.jivesoftware.openfire.roster.RosterItem)
   */
  public void updateItem(String username, RosterItem item) throws UserNotFoundException {
    Connection con = null;
    PreparedStatement pstmt = null;
    long rosterID = item.getID();
    try {
      con = DbConnectionManager.getConnection();
      // Update existing roster item
      pstmt = con.prepareStatement(UPDATE_ROSTER_ITEM);
      pstmt.setInt(1, item.getSubStatus().getValue());
      pstmt.setInt(2, item.getAskStatus().getValue());
      pstmt.setInt(3, item.getRecvStatus().getValue());
      pstmt.setString(4, item.getNickname());
      pstmt.setLong(5, rosterID);
      pstmt.executeUpdate();
      // Close now the statement (do not wait to be GC'ed)
      pstmt.close();

      // Delete old group list
      pstmt = con.prepareStatement(DELETE_ROSTER_ITEM_GROUPS);
      pstmt.setLong(1, rosterID);
      pstmt.executeUpdate();

      insertGroups(rosterID, item.getGroups().iterator(), con);

    } catch (SQLException e) {
      Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
    } finally {
      try {
        if (pstmt != null) {
          pstmt.close();
        }
      } catch (Exception e) {
        Log.error(e);
      }
      try {
        if (con != null) {
          con.close();
        }
      } catch (Exception e) {
        Log.error(e);
      }
    }
  }
  /**
   * Adds the new user to others roster.
   *
   * @param newUser the new user
   * @param otherItem the other item
   * @param currentUser the current user
   * @throws ServiceException the service exception
   */
  private static void addNewUserToOthersRoster(
      User newUser, RosterItem otherItem, String currentUser) throws ServiceException {
    otherItem.getJid();
    UserManager userManager = UserManager.getInstance();

    // Is this user registered with our OF server?
    String username = otherItem.getJid().getNode();
    if (username != null
        && username.length() > 0
        && userManager.isRegisteredUser(username)
        && XMPPServer.getInstance()
            .isLocal(XMPPServer.getInstance().createJID(currentUser, null))) {
      try {
        User otherUser = userManager.getUser(username);
        Roster otherRoster = otherUser.getRoster();
        RosterItem oldUserOnOthersRoster =
            otherRoster.getRosterItem(XMPPServer.getInstance().createJID(currentUser, null));

        try {
          if (!oldUserOnOthersRoster.isOnlyShared()) {

            RosterItem justCreated =
                otherRoster.createRosterItem(
                    XMPPServer.getInstance().createJID(newUser.getUsername(), null),
                    oldUserOnOthersRoster.getNickname(),
                    oldUserOnOthersRoster.getGroups(),
                    true,
                    true);
            justCreated.setAskStatus(oldUserOnOthersRoster.getAskStatus());
            justCreated.setRecvStatus(oldUserOnOthersRoster.getRecvStatus());
            justCreated.setSubStatus(oldUserOnOthersRoster.getSubStatus());
            otherRoster.updateRosterItem(justCreated);
          }
        } catch (UserAlreadyExistsException e) {
          throw new ServiceException(
              "Could not create roster item for user ",
              newUser.getUsername(),
              ExceptionType.USER_ALREADY_EXISTS_EXCEPTION,
              Response.Status.CONFLICT,
              e);
        } catch (SharedGroupException e) {
          throw new ServiceException(
              "Could not create roster item, because it is a contact from a shared group",
              newUser.getUsername(),
              ExceptionType.USER_ALREADY_EXISTS_EXCEPTION,
              Response.Status.BAD_REQUEST,
              e);
        }
      } catch (UserNotFoundException e) {
        throw new ServiceException(
            "Could not create roster item for user "
                + newUser.getUsername()
                + "  because it is a contact from a shared group.",
            newUser.getUsername(),
            ExceptionType.USER_NOT_FOUND_EXCEPTION,
            Response.Status.NOT_FOUND,
            e);
      }
    }
  }
  /**
   * Copy roster.
   *
   * @param currentUser the current user
   * @param newUser the new user
   * @param currentUserName the current user name
   * @throws ServiceException the service exception
   */
  private static void copyRoster(User currentUser, User newUser, String currentUserName)
      throws ServiceException {
    Roster newRoster = newUser.getRoster();
    Roster currentRoster = currentUser.getRoster();
    for (RosterItem item : currentRoster.getRosterItems()) {
      try {
        List<String> groups = item.getGroups();

        RosterItem justCreated =
            newRoster.createRosterItem(item.getJid(), item.getNickname(), groups, true, true);
        justCreated.setAskStatus(item.getAskStatus());
        justCreated.setRecvStatus(item.getRecvStatus());
        justCreated.setSubStatus(item.getSubStatus());

        for (Group gr : item.getSharedGroups()) {
          justCreated.addSharedGroup(gr);
        }

        for (Group gr : item.getInvisibleSharedGroups()) {
          justCreated.addInvisibleSharedGroup(gr);
        }
        newRoster.updateRosterItem(justCreated);
        addNewUserToOthersRoster(newUser, item, currentUserName);

      } catch (UserAlreadyExistsException e) {
        throw new ServiceException(
            "Could not create roster item for user ",
            newUser.getUsername(),
            ExceptionType.USER_ALREADY_EXISTS_EXCEPTION,
            Response.Status.CONFLICT,
            e);
      } catch (SharedGroupException e) {
        throw new ServiceException(
            "Could not create roster item, because it is a contact from a shared group",
            newUser.getUsername(),
            ExceptionType.USER_ALREADY_EXISTS_EXCEPTION,
            Response.Status.BAD_REQUEST,
            e);
      } catch (UserNotFoundException e) {
        throw new ServiceException(
            "Could not update roster item for user "
                + newUser.getUsername()
                + " because it was not properly created.",
            newUser.getUsername(),
            ExceptionType.USER_NOT_FOUND_EXCEPTION,
            Response.Status.NOT_FOUND,
            e);
      }
    }
  }
 /* (non-Javadoc)
  * @see org.jivesoftware.openfire.roster.RosterItemProvider#getItems(java.lang.String)
  */
 public Iterator<RosterItem> getItems(String username) {
   LinkedList<RosterItem> itemList = new LinkedList<RosterItem>();
   Connection con = null;
   Connection con2 = null;
   PreparedStatement pstmt = null;
   PreparedStatement gstmt = null;
   try {
     con2 = DbConnectionManager.getConnection();
     gstmt = con2.prepareStatement(LOAD_ROSTER_ITEM_GROUPS);
     // Load all the contacts in the roster
     con = DbConnectionManager.getConnection();
     pstmt = con.prepareStatement(LOAD_ROSTER);
     pstmt.setString(1, username);
     ResultSet rs = pstmt.executeQuery();
     while (rs.next()) {
       // Create a new RosterItem (ie. user contact) from the stored information
       RosterItem item =
           new RosterItem(
               rs.getLong(2),
               new JID(rs.getString(1)),
               RosterItem.SubType.getTypeFromInt(rs.getInt(3)),
               RosterItem.AskType.getTypeFromInt(rs.getInt(4)),
               RosterItem.RecvType.getTypeFromInt(rs.getInt(5)),
               rs.getString(6),
               null);
       // Load the groups for the loaded contact
       ResultSet gs = null;
       gstmt.setLong(1, item.getID());
       gs = gstmt.executeQuery();
       while (gs.next()) {
         item.getGroups().add(gs.getString(1));
       }
       // Close the result set
       gs.close();
       // Add the loaded RosterItem (ie. user contact) to the result
       itemList.add(item);
     }
   } catch (SQLException e) {
     Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
   } finally {
     try {
       if (pstmt != null) {
         pstmt.close();
       }
     } catch (Exception e) {
       Log.error(e);
     }
     try {
       if (con != null) {
         con.close();
       }
     } catch (Exception e) {
       Log.error(e);
     }
     try {
       if (gstmt != null) {
         gstmt.close();
       }
     } catch (Exception e) {
       Log.error(e);
     }
     try {
       if (con2 != null) {
         con2.close();
       }
     } catch (Exception e) {
       Log.error(e);
     }
   }
   return itemList.iterator();
 }
  public void _jspService(HttpServletRequest request, HttpServletResponse response)
      throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;

    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html");
      pageContext =
          _jspxFactory.getPageContext(this, request, response, "error.jsp", true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\n\n\n\n\n\n\n\n\n\n\n\n");
      org.jivesoftware.util.WebManager webManager = null;
      synchronized (_jspx_page_context) {
        webManager =
            (org.jivesoftware.util.WebManager)
                _jspx_page_context.getAttribute("webManager", PageContext.PAGE_SCOPE);
        if (webManager == null) {
          webManager = new org.jivesoftware.util.WebManager();
          _jspx_page_context.setAttribute("webManager", webManager, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\n');
      out.write('\n');
      // Get parameters
      boolean cancel = request.getParameter("cancel") != null;
      String username = ParamUtils.getParameter(request, "username");
      String jid = ParamUtils.getParameter(request, "jid");
      String nickname = ParamUtils.getParameter(request, "nickname");
      String groups = ParamUtils.getParameter(request, "groups");
      Integer sub = ParamUtils.getIntParameter(request, "sub", 0);
      boolean save = ParamUtils.getBooleanParameter(request, "save");

      // Handle a cancel
      if (cancel) {
        response.sendRedirect("user-roster.jsp?username="******"UTF-8"));
        return;
      }

      // Load the user's roster object
      Roster roster = webManager.getRosterManager().getRoster(username);

      // Load the roster item from the user's roster.
      RosterItem item = roster.getRosterItem(new JID(jid));

      // Handle a roster item delete:
      if (save) {
        List<String> groupList = new ArrayList<String>();
        if (groups != null) {
          for (String group : groups.split(",")) {
            groupList.add(group.trim());
          }
        }
        item.setNickname(nickname);
        item.setGroups(groupList);
        item.setSubStatus(RosterItem.SubType.getTypeFromInt(sub));
        // Delete the roster item
        roster.updateRosterItem(item);
        // Log the event
        webManager.logEvent("deleted roster item from " + username, "roster item:\njid = " + jid);
        // Done, so redirect
        response.sendRedirect(
            "user-roster.jsp?username="******"UTF-8")
                + "&editsuccess=true");
        return;
      }

      out.write("\n\n<html>\n    <head>\n        <title>");
      if (_jspx_meth_fmt_message_0(_jspx_page_context)) return;
      out.write(
          "</title>\n        <meta name=\"subPageID\" content=\"user-roster\"/>\n        <meta name=\"extraParams\" content=\"");
      out.print("username="******"UTF-8"));
      out.write("\"/>\n    </head>\n    <body>\n\n<p>\n");
      //  fmt:message
      org.apache.taglibs.standard.tag.rt.fmt.MessageTag _jspx_th_fmt_message_1 =
          (org.apache.taglibs.standard.tag.rt.fmt.MessageTag)
              _jspx_tagPool_fmt_message_key.get(
                  org.apache.taglibs.standard.tag.rt.fmt.MessageTag.class);
      _jspx_th_fmt_message_1.setPageContext(_jspx_page_context);
      _jspx_th_fmt_message_1.setParent(null);
      _jspx_th_fmt_message_1.setKey("user.roster.edit.info");
      int _jspx_eval_fmt_message_1 = _jspx_th_fmt_message_1.doStartTag();
      if (_jspx_eval_fmt_message_1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
        if (_jspx_eval_fmt_message_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
          out = _jspx_page_context.pushBody();
          _jspx_th_fmt_message_1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
          _jspx_th_fmt_message_1.doInitBody();
        }
        do {
          out.write("\n    ");
          //  fmt:param
          org.apache.taglibs.standard.tag.rt.fmt.ParamTag _jspx_th_fmt_param_0 =
              (org.apache.taglibs.standard.tag.rt.fmt.ParamTag)
                  _jspx_tagPool_fmt_param_value_nobody.get(
                      org.apache.taglibs.standard.tag.rt.fmt.ParamTag.class);
          _jspx_th_fmt_param_0.setPageContext(_jspx_page_context);
          _jspx_th_fmt_param_0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_fmt_message_1);
          _jspx_th_fmt_param_0.setValue(StringUtils.escapeForXML(username));
          int _jspx_eval_fmt_param_0 = _jspx_th_fmt_param_0.doStartTag();
          if (_jspx_th_fmt_param_0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
            _jspx_tagPool_fmt_param_value_nobody.reuse(_jspx_th_fmt_param_0);
            return;
          }
          _jspx_tagPool_fmt_param_value_nobody.reuse(_jspx_th_fmt_param_0);
          out.write('\n');
          int evalDoAfterBody = _jspx_th_fmt_message_1.doAfterBody();
          if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN) break;
        } while (true);
        if (_jspx_eval_fmt_message_1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE)
          out = _jspx_page_context.popBody();
      }
      if (_jspx_th_fmt_message_1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
        _jspx_tagPool_fmt_message_key.reuse(_jspx_th_fmt_message_1);
        return;
      }
      _jspx_tagPool_fmt_message_key.reuse(_jspx_th_fmt_message_1);
      out.write("\n</p>\n\n<fieldset>\n    <legend>");
      if (_jspx_meth_fmt_message_2(_jspx_page_context)) return;
      out.write(
          "</legend>\n    <div>\n    <table cellpadding=\"3\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n    <tbody>\n        <tr>\n            <td class=\"c1\">\n                ");
      if (_jspx_meth_fmt_message_3(_jspx_page_context)) return;
      out.write(":\n            </td>\n            <td>\n                ");
      out.print(StringUtils.escapeHTMLTags(jid));
      out.write(
          "\n            </td>\n        </tr>\n        <tr>\n            <td class=\"c1\">\n                ");
      if (_jspx_meth_fmt_message_4(_jspx_page_context)) return;
      out.write(":\n            </td>\n            <td>\n                ");
      out.print(StringUtils.escapeHTMLTags(item.getNickname()));
      out.write(
          "\n            </td>\n        </tr>\n        <tr>\n            <td class=\"c1\">\n                ");
      if (_jspx_meth_fmt_message_5(_jspx_page_context)) return;
      out.write(":\n            </td>\n            <td>\n                ");

      List<String> groupList = item.getGroups();
      if (!groupList.isEmpty()) {
        int count = 0;
        for (String group : groupList) {
          if (count != 0) {
            out.print(",");
          }
          out.print(StringUtils.escapeForXML(group));
          count++;
        }
      } else {
        out.print("<i>None</i>");
      }

      out.write(
          "\n            </td>\n        </tr>\n        <tr>\n            <td class=\"c1\">\n                <a href=\"group-summary.jsp\">");
      if (_jspx_meth_fmt_message_6(_jspx_page_context)) return;
      out.write("</a>:\n            </td>\n            <td>\n                ");

      Collection<Group> sharedGroups = item.getSharedGroups();
      if (!sharedGroups.isEmpty()) {
        int count = 0;
        for (Group group : sharedGroups) {
          if (count != 0) {
            out.print(",");
          }
          out.print(
              "<a href='group-edit.jsp?group="
                  + URLEncoder.encode(group.getName(), "UTF-8")
                  + "'>");
          out.print(StringUtils.escapeForXML(group.getName()));
          out.print("</a>");
          count++;
        }
      } else {
        out.print("<i>None</i>");
      }

      out.write(
          "\n            </td>\n        </tr>\n        <tr>\n            <td class=\"c1\">\n                ");
      if (_jspx_meth_fmt_message_7(_jspx_page_context)) return;
      out.write(":\n            </td>\n            <td>\n                ");
      out.print(StringUtils.escapeHTMLTags(item.getSubStatus().getName()));
      out.write(
          "\n            </td>\n        </tr>\n    </tbody>\n    </table>\n    </div>\n</fieldset>\n\n<br><br>\n\n<form style=\"display: inline\" action=\"user-roster-edit.jsp\">\n<input type=\"hidden\" name=\"jid\" value=\"");
      out.print(StringUtils.escapeForXML(jid));
      out.write("\">\n<input type=\"hidden\" name=\"username\" value=\"");
      out.print(StringUtils.escapeForXML(username));
      out.write("\">\n<input type=\"submit\" value=\"");
      if (_jspx_meth_fmt_message_8(_jspx_page_context)) return;
      out.write("\">\n</form>\n\n");
      if (sharedGroups.isEmpty()) {
        out.write(
            "\n<form style=\"display: inline\" action=\"user-roster-delete.jsp\">\n<input type=\"hidden\" name=\"jid\" value=\"");
        out.print(StringUtils.escapeForXML(jid));
        out.write("\">\n<input type=\"hidden\" name=\"username\" value=\"");
        out.print(StringUtils.escapeForXML(username));
        out.write("\">\n<input type=\"submit\" value=\"");
        if (_jspx_meth_fmt_message_9(_jspx_page_context)) return;
        out.write("\">\n</form>\n");
      }
      out.write("\n\n    </body>\n</html>\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)) {
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0) out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }