viewmemberpermissions.jsp

来自「一个完整的网络订餐系统」· JSP 代码 · 共 280 行

JSP
280
字号
<%--
 - $Header: /cvsroot/mvnforum/mvnforum/srcweb/mvnplugin/mvnforum/admin/viewmemberpermissions.jsp,v 1.8 2005/01/18 11:01:39 minhnn Exp $
 - $Author: minhnn $
 - $Revision: 1.8 $
 - $Date: 2005/01/18 11:01:39 $
 -
 - ====================================================================
 -
 - Copyright (C) 2002-2005 by MyVietnam.net
 -
 - This program is free software; you can redistribute it and/or
 - modify it under the terms of the GNU General Public License
 - as published by the Free Software Foundation; either version 2
 - of the License, or any later version.
 -
 - All copyright notices regarding mvnForum MUST remain intact
 - in the scripts and in the outputted HTML.
 - The "powered by" text/logo with a link back to
 - http://www.mvnForum.com and http://www.MyVietnam.net in the
 - footer of the pages MUST remain visible when the pages
 - are viewed on the internet or intranet.
 -
 - This program is distributed in the hope that it will be useful,
 - but WITHOUT ANY WARRANTY; without even the implied warranty of
 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 - GNU General Public License for more details.
 -
 - You should have received a copy of the GNU General Public License
 - along with this program; if not, write to the Free Software
 - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 -
 - Support can be obtained from support forums at:
 - http://www.mvnForum.com/mvnforum/index
 -
 - Correspondence and Marketing Questions can be sent to:
 - info@MyVietnam.net
 -
 - @author: Minh Nguyen  minhnn@MyVietnam.net
 - @author: Mai  Nguyen  mai.nh@MyVietnam.net
 --%>
<%@ page contentType="text/html;charset=utf-8" %>
<%@ page errorPage="fatalerror.jsp"%>
<%@ page import="java.util.*"%>
<%@ page import="com.mvnforum.db.*" %>
<%@ page import="com.mvnforum.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ include file="inc_common.jsp"%>
<fmt:bundle basename="mvnForum_i18n">
<html>
<head>
  <title><fmt:message key="mvnforum.common.forum.title_name"/> - View Member Cumulative Permission</title>
<%@ include file="/mvnplugin/mvnforum/meta.jsp"%>
<link href="<%=onlineUser.getCssPath()%>" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0">
<%@ include file="header.jsp"%>
<br/>

<%
MemberBean memberBean = (MemberBean)request.getAttribute("MemberBean");
Collection groups = (Collection)request.getAttribute("MemberGroups");
MVNForumPermission perm = (MVNForumPermission)request.getAttribute("Permissions");
%>
<table width="95%" align="center">
  <tr class="nav">
    <td><img src="<%=contextPath%>/mvnplugin/mvnforum/images/nav.gif"></td>
    <td width="100%" nowrap>
    <a class="nav" href="<%=indexUrl%>"><fmt:message key="mvnforum.common.nav.index"/></a>&nbsp;&raquo;&nbsp;
    <a class="nav" href="index">Admin CP</a>&nbsp;&raquo;&nbsp;
    <a class="nav" href="groupmanagement">User Management</a>&nbsp;&raquo;&nbsp;
    Member: <a class="nav" href="viewmember?memberid=<%=memberBean.getMemberID()%>"><%=memberBean.getMemberName()%></a>&nbsp;&raquo;&nbsp;
    View Member Cumulative Permission
    </td>
  </tr>
</table>
<br/>

<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="theader">
    <td colspan="2">Member Informations</td>
  </tr>
  <tr class="trow1">
    <td width="30%">Member ID</td>
    <td><%=memberBean.getMemberID()%></td>
  </tr>
  <tr class="trow2">
    <td>Member Name</td>
    <td><b><%=memberBean.getMemberName()%></b></td>
  </tr>
  <tr class="trow1">
    <td>Full Name</td>
    <td><%=memberBean.getMemberFirstname()%>&nbsp;<%=memberBean.getMemberLastname()%></td>
  </tr>
  <tr class="trow2">
    <td>E mail</td>
    <td><%=memberBean.getMemberEmail()%></td>
  </tr>
  <tr class="trow2">
    <td valign="top">Belong to <%=groups.size() + 1%> group(s)</td>
    <td><b>Member</b> (<a class="command" href="viewgroup?group=2">View Group</a>)<br/>
    <%
      for (Iterator groupIter = groups.iterator(); groupIter.hasNext(); ) { 
        GroupsBean group = (GroupsBean)groupIter.next(); %>
        <b><%=group.getGroupName()%></b>
        (<a class="command" href="viewgroup?group=<%=group.getGroupID()%>">View Group</a> - <a class="command" href="listmembergroup?group=<%=group.getGroupID()%>">List Members in Group</a>)
        <br/>
    <%}%>
    </td>
  </tr>
</table>
<br/>
<table width="95%" align="center">
  <tr>
    <td class="highlight" colspan="19">Global Permissions:</td>
  </tr>
