groups.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:4k
源码类别:
电子政务应用
开发平台:
Java
- <%
- /**
- * $RCSfile: groups.jsp,v $
- * $Revision: 1.3 $
- * $Date: 2000/12/18 02:06:21 $
- */
- %>
- <%@ page
- import="java.util.*,
- com.coolservlets.forum.*,
- com.coolservlets.forum.util.*,
- com.coolservlets.forum.util.admin.*"
- errorPage="error.jsp"
- %>
- <jsp:useBean id="adminBean" scope="session"
- class="com.coolservlets.forum.util.admin.AdminBean"/>
- <%! //////////////////
- // page variables
- private final String YES = "<font color='#006600' size='-1'><b>Yes</b></font>";
- private final String NO = "<font color='#ff0000' size='-1'><b>No</b></font>";
- %>
- <% ////////////////////////////////
- // Jive authorization check
- // check the bean for the existence of an authorization token.
- // Its existence proves the user is valid. If it's not found, redirect
- // to the login page
- Authorization authToken = adminBean.getAuthToken();
- if( authToken == null ) {
- response.sendRedirect( "/mainctrl/bbs/admin" );
- return;
- }
- %>
- <% ////////////////////
- // Security check
- // make sure the user is authorized to administer users:
- ForumFactory forumFactory = ForumFactory.getInstance(authToken);
- boolean isSystemAdmin = ((Boolean)session.getValue("jiveAdmin.systemAdmin")).booleanValue();
- boolean isGroupAdmin = ((Boolean)session.getValue("jiveAdmin.groupAdmin")).booleanValue();
- // redirect to error page if we're not a group admin or a system admin
- if( !isGroupAdmin && !isSystemAdmin ) {
- throw new UnauthorizedException("对不起,您没有权限管理用户组!");
- }
- %>
- <html>
- <head>
- <title></title>
- <link rel="stylesheet" href="style/global.css">
- <style type="text/css">
- .groupHeader {
- font-size : 8pt;
- text-align : center;
- }
- </style>
- </head>
- <body background="images/shadowBack.gif" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
- <% ///////////////////////
- // pageTitleInfo variable (used by include/pageTitle.jsp)
- String[] pageTitleInfo = { "用户组" };
- %>
- <% ///////////////////
- // pageTitle include
- %><%@ include file="include/pageTitle.jsp" %>
- <% ////////////////////////////////
- // get an Iterator of users
- ProfileManager manager = forumFactory.getProfileManager();
- Iterator groupIterator = manager.groups();
- %>
- <p>
- <% if( isSystemAdmin ) { %>
- <p>
- (<a href="createGroup.jsp">创建新用户组</a>)
- <p>
- <% } %>
- <form>
- <%-- table of users --%>
- <table bgcolor="#666666" cellpadding="0" cellspacing="0" border="0" width="100%">
- <td>
- <table bgcolor="#666666" cellpadding="3" cellspacing="1" border="0" width="100%">
- <tr bgcolor="#eeeeee">
- <td class="groupHeader" width="1%" nowrap>ID</td>
- <td class="groupHeader" width="40%" nowrap>用户组名称</td>
- <td class="groupHeader" width="55%">描述</td>
- <td class="groupHeader" width="1%" nowrap>会员</td>
- <td class="groupHeader" width="1%" nowrap>编辑</td>
- <td class="groupHeader" width="1%" nowrap>许可</td>
- <td class="groupHeader" width="1%" nowrap>删除</td>
- </tr>
- <% //////////////////
- // no groups:
- if( !groupIterator.hasNext() ) {
- %>
- <tr bgcolor="#ffffff">
- <td colspan="7" align="center">
- <br>
- <i>没有用户组, <a href="createGroup.jsp">增加一个</a>。</i>
- <br><br>
- </td>
- </tr>
- <% }
- %>
- <% ////////////////////////////////////
- // iterate through users, show info
- while( groupIterator.hasNext() ) {
- Group group = (Group)groupIterator.next();
- int groupID = group.getID();
- String groupName = group.getName();
- String groupDescription = group.getDescription();
- int numMembers = group.getMemberCount();
- %>
- <tr bgcolor="#ffffff">
- <td align="center"><%= groupID %></td>
- <td><b><%= groupName %></b></td>
- <td><i><%= (groupDescription!=null&&!groupDescription.equals(""))?groupDescription:" " %></i></td>
- <td align="center"><%= numMembers %></td>
- <td align="center">
- <input type="radio" name="edit"
- onclick="location.href='editGroup.jsp?group=<%=groupID%>';">
- </td>
- <td align="center">
- <input type="radio" name="perms"
- onclick="location.href='groupPerms.jsp?group=<%=groupID%>';">
- </td>
- <td align="center">
- <input type="radio" name="remove"
- onclick="location.href='removeGroup.jsp?group=<%=groupID%>';">
- </td>
- </tr>
- <% }
- %>
- </table>
- </td>
- </table>
- </form>
- </body>
- </html>