global.jsp
来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· JSP 代码 · 共 92 行
JSP
92 行
<%/** * $RCSfile: global.jsp,v $ * $Revision: 1.7 $ * $Date: 2002/08/09 22:46:01 $ */%><%@ page import="java.util.*, com.jivesoftware.forum.*"%><%@ include file="permMethods.jsp" %><% request.setAttribute("com.iplanet.server.http.servlet.parameterEncoding", JiveGlobals.getCharacterEncoding());%><% // Security check Authorization authToken = (Authorization)session.getAttribute("jive.admin.authorization"); if (authToken == null) { response.sendRedirect("login.jsp"); return; } else { // check for an anonymous user token if (authToken.isAnonymous()) { response.sendRedirect("login.jsp"); return; } } // Get the forum factory object. ForumFactory forumFactory = ForumFactory.getInstance(authToken); // Get the user of this page User pageUser = null; try { pageUser = forumFactory.getUserManager().getUser(authToken.getUserID()); } catch (Exception e) { response.sendRedirect("login.jsp"); return; } String onload = ""; // Role levels for the page user: boolean isSystemAdmin = forumFactory.hasPermission(ForumPermissions.SYSTEM_ADMIN); boolean isCatAdmin = false; boolean isForumAdmin = false; boolean isUserAdmin = false; boolean isGroupAdmin = false; boolean isModerator = false;%><%! // Global vars/methods for the entire skin static final String tblBorderColor = "#aaaaaa"; // Vars to indicate what permission "mode" we're working in - either we're // editing forum perms or category perms. We define these vars here because // there are multiple pages in the admin tool that need to link to the // permission pages and pass in what mode they're operating in. static final int CAT_MODE = 1; static final int FORUM_MODE = 2; // Vars to indicate what permission "group" we're working in. We can either // modify permissions for conetn (read, post, attach, etc) or for admins // (system admin, group admin, moderator, etc): static final int CONTENT_GROUP = 3; static final int ADMIN_GROUP = 4; /** * Gets a message from the session. The message is removed from the session * after we get it. */ private String getOneTimeMessage(HttpSession session, String name) { String message = (String)session.getAttribute("jive.admin."+name); if (message != null) { session.removeAttribute("jive.admin."+name); return message; } return null; } /** * Sets a message in the session. The message is removed from the session * after it is accessed (via getOneTimeMessage(...)) once. */ private void setOneTimeMessage(HttpSession session, String name, String value) { session.setAttribute("jive.admin."+name, value); }%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?