index.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:6k
源码类别:
电子政务应用
开发平台:
Java
- <%
- /**
- * $RCSfile: index.jsp,v $
- * $Revision: 1.4 $
- * $Date: 2000/12/18 02:06:21 $
- */
- %>
- <%@ page
- import="java.io.*,
- java.util.*,
- com.coolservlets.forum.*,
- com.coolservlets.forum.util.*,
- com.coolservlets.forum.util.tree.*,
- com.coolservlets.forum.util.admin.*" %>
- <jsp:useBean id="adminBean" scope="session"
- class="com.coolservlets.forum.util.admin.AdminBean"/>
- <% //////////////////////////////
- // Jive installation check
- // Check for the existence of the property "setup" in the
- // jive.properties file. This is managed by the PropertyManager class.
- // This property tells us if the admin tool is being run for the first time.
- boolean setupError = false;
- String installed = null;
- try {
- installed = PropertyManager.getProperty("setup");
- if( installed == null || !installed.equals("true") ) {
- // the "installed" property doesn't exist or isn't set
- response.sendRedirect("setup/setup.jsp");
- return;
- }
- //else if( !installed.equals("true") ) {
- // setupError = true;
- //}
- }
- catch( Exception e ) {
- // signal an error. the file jive.properties might not exist.
- setupError = true;
- }
- // print out a setup error:
- if( setupError ) { %>
- <html>
- <head>
- <title>BBS管理程序</title>
- <link rel="stylesheet" href="style/global.css">
- </head>
- <body>
- 设置错误,请确认配置文件<b>jive.properties</b>在应用服务器的classpath中。
- </body>
- </html>
- <% // for some reason, we have to call flush.. some app servers won't
- // display the above html w/o flushing the stream
- out.flush();
- return;
- }
- %>
- <% ////////////////////////////////
- // 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;
- }
- %>
- <% ////////////////////////
- // get parameters
- boolean logout = ParamUtils.getBooleanParameter(request,"logout");
- %>
- <% /////////////////////////
- // logout if requested:
- if( logout ) {
- try {
- //session.invalidate();
- adminBean.resetAuthToken();
- }
- catch( IllegalStateException ignored ) { // if session is already invalid
- }
- finally {
- response.sendRedirect( "/mainctrl/bbs/admin" );
- //response.sendRedirect( "index.jsp" );
- return;
- }
- }
- %>
- <% ///////////////////////////////////////
- // Get the permissions for this user:
- boolean isSystemAdmin = ((Boolean)session.getValue("jiveAdmin.systemAdmin")).booleanValue();
- boolean isForumAdmin = ((Boolean)session.getValue("jiveAdmin.forumAdmin")).booleanValue();
- boolean isGroupAdmin = ((Boolean)session.getValue("jiveAdmin.groupAdmin")).booleanValue();
- %>
- <% //////////////////////////////////////////////////////////////////
- // set the menu trees in the bean based on the user's permissions
- // system tree
- if( isSystemAdmin || isGroupAdmin ) {
- com.coolservlets.forum.util.tree.Tree systemTree
- = new com.coolservlets.forum.util.tree.Tree("system");
- int nodeID = 0;
- TreeNode node = null;
- if( isSystemAdmin ) {
- node = new TreeNode( nodeID++, "系统设置" );
- node.addChild( new TreeLeaf("缓存", "cache.jsp") );
- node.addChild( new TreeLeaf("数据库信息", "dbInfo.jsp") );
- node.addChild( new TreeLeaf("查询设置", "searchSettings.jsp") );
- node.addChild( new TreeLeaf("参数管理", "propManager.jsp") );
- node.setVisible(true);
- systemTree.addChild(node);
- }
- if( isSystemAdmin ) {
- node = new TreeNode( nodeID++, "用户" );
- node.addChild( new TreeLeaf("用户列表", "users.jsp") );
- //node.addChild( new TreeLeaf("System Admins", "systemAdmins.jsp") );
- node.addChild( new TreeLeaf("口令维护", "password.jsp") );
- node.addChild( new TreeLeaf("创建用户", "createUser.jsp") );
- //node.addChild( new TreeLeaf("Edit User", "editUser.jsp") );
- node.addChild( new TreeLeaf("删除用户", "removeUser.jsp") );
- node.setVisible(true);
- systemTree.addChild(node);
- }
- if( isSystemAdmin || isGroupAdmin ) {
- node = new TreeNode( nodeID++, "用户组" );
- node.addChild( new TreeLeaf("用户组列表", "groups.jsp") );
- if( isSystemAdmin ) {
- node.addChild( new TreeLeaf("创建用户组", "createGroup.jsp") );
- }
- node.addChild( new TreeLeaf("编辑用户组", "editGroup.jsp") );
- node.addChild( new TreeLeaf("删除用户组", "removeGroup.jsp") );
- node.setVisible(true);
- systemTree.addChild(node);
- }
- if( systemTree.size() > 0 ) {
- adminBean.addTree( "systemTree", systemTree );
- }
- }
- // forum tree
- if( isSystemAdmin ) {
- com.coolservlets.forum.util.tree.Tree forumTree
- = new com.coolservlets.forum.util.tree.Tree("forum");
- int nodeID = 0;
- TreeNode node = null;
- node = new TreeNode( nodeID++, "论坛设置" );
- node.addChild( new TreeLeaf("论坛列表", "forums.jsp") );
- node.addChild( new TreeLeaf("创建论坛", "createForum.jsp") );
- node.addChild( new TreeLeaf("论坛属性", "editForum.jsp") );
- node.addChild( new TreeLeaf("删除论坛", "removeForum.jsp") );
- node.addChild( new TreeLeaf("过滤器设置", "forumFilters.jsp") );
- node.addChild( new TreeLeaf("内容管理", "forumContent.jsp") );
- node.setVisible(true);
- forumTree.addChild(node);
- adminBean.addTree( "forumTree", forumTree );
- }
- %>
- <html>
- <head>
- <title>BBS论坛管理</title>
- </head>
- <frameset rows="85,*" bordercolor="#0099cc" border="0" frameborder="0" framespacing="0" style="background-color:#0099cc">
- <frame src="header.jsp" name="header" scrolling="no" marginheight="0" marginwidth="0" noresize>
- <%--frame src="toolbar.jsp" name="toolbar" scrolling="no" noresize--%>
- <frameset cols="175,*" bordercolor="#0099cc" border="0" frameborder="0" style="background-color:#0099cc">
- <frame src="sidebar.jsp" name="sidebar" scrolling="auto" marginheight="0" marginwidth="0" noresize>
- <frameset rows="15,*" bordercolor="#0099cc" border="0" frameborder="0" style="background-color:#0099cc">
- <frame src="shadow.html" name="shadow" scrolling="no" marginheight="0" marginwidth="0" noresize>
- <frame src="main.jsp" name="main" scrolling="auto" noresize>
- </frameset>
- </frameset>
- </frameset>
- </html>