<!--#include file="../include/config.asp"-->
<!--#include file="checkadmin.asp"-->
<%call checkmanage("11")%>
<script language=javascript src=../include/mouse_on_title.js></script>
     <%
sub checkmanage(str)
Set mrs = conn.Execute("select * from manage where username='"&request.cookies("buyok")("admin")&"'")
if not (mrs.bof and mrs.eof) then
manage=mrs("manage")
if instr(manage,str)<=0 then
response.write "<script language='javascript'>"
response.write "alert('警告：您没有此项操作的权限！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
else
session("buyok_admin_login")=0
end if
else 
response.write "<script language='javascript'>"
response.write "alert('没有登陆，不能执行此操作！');"
response.write "location.href='quit.asp';"
response.write "</script>"
response.end
end if
set mrs=nothing
end sub
%>
<%call checkmanage("10")%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../images/css.css" type=text/css rel=stylesheet>
<LINK href="../list/newhead.css" type=text/css rel=stylesheet>
</head>
<BODY bgcolor="#D9EAFC">
<%
del=request("del")
if del<>"" then
Set fso = Server.CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder server.MapPath("../"&del)
set fso=nothing
response.write "<script language='javascript'>"
response.write "alert('修改成功，请牢记新的后台目录名称，下次登陆时请以新的后台目录名称登陆！');"
response.write "location.href='main.asp';"
response.write "</script>"
response.end
end if
Set fso = Server.CreateObject("Scripting.FileSystemObject")
set fd  = fso.getfolder(server.MapPath("./"))
fdname=fd.name
set fso=nothing
action=request("ren")
if action="" then 
%>
		  <table height="5"><tr><td></td></tr></table>
<TABLE cellSpacing=0 cellPadding=0 width=95% border=0 style="BORDER-RIGHT: #b1bfee 1px solid; BORDER-TOP: #b1bfee 1px solid; BORDER-LEFT: #b1bfee 1px solid; BORDER-BOTTOM: #b1bfee 1px solid" 
>
  <TBODY>
    <TR> 
      <TD width="90%" bgColor=#f4f5fd><font color="#000000">　<B><font color="#FF0000">后台目录修改</font></B></font></TD>
      <TD bgColor=#f4f5fd height=30></TD>
    </TR>
  </TBODY>
</TABLE>		  <table height="5"><tr><td></td></tr></table>

<table width="95%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#b1bfee">
  <form action=safe1.asp method=post name="adminpath">
    <tr bgcolor="#FFFFFF">
      <td width=20% align=right height="18">修改后台目录</td>
      <td> <input type=text value="<%=fdname%>" name="newpath" size=20 maxlength=30>
        [请勿包含<font color=red>&*%/:?"|\</font>等特殊符号]</td>
    </tr>
    <tr bgcolor="#FFFFFF">
      <td colspan=2> <INPUT name="ren" TYPE="hidden" value="ok">
        <INPUT TYPE="submit" value="在线更名"></td>
    </tr></td></tr>
  </form>
</table>
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><font color=red>※提示：</font><br>
      <br>
      此操作需FSO功能支持。<br>
      执行此操作前，请先关闭其它网页窗口，断开FTP连接。<br>
      提交后，请耐心等待<font color=red>（请不要重复点击上面的按钮），</font>完成时间视网络状况而定。<br>
      请在网络空闲时进行此操作，<b>执行此操作可能导致服务器变慢或不稳定</b>。</td>
  </tr>
</table>
<font color="red"></font> 
<%
elseif action="ok" then 
newpath=trim(Request.Form("newpath"))
if newpath = "" then
response.write "<script language='javascript'>"
response.write "alert('您什么也没有填写，请检查后重新提交！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
elseif buyoktxtcheck(request("newpath"))<>request("newpath") then
response.write "<script language='javascript'>"
response.write "alert('您填写的内容中含有非法字符，请检查后重新输入！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
elseif newpath=fdname then
response.write "<script language='javascript'>"
response.write "alert('新旧名称相同，未作修改！');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
else
Set fso = Server.CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(server.MapPath("../"&newpath))=true then
response.write "<script language='javascript'>"
response.write "alert('这个目录已经存在，请输入其它名称。');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
response.end
else
fso.CopyFolder server.MapPath("./"),server.MapPath("../"&newpath)
newpath="../"&newpath&"/safe1.asp?del="&fdname
Response.Redirect(newpath)  '通过地址栏递交变量，转向到新的目录，并删除老目录
end if
set fso=nothing
end if
end if
%>
</body>
</html>
