out.write("\r\n");
UserManager um = UserManager.getInstance();
User user = um.getUser(request.getParameter("name"));
PropertySet ps = null;
if (request.getParameter("propertyAdd") != null) {
ps = user.getPropertySet();
setPropertyValue(ps, request.getParameter("propertyKey"), Integer.parseInt(request.getParameter("propertyType")), request.getParameter("propertyValue"));
}
else if (request.getParameter("propertyDel") != null)
{
ps = user.getPropertySet();
ps.remove(request.getParameter("propertyDel"));
}
out.write("\r\n\r\n");
out.write("<h1>User: ");
out.print( user.getName() );
out.write("</h1>\r\n");
out.write("<hr>\r\n\r\n");
out.write("<h4>Details");
out.write("</h4>\r\nName: ");
out.print( user.getName() );
out.write("<br>\r\nClass: ");
out.print( user.getClass() );
out.write("<br>\r\nFull Name: ");
out.print( user.getFullName() );
out.write("<br>\r\nEmail: ");
out.print( user.getEmail() );
out.write("<br>\r\n\r\n");
out.write("<h4>Providers");
out.write("</h4>\r\nCredentialsProvider: ");
out.print( (user.getCredentialsProvider() != null ? user.getCredentialsProvider().getClass().toString() : "None") );
out.write("<br>\r\nAccessProvider: ");
out.print( (user.getAccessProvider() != null ? user.getAccessProvider().getClass().toString() : "None" ));
out.write("<br>\r\nProfileProvider: ");
out.print( (user.getProfileProvider() != null ? user.getProfileProvider().getClass().toString() : "None"));
out.write("<br>\r\n\r\n");
out.write("<h4>Groups");
out.write("</h4>\r\n");
Collection groups = user.getGroups();
out.write("\r\n");
out.print( groups.size() );
out.write(" groups");
out.write("<br>\r\n\r\n");
out.write("<ol>\r\n");
for (Iterator iterator = groups.iterator(); iterator.hasNext();)
{
String groupName = (String) iterator.next();
out.write("\r\n\t\t");
out.write("<li>");
out.write("<a href=\"viewgroup.jsp?name=");
out.print( URLEncoder.encode(groupName) );
out.write("\">");
out.print( groupName );
out.write("</a>");
out.write("</li>\r\n");
}
out.write("\r\n");
out.write("</ol>\r\n");
out.write("<a href=\"editusergroups.jsp?name=");
out.print( URLEncoder.encode(user.getName()) );
out.write("\">Add / Edit Groups");
out.write("</a>\r\n\r\n");
out.write("<h4>Properties");
out.write("</h4>\r\n");
ps = user.getPropertySet();
Collection keys = ps.getKeys();
for (Iterator iterator = keys.iterator(); iterator.hasNext();)
{
String key = (String) iterator.next();
out.write("\r\n\t");
out.print( key );
out.write(" : ");
out.print( getPropertyValue(ps, key) );
out.write(" (");
out.print( getTypeName(ps.getType(key)) );
out.write(") [");
out.write("<a href=\"viewuser.jsp?name=");
out.print( URLEncoder.encode(user.getName()) );
out.write("&propertyDel=");
out.print( URLEncoder.encode(key) );