- <%@ page language="java" contentType="text/html;charset=UTF-8" %>
- <%@ include file="../GVinc/gvInclude.jsp" %>
- <%@ include file="clubMasterPass.jsp" %>
- <jsp:useBean id="db" scope="request" class="com.gamvan.club.manage.DatabaseBackup"/>
- <jsp:useBean id="fo" scope="request" class="com.gamvan.tools.FileOperate"/>
- <%
- //权限判断共享代码
- boolean ispass = false;
- //ArrayEdit ae = new ArrayEdit();
- ispass = ae.txtsArray(gvcmgTxt,15,"|");
- if(!ispass){
- out.print(prtCenter("您无权进行此项操作!","",2));
- out.close();
- if(true)return;
- }
- //权限判断代码结束
- String act=TypeChange.nullOfString(request.getParameter("act"));
- String fileName = "GVclub_" + new java.text.SimpleDateFormat("yyMMdd").format(new java.util.Date()) + ".bak";
- String fileFolder = "backup";
- %>
- <html>
- <head>
- <title>社区管理</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link href="css.css" rel="stylesheet" type="text/css">
- <style type="text/css">
- <!--
- .style1 {color: #FF0000}
- .style3 {color: #FF0000; font-weight: bold; }
- -->
- </style>
- </head>
- <body><script language="javascript" type="text/javascript" src="../GVscript/GVtopCode.js"></script>
- <table width="99%" border="0" align="center" cellpadding="2" cellspacing="2" bgcolor="#e6e6e6">
- <tr>
- <td align="center"><strong>配置社区后台管理员等级</strong></td>
- </tr>
- <tr>
- <td bgcolor="#FFFFFF"><span class="style3">目前数据库备份仅支持 MS SQL SERVER, 如果您的论坛使用其他数据库请手动备份。以最大程度的减少灾难发生为您带来的损失。</span></td>
- </tr>
- </table>
- <table width="99%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF">
- <%
- com.gamvan.net.URL u = new com.gamvan.net.URL();
- String url = u.getServerUrl(request);
- if(request.getMethod().equals("POST")){
- fileName = request.getParameter("dFileName");
- fileFolder = request.getParameter("dFileFolder");
- db.setDbName(request.getParameter("dName"));
- db.setFileName(fileName);
- db.setFilePath(request.getRealPath("")+"\club\"+fileFolder+"\");
- //out.print(request.getRealPath("")+"\club\"+fileFolder+"\");
- boolean bea = db.doBackup();
- if(bea){
- url = url+"/club/"+ fileFolder +"/"+fileName;
- out.print("<br/><br/><center>请网际快车类下载工具下载此文件后执行删除操作!!!<br/><a href=""+ url +"" target="blank">"+ url +"</a><br/>");
- out.print("<br/><br/><a href=databaseBackup.jsp?act=del&&fileFolder="+fileFolder+"&fileName="+fileName+">删除备份</a></center>");
- }
- out.print(prtCenter2(db.getMessage(),"databaseBackup.jsp",1));
- out.close();
- if(true)return;
- }else{
- if(act.equals("del")){
- fo.delFile(request.getRealPath("")+"\club\"+request.getParameter("fileFolder")+"\"+request.getParameter("fileName"));
- out.print(prtCenter2("操作完成!","databaseBackup.jsp",1));
- out.close();
- if(true)return;
- }
- }
- %>
- <form name="Gforms" method="post" action="" onSubmit="javascript:postMsg();">
- <tr bgcolor="#f6f6f6">
- <td width="21%" height="25" bgcolor="#eeeeee"><strong>数据库名称</strong></td>
- <td width="79%" bgcolor="#f6f6f6">
- <input name="dName" type="text" id="dName" value="GVclub_">
- 输入您数据库的名字 如 GVclub_gamvan , GVclub_test </td>
- </tr>
- <tr bgcolor="#f6f6f6">
- <td height="12" bgcolor="#eeeeee"><strong>备份文件名</strong></td>
- <td bgcolor="#f6f6f6">
- <input name="dFileName" type="text" id="dFileName" value="<%=fileName%>" size="20">
- 此处可修改为不易被别人猜到的名字以防数据泄露</td>
- </tr>
- <tr bgcolor="#f6f6f6">
- <td height="12" bgcolor="#eeeeee"><strong>备份到目录名</strong></td>
- <td bgcolor="#f6f6f6">
- <input name="dFileFolder" type="text" id="dFileFolder" value="<%=fileFolder%>" size="20">
- 此处可修改为不易被别人猜到的名字以防数据泄露</td>
- </tr>
- <tr bgcolor="#f6f6f6">
- <td height="25" bgcolor="#eeeeee"> </td>
- <td bgcolor="#f6f6f6"><span class="style1">注意备份以后将给出备份文件链接地址,用快车下载备份文件后请点击删除按钮。<br>
- 删除在服务器上的备份文件,以防止数据库内容备份文件被别人下载。</span></td>
- </tr>
- <tr bgcolor="#f6f6f6">
- <td height="25" bgcolor="#eeeeee"> </td>
- <td bgcolor="#f6f6f6">
- <input name="gvSubmit" type="submit" id="gvSubmit" value="执行备份">
- <input name="gvBack" type="hidden" id="gvBack" value="">
- </td>
- </tr>
- </form>
- </table>
- </body>
- </html>