</table>
<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="theader">
    <td width="80%">Permissions</td>
    <td align="center">Status (Yes/No)</td>
  </tr>
  <tr class="tcat">
    <td colspan="2">Special permissions:</td>
  </tr>
  <tr class="trow1">
    <td>Activated</td>
    <td align="center"><%if (perm.isActivated()) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>
  <%--tr class="trow2">
    <td>Authenticated</td>
    <td align="center"><%if (perm.isAuthenticated()) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr--%>
  <tr class="tcat">
    <td colspan="2">Forum/Category permissions</td>
  </tr>
  <tr class="trow1">
    <td>Add new Category</td>
    <td align="center"><%if (perm.canAddCategory()) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>
  <tr class="trow2">
    <td>Edit Category</td>
    <td align="center"><%if (perm.canEditCategory()) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>
  <tr class="trow1">
    <td>Delete Category</td>
    <td align="center"><%if (perm.canDeleteCategory()) {%> <font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>
  <tr class="trow2">
    <td>Add new Forum</td>
    <td align="center"><%if (perm.canAddForum()) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>
  <tr class="tcat">
    <td colspan="2">Other permissions:</td>
  </tr>
  <tr class="trow1">
    <td>Admin System</td>
    <td align="center"><%if (perm.canAdminSystem()) {%> <font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>
  <%--<tr class="trow2">
    <td>Login</td>
    <td align="center"><%if (perm.canLogin()) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>--%>
  <tr class="trow2">
    <td>Send Mail</td>
    <td align="center"><%if (perm.canSendMail()) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>
  <tr class="trow1">
    <td>Use Avatar</td>
    <td align="center"><%if (perm.canUseAvatar()) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>
  <tr class="trow2">
    <td>Use Private Message</td>
    <td align="center"><%if (perm.canUseMessage()) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>
  <tr class="trow1">
    <td>Add Attachment in Private Message</td>
    <td align="center"><%if (perm.canAddMessageAttachment()) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>
</table>

<br/>
<table width="95%" align="center">
  <tr>
    <td class="highlight" colspan="19">Forum-specific Permissions:</td>
  </tr>
</table>
<table class="tborder" width="95%" cellspacing="1" cellpadding="3" align="center">
  <tr class="theader" align="center">
    <td>Forum</td>
    <td>Edit</td>
    <td>Delete</td>
    <td>Assign</td>
    <td>Thread</td>
    <td>Add</td>
    <td>Moderate</td>
    <td>Post</td>
    <td>Read</td>
    <td>Add</td>
    <td>Delete</td>
    <td>Edit</td>
    <td>Attachment</td>
    <td>Add</td>
    <td>Get</td>
    <td>Poll</td>
    <td>Add</td>
    <td>Edit</td>
    <td>Delete</td>
  </tr>
<%
CategoryCache categoryCache = CategoryCache.getInstance();
ForumCache forumCache = ForumCache.getInstance();
Collection categoryBeans = categoryCache.getBeans();
Collection forumBeans = forumCache.getBeans();
%>
<%
for (Iterator catIterator = categoryBeans.iterator(); catIterator.hasNext(); ) {
    CategoryBean categoryBean = (CategoryBean)catIterator.next();
%>
   <tr class="tcat"><td colspan="19"><b><%=categoryBean.getCategoryName()%></b></td></tr>
  <%int forumCountInCurrentCategory = 0;
    for (Iterator forumIterator = forumBeans.iterator(); forumIterator.hasNext(); ) {
        ForumBean forumBean = (ForumBean)forumIterator.next();
        
        if (forumBean.getCategoryID() == categoryBean.getCategoryID()) {
            forumCountInCurrentCategory++;
            String color = (forumCountInCurrentCategory%2 == 1) ? "trow1" : "trow2";
            int forumID = forumBean.getForumID();
            boolean editForum = perm.canEditForum(forumID);
            boolean deleteForum = perm.canDeleteForum(forumID);
            boolean assignForum = perm.canAssignToForum(forumID);
            boolean moderateThread = perm.canModerateThread(forumID);
            boolean addThread = perm.canAddThread(forumID);
            boolean readPost = perm.canReadPost(forumID);
            boolean addPost = perm.canAddPost(forumID);
            boolean deletePost = perm.canDeletePost(forumID);
            boolean editPost = perm.canEditPost(forumID);
            boolean addAttach = perm.canAddAttachment(forumID);
            boolean getAttach = perm.canGetAttachment(forumID);
            boolean addPoll = perm.canAddPoll(forumID);
            boolean editPoll = perm.canEditPoll(forumID);
            boolean deletePoll = perm.canDeletePoll(forumID);
  %>
  <tr class="<%=color%>"  align="center">
    <td align="left"> <%=forumBean.getForumName()%></td>
    <td><%if (editForum) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td><%if (deleteForum) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td><%if (assignForum) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td class="messageTextBold">Thread &raquo;</td>
    <td><%if (addThread) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td><%if (moderateThread) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td class="messageTextBold">Post &raquo;</td>
    <td><%if (readPost) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td><%if (addPost) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td><%if (deletePost) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td><%if (editPost) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td class="messageTextBold">Attachment &raquo;</td>
    <td><%if (addAttach) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td><%if (getAttach) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td class="messageTextBold">Poll &raquo;</td>
    <td><%if (addPoll) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td><%if (editPoll) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
    <td><%if (deletePoll) {%><font color="#008000">Yes<%} else {%><font color="#FF0080">No<%}%></font></td>
  </tr>
<%      }//if
    } //for forumIndex%>
 <% if ( forumCountInCurrentCategory == 0 ) { %>
    <tr class="trow1"><td colspan="19" align="center"><fmt:message key="mvnforum.user.listforums.table.no_forum"/></td></tr>
 <% } 
} // for category%>
<% if ( categoryBeans.size() == 0 ) { %>
    <tr class="trow1"><td colspan="19" align="center"><fmt:message key="mvnforum.user.listforums.table.no_category"/></td></tr>
<% } %>
</table>

<br/>
</fmt:bundle>
<%@ include file="footer.jsp"%>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?