📄 perms.jsp
字号:
try { User user = userManager.getUser(id); for (int j=0; j<permGroupDef.length; j++) { permManager.removeUserPermission(user, permGroupDef[j]); } } catch (UserNotFoundException unfe) {} } else if ("groups".equals(show)) { try { Group group = groupManager.getGroup(id); for (int j=0; j<permGroupDef.length; j++) { permManager.removeGroupPermission(group, permGroupDef[j]); } } catch (GroupNotFoundException gnfe) {} } } } if (isError) { cancel = true; }%><% // special onload command to load the sidebar if (category != null) { onload = " onload=\"parent.frames['sidebar'].location.href='sidebar.jsp?sidebar=forum';\""; } String bookmark = ""; if (permGroup == ADMIN_GROUP) { bookmark = "admin_perm_group"; } else if (permGroup == CONTENT_GROUP) { bookmark = "content_perm_group"; }%><%@ include file="header.jsp" %><p><% // Title of this page and breadcrumbs String title = null; String[][] breadcrumbs = null; // Print out different breadcrumbs depending if we're editing // category permissions or if we're editing any admin perms. if (permGroup == ADMIN_GROUP) { title = "Administrators & Moderators"; if (category != null) { breadcrumbs = new String[][] { {"Main", "main.jsp"}, {"Category List", "forums.jsp?cat=" + categoryID}, {"Admins & Moderators", "perms.jsp?cat="+categoryID+"&forum=" + forumID + "&permGroup="+permGroup+"&show="+show} }; } else { breadcrumbs = new String[][] { {"Main", "main.jsp"}, {"Admins & Moderators", "perms.jsp?forum=" + forumID + "&permGroup="+permGroup+"&show="+show} }; } } else if (permGroup == CONTENT_GROUP) { if (category == null && forum == null) { title = "Global Permissions"; breadcrumbs = new String[][] { {"Main", "main.jsp"}, {title, "perms.jsp?cat="+categoryID+"&permGroup="+permGroup+"&show="+show} }; } else if (category != null && forum == null) { title = "Category Permissions"; breadcrumbs = new String[][] { {"Main", "main.jsp"}, {title, "perms.jsp?cat="+categoryID+"&permGroup="+permGroup+"&show="+show} }; } else { title = "Forum Permissions"; breadcrumbs = new String[][] { {"Main", "main.jsp"}, {title, "perms.jsp?forum="+forumID+"&permGroup="+permGroup+"&show="+show} }; } }%><%@ include file="title.jsp" %><% if (permGroup == ADMIN_GROUP) { %> <% if (category != null) { %> <a href="forums.jsp?cat=<%= category.getID() %>" ><b>Category List</b></a> <b>»</b> <b><%= category.getName() %></b> <p> Grant category administrator privileges to users or groups for this category. <% } else if (forum != null) { %> <a href="forums.jsp?cat=<%= forum.getForumCategory().getID() %>" ><b>Category List</b></a> <b>»</b> <b><%= forum.getName() %></b> <p> Grant category administrator privileges to users or groups for this forum. <% } else { // global %> Grant global category admin or system admin privileges to users or groups. Note, this sets permission for admins over all categories. To designate administrators for individual categories, click on the "Content" tab, choose a category then choose "Admins/Moderators" from the left menu. <% } %> Permissions are always additive, such that the final permissions for a category will be global permissions, plus category specific permissions.<% } else if (permGroup == CONTENT_GROUP) { if (category != null) { %> <a href="forums.jsp?cat=<%= category.getID() %>" ><b>Category List</b></a> <b>»</b> <b><%= category.getName() %></b> <p> Edit global permissions to set the permissions policies that all of your categories will use. <% } else if (forum != null) { %> <a href="forums.jsp?cat=<%= forum.getForumCategory().getID() %>" ><b>Category List</b></a> <b>»</b> <b><%= forum.getName() %></b> <p> Edit global permissions to set the permissions policies that all of your categories will use. <% } else { %> Permissions are always additive, such that the final permissions for a category will be global permissions, plus category specific permissions. <% } } %><p><% if (isError) { %> <font color="red">An error occurred when attempting the requested action.<br><br> <%= getOneTimeMessage(session, "message") %></font> <br><br><% } %><% String message = getOneTimeMessage(session, "message"); if (message != null) {%> <font size="-1" color="#339900"><b><i><%= message %></i></b></font> <p><% } %><script language="JavaScript" type="text/javascript">var removeCBState = "";var updateCBState = "";function setCBState(el, type) { var elements = el.elements; for (var i=0; i<elements.length; i++) { var element = elements[i]; if (element.type == 'checkbox' && element.name.indexOf(type) > -1) { if (type == 'remove') { removeCBState += ((element.checked) ? "1" : "0"); } else if (type == 'update') { updateCBState += ((element.checked) ? "1" : "0"); } } }}function checkState(el, type, button, isAdmin) { var elements = el.elements; var state = ""; for (var i=0; i<elements.length; i++) { var element = elements[i]; if (element.type == 'checkbox' && element.name.indexOf(type) > -1) { if (type == 'remove') { state += ((element.checked) ? "1" : "0"); } else if (type == 'update') { state += ((element.checked) ? "1" : "0"); } } } if (type == 'remove') { if (state == removeCBState) { button.disabled = true; } else { button.disabled = false; } } else { if (state == updateCBState) { button.disabled = true; } else { button.disabled = false; } }}</script><style type="text/css">#jive-permlegend TABLE, #jive-permlegend TD { border-width : 1px 1px 0px 1px; border-color : #ccc; border-style : solid;}#jive-permlegend TD { border-width : 0px 0px 1px 0px; padding : 0px 25px 0px 5px; font-size : 0.7em;}.jive-userlist TH { font-size : 0.7em; font-weight : normal; text-align : center; padding : 3px 5px 3px 5px;}.jive-permslist .jive-perm-cell, .jive-permslist .jive-perm-cell-admin { text-align : center;}.jive-permslist .jive-perm-cell-admin { background-color : #fcc;}.jive-permslist .jive-odd, .jive-permslist .jive-special { background-color : #eee;}.jive-permslist .jive-first { padding : 4px 6px 4px 6px;}/* tabs */.jive-permslist .jive-permtabs .jive-selected-permtab,.jive-permslist .jive-permtabs .jive-permtab,.jive-permslist .jive-permtabs .jive-spacertab,.jive-permslist .jive-permtabs .jive-springtab,.jive-permslist .jive-userlist TABLE { border-width : 1px 1px 1px 1px; border-color : #bbb; border-style : solid; padding : 3px 8px 3px 8px;}.jive-permslist .jive-permtabs .jive-selected-permtab { border-width : 1px 1px 0px 1px; background-color : #fff;}.jive-permslist .jive-permtabs .jive-permtab { border-width : 1px 1px 1px 1px; background-color : #eee;}.jive-permslist .jive-permtabs .jive-spacertab { border-width : 0px 0px 1px 0px; padding : 2px;}.jive-permslist .jive-permtabs .jive-springtab { border-width : 0px 0px 1px 0px;}.jive-permslist .jive-userlist TABLE { border-width : 0px 1px 1px 1px; padding : 0px;}.jive-selected-permtab A, .jive-permtab A,.jive-selected-permtab A:hover, .jive-permtab A:hover,.jive-selected-permtab A:visited, .jive-permtab A:visited { text-decoration : none; color : #000;}.jive-selected-permtab A:hover, .jive-permtab A:hover { text-decoration : underline;}</style><p><b>Permissions Summary</b></p><p>Below is a summary of permissions associated with various users and groups.</p><% if (updatedPerms) { %> <p style="color:#090;"> Permissions updated successfully. </p><% } %><form action="perms.jsp" method="post" name="permform"><input type="hidden" name="cat" value="<%= categoryID %>"><input type="hidden" name="forum" value="<%= forumID %>"><input type="hidden" name="permGroup" value="<%= permGroup %>"><input type="hidden" name="show" value="<%= show %>"><input type="hidden" name="add" value="<%= add %>"><div class="jive-permslist"><table cellpadding="0" cellspacing="0" border="0" width="100%"><%-- ===== Tabs Row ===== --%><tr> <td> <div class="jive-permtabs"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="jive-spacertab" width="1%"> </td> <td class="jive-<%= (("users".equals(show)) ? "selected-" : "") %>permtab" width="1%" nowrap> <span class="jive-tabtext"> <a href="perms.jsp?cat=<%= categoryID %>&forum=<%= forumID %>&permGroup=<%= permGroup %>&show=users" >User Permissions</a> </span> </td> <td class="jive-spacertab" width="1%"> </td> <td class="jive-<%= (("groups".equals(show)) ? "selected-" : "") %>permtab" width="1%" nowrap> <span class="jive-tabtext"> <a href="perms.jsp?cat=<%= categoryID %>&forum=<%= forumID %>&permGroup=<%= permGroup %>&show=groups" >Group Permissions</a> </span> </td> <td class="jive-springtab" width="97%"> </td> </tr> </table> </div> </td></tr><%-- ===== Perm List Row (either user or group) ===== --%><tr> <td> <div class="jive-userlist"> <table cellpadding="0" cellspacing="1" border="0" width="100%"> <tr> <th width="1%"> </th> <th width="39%"> </th> <% for (int i=0; i<permGroupDef.length; i++) { String permGroupName = (String)permNames.get(new Long(permGroupDef[i])); %> <th bgcolor="#dddddd" width="<%= (60/permGroupDef.length) %>%"><%= permGroupName %></th> <% } %> </tr> <% boolean showRemoveButton = false; if ("users".equals(show) && permGroup == CONTENT_GROUP) { %> <tr class="jive-special"> <td class="jive-first" colspan="2"> <b>Anyone</b> </td> <% for (int i=0; i<permGroupDef.length; i++) { String cbName = "cb_update_anon_" + permGroupDef[i]; boolean hasPerm = permManager.anonymousUserHasPermission(permGroupDef[i]); %> <td class="jive-perm-cell"> <input type="hidden" name="was<%= cbName %>" value="<%= permGroupDef[i] %>"> <input type="checkbox" name="<%= cbName %>" value="<%= permGroupDef[i] %>" onclick="checkState(this.form,'update',this.form.update);" <%= ((hasPerm) ? "checked" : "") %>> </td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -