try {
users = userHandler.getAllUsers();
Collections.sort(users, new Comparator() {
public int compare(Object o1, Object o2) {
User u1 = (User) o1;
User u2 = (User) o2;
return u1.getUserName().compareToIgnoreCase(u2.getUserName());
}
});
} catch (PersistenceException ex) {
logger.error("event=get_all_users", ex);
throw new ServletException(ex);
}
for (int i = 0; users != null && i < users.size(); i++) {
if (i == 0) {
out.println("<p><hr width='80%' align='left' /><p>");
out.println("<table class='alternatecolortable' border='1' width='80%' >");
out.println("<tr><th>User Name</th>");
out.println("<th>User ID</th>");
out.println("<th>Is Admin</th>");
out.println("<th>Access Key</th>");
out.println("<th>Access Secret</th><th> </th><th> </th><th> </th></tr>");
}
User user = (User)users.get(i);
out.println("<tr>");
out.println("<form action=\"/"+response.encodeURL("webui")+"\" method=POST>");
out.println("<td>"+user.getUserName() +"<input type='hidden' name='user' value="+user.getUserName()+">" +
(user.getDescription().isEmpty()? "":"<br/><i>" + user.getDescription() + "</i>") +
"</td>");
out.println("<td>"+user.getUserId()+"</td>");
out.println("<td>"+user.getIsAdmin()+"</td>");
out.println("<td>"+user.getAccessKey()+"</td>");
out.println("<td>"+user.getAccessSecret()+"</td>");
out.println("<td><a href='/webui/cnsuser?userId="+user.getUserId()+"'>CNS</a></td>");
out.println("<td><a href='/webui/cqsuser?userId="+user.getUserId()+"'>CQS</a></td>");
out.println("<td><input type='submit' value='Delete' name='Delete' onclick=\"return confirm('Are you sure you want to delete user "+user.getUserName()+"?')\" /></td></form></tr>");
}
out.println("</table></body></html>");
CMBControllerServlet.valueAccumulator.deleteAllCounters();