📄 delright_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.yoyorock.svnadmin.*;
import java.util.*;
public final class delright_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
static {
_jspx_dependants = new java.util.Vector(1);
_jspx_dependants.add("/define.jsp");
}
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n\r\n\r\n");
out.write('\r');
out.write('\n');
response.setHeader("Cache-Control", "no-store");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires",0);
request.setCharacterEncoding("GBK");
final String RESPOSITORY_ROOT = "C:/test";
out.write('\r');
out.write('\n');
out.write("\r\n\r\n<html>\r\n<head>\r\n<title>\r\nSVNADMIN,增加修改目录权限\r\n</title>\r\n</head>\r\n<body >\r\n");
String strLogined;
String strUsername;
String strRepository;
String strPath;
String strRightUser;
RightControl rightCtrl;
try
{
rightCtrl =(RightControl)session.getAttribute("rightCtrl");
strLogined = (String)session.getAttribute("strLogined");
strUsername = (String)session.getAttribute("strUsername");
strRepository = (String)session.getAttribute("strRepository");
if (null == strLogined)
{
strLogined = "no";
}
if (!strLogined.equals("yes") || null == rightCtrl
|| null == strUsername || null == strRepository)
{
response.sendRedirect(response.encodeRedirectURL("index.jsp"));
return;
}
strPath = request.getParameter("path");
strRightUser = request.getParameter("rightuser");
if (null == strRightUser)
{
//out.write("strPath = "+strPath+"<br>\r\n");
//out.write("strRight = "+strRight+"<br>\r\n");
//out.write("strRightUser = "+strRightUser+"<br>\r\n");
response.sendRedirect(response.encodeRedirectURL("listpath.jsp"));
return;
}
else if (!strUsername.equals(strRepository+"admin".toLowerCase()))
{
//不是管理员没有权限
out.write("<B>只有管理员才可以册除用户权限 <a href=\"listpath.jsp\">返回目录列表</a></B><br>\r\n");
out.write("</body>\r\n</html>\r\n");
return;
}
else if (null != strPath)
{
//权限值转换
strRightUser = strRightUser.toLowerCase();
if (!rightCtrl.syncFromFiles(RESPOSITORY_ROOT, strRepository))
{
out.write("<B>读权限文件失败,请稍后重试,如果再次出现问题请与管理员联系</B><br>\r\n");
}
else if (!rightCtrl.DelUserPath(strRightUser, strPath))
{
out.write("<B>用户["+strRightUser+"]不存在, <a href=\"listpath.jsp\">返回目录列表</a></B><br>\r\n");
}
else if (!rightCtrl.SaveAccessFile())
{
out.write("<B>写权限文件失败,请稍后重试,如果再次出现问题请与管理员联系</B><br>\r\n");
}
else
{
//成功,要在session中保存最后的值
session.setAttribute("rightCtrl", rightCtrl);
out.write("<B>删除目录权限成功 <a href=\"listpath.jsp\">返回目录列表</a></B><br>\r\n");
out.write("</body>\r\n</html>\r\n");
return;
}
}
if (null == strPath)
strPath = "";
}
catch(Exception e)
{
out.write(e.getMessage());
}
out.write("\r\n</body>\r\n</html>\r\n\r\n");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -