<%@ page contentType="text/html;charset=GBK" %>
<%
/**
 *	$RCSfile: userSearch.jsp,v $
 *	$Revision: 1.1.1.1 $
 *	$Date: 2002/09/09 13:50:20 $
 */
%>

<%@ page import="java.util.*,
                 com.jivesoftware.forum.*,
				 com.jivesoftware.forum.util.*" %>

<%@ include file="global.jsp" %>

<%	// get parameters
    boolean lookup = ParamUtils.getBooleanParameter(request,"lookup");
    String username = ParamUtils.getParameter(request,"username");

    // get a user manager so we can lookup the user
	UserManager userManager = forumFactory.getUserManager();

    // The user requested
    User user = null;
    boolean error = false;
    try {
        user = userManager.getUser(username);
    }
    catch (Exception e) {
        error = true;
    }

    // Remove the user in the session (if we come to this page, the sidebar
    // shouldn't show the specific user options).
    session.removeAttribute("admin.sidebar.users.currentUser");
%>

<%  // special onload command to load the sidebar
    onload = " onload=\"parent.frames['sidebar'].location.href='sidebar.jsp?sidebar=users';\"";
%>
<%@ include file="header.jsp" %>

<p>

<%  // Title of this page and breadcrumbs
    String title = "搜索用户";
    String[][] breadcrumbs = {
        {"主页面", "main.jsp"},
        {"用户概览", "users.jsp"},
        {title, "userSearch.jsp?username="+username}
    };
%>
<%@ include file="title.jsp" %>

<font size="-1">
<%  if (error) { %>
    错误: 找不到指定用户。请回退到上一页并重试。
<%  } else { %>
    以下是用户的概要信息。
<%  } %>
</font>
<p>

<%  if (user != null) { %>

<table bgcolor="<%= tblBorderColor %>" cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td>
<table bgcolor="<%= tblBorderColor %>" cellpadding="3" cellspacing="1" border="0" width="100%">
<tr bgcolor="#eeeeee">
    <td align="center" nowrap><font size="-2" face="verdana"><b>用户ID</b></font></td>
    <td align="center" nowrap><font size="-2" face="verdana"><b>用户名</b></font></td>
    <td align="center" nowrap><font size="-2" face="verdana"><b>姓名</b></font></td>
    <td align="center" nowrap><font size="-2" face="verdana"><b>EMAIL</b></font></td>
    <td align="center" nowrap><font size="-2" face="verdana"><b>编辑</b></font></td>
    <td align="center" nowrap><font size="-2" face="verdana"><b>删除</b></font></td>
</tr>
<%
    String name = user.getName();
    String email = user.getEmail();
%>
<tr bgcolor="#ffffff">
    <td align="center" width="2%"><font size="-1"><%= user.getID() %></font></td>
    <td width="30%"><font size="-1"><a href="editUser.jsp?user=<%= user.getID() %>"><%= user.getUsername() %></a></font></td>
    <td width="30%"><font size="-1"><%= (name!=null)?name:"" %></font></td>
    <td width="30%"><font size="-1"><%= (email!=null)?email:"" %></font></td>
    <td align="center" width="4%"
        ><a href="editUser.jsp?user=<%= user.getID() %>"
        ><img src="images/button_edit.gif" width="17" height="17" alt="编辑用户属性..." border="0"
        ></a
        ></td>
    <td align="center" width="4%"
        ><a href="removeUser.jsp?user=<%= user.getID() %>"
        ><img src="images/button_delete.gif" width="17" height="17" alt="删除该用户..." border="0"
        ></a
        ></td>
</tr>
</table>
</td></tr>
</table>

<%  } %>

<p>

</body>
</html>


