📄 deluser_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 deluser_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');
out.write('\n');
String strLogined;
String strUsername;
String strUserpwd;
String strRepository;
String strUserToDel;
RightControl rightCtrl;
try
{
rightCtrl =(RightControl)session.getAttribute("rightCtrl");
strLogined = (String)session.getAttribute("strLogined");
strUsername = (String)session.getAttribute("strUsername");
strRepository = (String)session.getAttribute("strRepository");
strUserToDel = request.getParameter("user");
if (null == strLogined)
{
strLogined = "no";
}
if (!strLogined.equals("yes") || null == rightCtrl
|| null == strUsername || null == strRepository || null == strUserToDel)
{
//未登陆
//out.write("strLogined = " + strLogined + "<br>\r\n");
//out.write("strUsername = " + strUsername + "<br>\r\n");
//out.write("strRepository = " + strRepository + "<br>\r\n");
//out.write("rightCtrl = " + rightCtrl.toString() + "<br>\r\n");
response.sendRedirect(response.encodeRedirectURL("index.jsp"));
return;
}
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;
}
strUserToDel = strUserToDel.toLowerCase();
if (strUserToDel.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;
}
RightControl tmpRightCtrl = new RightControl();
if (!tmpRightCtrl.syncFromFiles(RESPOSITORY_ROOT, strRepository)
|| !tmpRightCtrl.ExistUser(strUserToDel))
{
//out.write("<B>RESPOSITORY_ROOT = "+RESPOSITORY_ROOT+"</B><br>\r\n");
//out.write("<B>strRepository = "+strRepository+"</B><br>\r\n");
out.write("<B>更新仓库文件失败, <a href=\"listpath.jsp\">返回目录列表</a></B><br>\r\n");
out.write("</body>\r\n</html>\r\n");
return;
}
tmpRightCtrl.DelUser(strUserToDel);
if (!tmpRightCtrl.SavePasswdFile())
{
out.write("<B>保密账号文件失败, <a href=\"listpath.jsp\">返回目录列表</a></B><br>\r\n");
out.write("</body>\r\n</html>\r\n");
return;
}
//成功
session.setAttribute("rightCtrl", tmpRightCtrl);
out.write("<B>用户["+strUserToDel+"]已删除, <a href=\"listpath.jsp\">返回目录列表</a></B><br>\r\n");
out.write("</body>\r\n</html>\r\n");
return;
}
catch (Exception e)
{
out.write(e.getMessage());
}
out.write('\r');
out.write('\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 + -