⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 removegroup.jsp

📁 非常完整的Java开发的网络办公系统
💻 JSP
字号:

<%
/**
 *	$RCSfile: removeGroup.jsp,v $
 *	$Revision: 1.3.2.1 $
 *	$Date: 2001/05/22 17:59:54 $
 */
%>

<%@ page import="java.util.*,
                 com.coolservlets.forum.*,
                 com.coolservlets.forum.util.*,
				 com.coolservlets.forum.util.admin.*"%>

<jsp:useBean id="adminBean" scope="session"
 class="com.coolservlets.forum.util.admin.AdminBean"/>

<%	////////////////////////////////
	// 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;
	}
%>
 
<%	////////////////////
	// Security check
	
	// make sure the user is authorized to administer users:
	ForumFactory forumFactory = ForumFactory.getInstance(authToken);
	boolean isSystemAdmin = ((Boolean)session.getValue("jiveAdmin.systemAdmin")).booleanValue();
	boolean isGroupAdmin  = ((Boolean)session.getValue("jiveAdmin.groupAdmin")).booleanValue();
	
	// redirect to error page if we're not a group admin or a system admin
	if( !isGroupAdmin && !isSystemAdmin ) {
		request.setAttribute("message","您没有权限管理用户组!");
		response.sendRedirect("error.jsp");
		return;
	}
%>
 
<%	////////////////////
	// get parameters
	int groupID   = ParamUtils.getIntParameter(request,"group",-1);
	boolean doDelete = ParamUtils.getBooleanParameter(request,"doDelete");
%>
 
<%	//////////////////////////////////
	// global error variables
	
	String errorMessage = "";
	
	boolean noGroupSpecified = (groupID < 0);
	boolean errors = (noGroupSpecified);
%>

<%	////////////////////
	// make a profile manager
	ProfileManager manager = forumFactory.getProfileManager();
%>
<%	/////////////////////
	// delete group if specified
	if( doDelete && !errors ) {
		String message = "";
		try {
			Group group = manager.getGroup(groupID);
			manager.deleteGroup(group);
			message = "用户组删除成功!";
		}
		catch( GroupNotFoundException fnfe ) {
			System.err.println( fnfe );
			message = "此用户组不存在!";
		}
		catch( UnauthorizedException ue ) {
			System.err.println( ue );
			message = "您没有权限删除用户组!";
		}
		request.setAttribute("message",message);
		response.sendRedirect("groups.jsp");
        return;
	}
%>

<html>
<head>
	<title></title>
	<link rel="stylesheet" href="style/global.css">
</head>

<body background="images/shadowBack.gif" bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">

<%	///////////////////////
	// pageTitleInfo variable (used by include/pageTitle.jsp)
	String[] pageTitleInfo = { "用户组 : 删除用户组" };
%>
<%	///////////////////
	// pageTitle include
%><%@ include file="include/pageTitle.jsp" %>

<p>

<%	////////////////////
	// display a list of groups to edit if no group was specified:
	if( noGroupSpecified ) {
		String formAction = "remove";
%>
		<%@ include file="groupChooser.jsp"%>
<%		out.flush();
		return;
	}
%>


<%	/////////////////////
	// at this point, we know there is a group to work with:
    Group group = null;
	try {
		group = manager.getGroup(groupID);
	} catch( GroupNotFoundException gnfe ) {
	}
%>


删除用户组 <b><%= group.getName() %></b>?

<p>

<ul>
	警告:这将永久删除此用户组,你确定要这样做吗?
    (但<b>不会</b>删除此用户组中的成员,但是会删除由此用户组赋予成员的权限)。
</ul>

<form action="removeGroup.jsp" name="deleteForm">
<input type="hidden" name="doDelete" value="true">
<input type="hidden" name="group" value="<%= groupID %>">
	<input type="submit" value=" 删除用户组 ">
	&nbsp;
	<input type="submit" name="cancel" value=" 取消 " style="font-weight:bold;"
	 onclick="location.href='groups.jsp';return false;">
</form>

<script language="JavaScript" type="text/javascript">
<!--
document.deleteForm.cancel.focus();
//-->
</script>



</body>
</html>

⌨️ 快捷键说明

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