anchor.diff:              <p>&nbsp;</p>
   
               <%
  -                if (activeUserList.size() > 0 && exceededDomains != null) {
  +                if (users != null && users.length > 0 && exceededDomains != null) {
                       if (exceededDomains.getItemName() != null || exceededDomains.getItemDisplayName() != null) {
                           String message = null;
                           if (exceededDomains.getItemName() != null && exceededDomains.getItemName().equals("true")) {
  
positive.code:     int noOfPageLinksToDisplay = 5;
      int numberOfPages = 0;
      Map<Integer, PaginatedNamesBean> flaggedNameMap = null;
      Set<String> workFlowAddPendingUsers = null;
      Set<String> workFlowDeletePendingUsers = null;
      Set<FlaggedName> activeUserList = null;
      Set<FlaggedName> showDeletePendingUsers = new LinkedHashSet<FlaggedName>();
      String inActiveUserMessage = "No Actions are allowed for the Workflow Pending Users";
  
      String BUNDLE = "org.wso2.carbon.userstore.ui.i18n.Resources";
  
negative.code:                 %>
                  <tbody>
                  <%
                      if (users != null) {
                          for (int i = 0; i < users.length; i++) {
                              if (users[i] != null) { //Confusing!!. Sometimes a null object comes. Maybe a bug Axis!!
                                  if (users[i].getItemName().equals(CarbonConstants.REGISTRY_ANONNYMOUS_USERNAME)) {
                                      continue;
                                  }
                                  String userName = CharacterEncoder.getSafeText(users[i].getItemName());
                                  String disPlayName = CharacterEncoder.getSafeText(users[i].getItemDisplayName());
                                  if (disPlayName == null || disPlayName.trim().length() == 0) {
                                      disPlayName = userName;
                                  }
  
                                  if (workFlowAddPendingUsersList.contains(userName)) {
                                      disPlayName = userName + " " + "[Pending Users for Add]";
                  %>
                  <tr>
                      <td><%=disPlayName%>
                          <%if (!users[i].getEditable()) { %> <%="(Read-Only)"%> <% } %>
                      </td>
                      <td>
                          <%=inActiveUserMessage%>
                      </td>
                  </tr>
                  <%
  
                  } else if(showDeletePendingUsersList.contains(userName)){
                      disPlayName = userName + " " + "[Pending Users for Delete]";
                  %>
                  <tr>
                      <td><%=disPlayName%>
                          <%if (!users[i].getEditable()) { %> <%="(Read-Only)"%> <% } %>
                      </td>
                      <td>
  
                          <%
                              if (userRealmInfo.getAdminUser().equals(Util.decodeHTMLCharacters(userName)) &&
                                      !userRealmInfo.getAdminUser().equals(currentUser)) {
                                  continue;
                              }
                          %>
                          <%
                              if (!Util.getUserStoreInfoForUser(Util.decodeHTMLCharacters(userName), userRealmInfo).getPasswordsExternallyManaged() &&      // TODO
                                      CarbonUIUtil.isUserAuthorized(request,
                                              "/permission/admin/configure/security/usermgt/passwords") &&
                                      users[i].getEditable()) { //if passwords are managed externally do not allow to change passwords.
                                  if (Util.decodeHTMLCharacters(userName).equals(currentUser)) {
                          %>
                          <a href="change-passwd.jsp?isUserChange=true&returnPath=user-mgt.jsp" class="icon-link"
                             style="background-image:url(../admin/images/edit.gif);"><fmt:message
                                  key="change.password"/></a>
  
                          <%
                          } else {
                          %>
  
                          <a href="change-passwd.jsp?username=<%=java.net.URLEncoder.encode(userName,"UTF-8")%>&disPlayName=<%=java.net.URLEncoder.encode(disPlayName,"UTF-8")%>"
                             class="icon-link"
                             style="background-image:url(../admin/images/edit.gif);"><fmt:message
                                  key="change.password"/></a>
                          <%
                                  }
                              }
                          %>
  
                          <%
                              if (CarbonUIUtil.isUserAuthorized(request, "/permission/admin/configure/security")) {
                          %>
                          <a href="edit-user-roles.jsp?username=<%=
                          java.net.URLEncoder.encode(userName,"UTF-8")%>&disPlayName=<%=java.net.URLEncoder.encode(disPlayName,"UTF-8")%>"
                             class="icon-link"
                             style="background-image:url(../admin/images/edit.gif);"><fmt:message
                                  key="edit.roles"/></a>
                          <%
                              }
                          %>
  
                          <%
                              if (CarbonUIUtil.isUserAuthorized(request, "/permission/admin/configure/security")) {
                          %>
                          <a href="view-roles.jsp?username=<%=java.net.URLEncoder.encode(userName,"UTF-8")%>&disPlayName=<%=java.net.URLEncoder.encode(disPlayName,"UTF-8")%>"
                             class="icon-link"
                             style="background-image:url(images/view.gif);"><fmt:message
                                  key="view.roles"/></a>
                          <%
                              }
                          %>
  
                          <%
                              if (CarbonUIUtil.isContextRegistered(config, "/identity-authorization/") &&
                                      CarbonUIUtil.isUserAuthorized(request, "/permission/admin/configure/security/")) {
                          %>
                          <a href="../identity-authorization/permission-root.jsp?userName=<%=java.net.URLEncoder.encode(userName,"UTF-8")%>&fromUserMgt=true"
                             class="icon-link"
                             style="background-image:url(../admin/images/edit.gif);"><fmt:message
                                  key="authorization"/></a>
                          <%
                              }
                          %>
  
  
                          <%
                              if (CarbonUIUtil.isContextRegistered(config, "/userprofile/")
                                      && CarbonUIUtil.isUserAuthorized(request,
                                      "/permission/admin/configure/security/usermgt/profiles")) {
                          %>
                          <a href="../userprofile/index.jsp?username=<%=java.net.URLEncoder.encode(userName,"UTF-8")%>&disPlayName=<%=java.net.URLEncoder.encode(disPlayName,"UTF-8")%>&fromUserMgt=true"
                             class="icon-link"
                             style="background-image:url(../userprofile/images/my-prof.gif);">User
                              Profile</a>
                          <%
                              }
                          %>
  
                      </td>
                  </tr>
                  <%
                  }else {
                  %>
                  <tr>
                      <td><%=disPlayName%>
                          <%if (!users[i].getEditable()) { %> <%="(Read-Only)"%> <% } %>
                      </td>
                      <td>
  
                          <%
                              if (userRealmInfo.getAdminUser().equals(Util.decodeHTMLCharacters(userName)) &&
                                      !userRealmInfo.getAdminUser().equals(currentUser)) {
                                  continue;
                              }
                          %>
                          <%
                              if (!Util.getUserStoreInfoForUser(Util.decodeHTMLCharacters(userName), userRealmInfo).getPasswordsExternallyManaged() &&      // TODO
                                      CarbonUIUtil.isUserAuthorized(request,
                                              "/permission/admin/configure/security/usermgt/passwords") &&
                                      users[i].getEditable()) { //if passwords are managed externally do not allow to change passwords.
                                  if (Util.decodeHTMLCharacters(userName).equals(currentUser)) {
                          %>
                          <a href="change-passwd.jsp?isUserChange=true&returnPath=user-mgt.jsp" class="icon-link"
                             style="background-image:url(../admin/images/edit.gif);"><fmt:message
                                  key="change.password"/></a>
  
                          <%
                          } else {
                          %>
  
                          <a href="change-passwd.jsp?username=<%=java.net.URLEncoder.encode(userName,"UTF-8")%>&disPlayName=<%=java.net.URLEncoder.encode(disPlayName,"UTF-8")%>"
                             class="icon-link"
                             style="background-image:url(../admin/images/edit.gif);"><fmt:message
                                  key="change.password"/></a>
                          <%
                                  }
                              }
                          %>
  
                          <%
                              if (CarbonUIUtil.isUserAuthorized(request, "/permission/admin/configure/security")) {
                          %>
                          <a href="edit-user-roles.jsp?username=<%=
                          java.net.URLEncoder.encode(userName,"UTF-8")%>&disPlayName=<%=java.net.URLEncoder.encode(disPlayName,"UTF-8")%>"
                             class="icon-link"
                             style="background-image:url(../admin/images/edit.gif);"><fmt:message
                                  key="edit.roles"/></a>
                          <%
                              }
                          %>
  
                          <%
                              if (CarbonUIUtil.isUserAuthorized(request, "/permission/admin/configure/security")) {
                          %>
                          <a href="view-roles.jsp?username=<%=java.net.URLEncoder.encode(userName,"UTF-8")%>&disPlayName=<%=java.net.URLEncoder.encode(disPlayName,"UTF-8")%>"
                             class="icon-link"
                             style="background-image:url(images/view.gif);"><fmt:message
                                  key="view.roles"/></a>
                          <%
                              }
                          %>
  
  
                          <%
                              if (CarbonUIUtil.isUserAuthorized(request,
                                      "/permission/admin/configure/security/usermgt/users") && !Util.decodeHTMLCharacters(userName).equals(currentUser)
                                      && !Util.decodeHTMLCharacters(userName).equals(userRealmInfo.getAdminUser()) &&
                                      users[i].getEditable()) {
                          %>
                          <a href="#" onclick="deleteUser('<%=java.net.URLEncoder.encode(userName,"UTF-8")%>')"
                             class="icon-link"
                             style="background-image:url(images/delete.gif);"><fmt:message
                                  key="delete"/></a>
                          <%
                              }
                          %>
  
  
                          <%
                              if (CarbonUIUtil.isContextRegistered(config, "/identity-authorization/") &&
                                      CarbonUIUtil.isUserAuthorized(request, "/permission/admin/configure/security/")) {
                          %>
                          <a href="../identity-authorization/permission-root.jsp?userName=<%=java.net.URLEncoder.encode(userName,"UTF-8")%>&fromUserMgt=true"
                             class="icon-link"
                             style="background-image:url(../admin/images/edit.gif);"><fmt:message
                                  key="authorization"/></a>
                          <%
                              }
                          %>
  
  
                          <%
                              if (CarbonUIUtil.isContextRegistered(config, "/userprofile/")
                                      && CarbonUIUtil.isUserAuthorized(request,
                                      "/permission/admin/configure/security/usermgt/profiles")) {
                          %>
                          <a href="../userprofile/index.jsp?username=<%=java.net.URLEncoder.encode(userName,"UTF-8")%>&disPlayName=<%=java.net.URLEncoder.encode(disPlayName,"UTF-8")%>&fromUserMgt=true"
                             class="icon-link"
                             style="background-image:url(../userprofile/images/my-prof.gif);">User
                              Profile</a>
                          <%
                              }
                          %>
  
                      </td>
                  </tr>
                  <%
                      }
                  %>
                  <%
                              }
                          }
  