📄 perms.jsp
字号:
<% } %> </tr> <tr class="jive-special"> <td class="jive-first" colspan="2"> <b>Registered Users</b> </td> <% for (int i=0; i<permGroupDef.length; i++) { String cbName = "cb_update_reg_" + permGroupDef[i]; boolean hasPerm = permManager.registeredUserHasPermission(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> <% } %> </tr> <% } %> <% if (!cancel && (add || (doAdd && addError))) { %> <tr><td colspan="<%= (permGroupDef.length+2) %>"> </td></tr> <tr><td colspan="<%= (permGroupDef.length+2) %>" style="padding-left:3px"> <% if ("users".equals(show)) { %> Enter username and click the desired permissions: <% } else { %> Enter the group name and click the desired permissions: <% } %> <% if (addError) { %> <span class="jive-error-text"> <br> Couldn't find specified <%= (("users".equals(show) ? "user" : "group")) %>, please try again. </span> <% } %> </td> </tr> <tr> <td colspan="2" style="padding-left:3px"> <%-- - Determine the number of users in the system. If it is less than - or equal to 20, show the list of users in a pulldown box. If - it's more, show a text box: --%> <% if ("users".equals(show)) { %> <% int numUsers = userManager.getUserCount(); if (numUsers <= 30 && !"true".equals(JiveGlobals.getJiveProperty("userGroupAdmin.disabled"))) { %> <select size="1" name="objName"> <option value="">Choose user... <% Iterator users = getSortedIterator(userManager.users(),JiveComparators.USER); while (users.hasNext()) { User user = (User)users.next(); // only show the user if they are not already displayed Map userPerms = getUserPermMap(permManager, permGroupDef); if (userPerms.get(user) != null) { continue; } %> <option value="<%= user.getUsername() %>"> <%= user.getUsername() %> <% } %> </select> <% } else { %> <input type="text" name="objName" size="35" maxlength="100" value=""> <% } %> <% } else { %> <% int numGroups = groupManager.getGroupCount(); if (numGroups <= 30 && !"true".equals(JiveGlobals.getJiveProperty("userGroupAdmin.disabled"))) { %> <select size="1" name="objName"> <option value="">Choose group... <% Iterator groups = getSortedIterator(groupManager.getGroups(),JiveComparators.GROUP); while (groups.hasNext()) { Group group = (Group)groups.next(); // only show the goup if they are not already displayed Map groupPerms = getGroupPermMap(permManager, permGroupDef); if (groupPerms.get(group) != null) { continue; } %> <option value="<%= group.getName() %>"> <%= group.getName() %> <% } %> </select> <% } else { %> <input type="text" name="objName" size="35" maxlength="100" value=""> <% } %> <% } %> </td> <% for (int i=0; i<permGroupDef.length; i++) { %> <td class="jive-perm-cell"> <input type="checkbox" name="newperm" value="<%= permGroupDef[i] %>"> </td> <% } %> </tr> <tr><td colspan="<%= (permGroupDef.length+2) %>" style="padding-left:3px"> <input type="submit" name="doAdd" value="Grant Permission"> <input type="submit" name="cancel" value="Cancel"> </td> </tr> <tr><td colspan="<%= (permGroupDef.length+2) %>"> </td></tr> <% } %> <% if ("users".equals(show)) { %> <% // Get the list of users SortedMap userPerms = getUserPermMap(permManager, permGroupDef); // Only show the list if there are users to show if (userPerms.size() > 0) { showRemoveButton = true; %> <% if (permGroup == CONTENT_GROUP && !add) { %> <tr><td colspan="<%= (permGroupDef.length+2) %>"> </td></tr> <% } %> <% int row = 0; for (Iterator iter=userPerms.keySet().iterator(); iter.hasNext(); ) { User user = (User)iter.next(); Permissions perms = (Permissions)userPerms.get(user); %> <tr class="jive-<%= ((row++%2==0) ? "odd" : "even") %>"> <td align="center"> <input type="checkbox" name="cb_remove_<%= user.getID() %>" value="<%= user.getID() %>" id="cb<%= row %>" onclick="checkState(this.form,'remove',this.form.remove);"> </td> <td class="jive-first"> <label for="cb<%= row %>"> <%= user.getUsername() %> </label> </td> <% for (int i=0; i<permGroupDef.length; i++) { String cbName = "cb_update_" + user.getID() + "_" + permGroupDef[i]; boolean thisIsAdmin = perms.hasPermission(permGroupDef[i]) && permGroupDef[i] == Permissions.SYSTEM_ADMIN; %> <td class="jive-perm-cell<%= ((thisIsAdmin) ? "-admin" : "") %>"> <input type="hidden" name="was<%= cbName %>" value="<%= permGroupDef[i] %>"> <input type="checkbox" name="<%= cbName %>" value="<%= permGroupDef[i] %>" <%= ((perms.hasPermission(permGroupDef[i])) ? " checked" : "") %> onclick="checkState(this.form,'update',this.form.update);"> </td> <% } %> </tr> <% } } %> <% } else { %> <% // Get the list of users SortedMap groupPerms = getGroupPermMap(permManager, permGroupDef); // Only show the list if there are users to show if (groupPerms.size() == 0) { %> <tr> <td colspan="<%= (permGroupDef.length+2) %>" style="padding-left:3px;"> <p> No group permissions. </p> </td> </tr> <% } else { showRemoveButton = true; %> <tr><td colspan="<%= (permGroupDef.length+2) %>"> </td></tr> <% int row = 0; for (Iterator iter=groupPerms.keySet().iterator(); iter.hasNext(); ) { Group group = (Group)iter.next(); Permissions perms = (Permissions)groupPerms.get(group); %> <tr class="jive-<%= ((row++%2==0) ? "odd" : "even") %>"> <td align="center"> <input type="checkbox" name="cb_remove_<%= group.getID() %>" value="<%= group.getID() %>" id="cb<%= row %>" onclick="checkState(this.form,'remove',this.form.remove);"> </td> <td class="jive-first"> <label for="cb<%= row %>"> <%= group.getName() %> </label> </td> <% for (int i=0; i<permGroupDef.length; i++) { String cbName = "cb_update_" + group.getID() + "_" + permGroupDef[i]; %> <td class="jive-perm-cell"> <input type="hidden" name="was<%= cbName %>" value="<%= permGroupDef[i] %>"> <input type="checkbox" name="<%= cbName %>" value="<%= permGroupDef[i] %>" <%= ((perms.hasPermission(permGroupDef[i])) ? " checked" : "") %> onclick="checkState(this.form,'update',this.form.update);"> </td> <% } %> </tr> <% } } %> <% } %> <tr> <td style="padding-left:2px;" colspan="2"> <% // only show the remove button if we had users to print: if (showRemoveButton) { %> <input type="submit" name="remove" value="Remove" disabled> <% } %> <% if (cancel || !add) { %> <input type="submit" name="add" value="Grant New Permission"> <% } %> </td> <td colspan="6" align="center" style="padding : 2px 0px 2px 0px;"> <input type="submit" name="update" value="Update" disabled> </td> </tr> </table> </div> </td></tr></table></div><% if (permGroup == ADMIN_GROUP && forum == null && category == null) { %> <table cellpadding="5" cellspacing="0" border="0" width="100%" style="padding-top:5px;"> <tr> <td width="1%"> <table bgcolor="#999999" cellpadding="1" cellspacing="0" border="0"> <tr> <td> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td bgcolor="#ffcccc"><img src="images/blank.gif" width="10" height="10" border="0"></td> </tr> </table> </td> </tr> </table> </td> <td width="99%"> Warning: Do not delete all system admin users - you need at least one to login to this tool. </td> </tr> </table><% } %><!-- call the setCBState methods --><script language="JavaScript" type="text/javascript">setCBState(document.permform,"remove");setCBState(document.permform,"update");<% if (add && !cancel) { %> document.permform.objName.focus();<% } %></script></form><br><b>Permissions Help</b><p>To grant permissions to a user or group not already displayed, click "Grant New Permission" andselect/enter the user or group name, select the appropriate permission(s) and click "Grant".</p><p>To remove all selected permissions for a user or group, select the user or group by checking thecheckbox to the left of the user or group name and click "Remove".</p><p>To add or remove a permission for a user or group, check or uncheck the appropriate permissionand click "Update".</p><%@ include file="footer.jsp" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -