<!--#include file="../include/hf_conn.asp"-->
<!--#include file="checkadmin.asp"-->
<%call checkmanage("11")%>
<script language=javascript src=../include/mouse_on_title.js></script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="manage.css" type="text/css">
</head>
<BODY background="../images/admin/back.gif">
<%
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 width="98%" border="1"  style="border-collapse: collapse; border-style: dotted; border-width: 0px"  bordercolor="#333333" cellspacing="0" cellpadding="2">
<form action=safe1.asp method=post name="adminpath">
<tr class=backs><td colspan=2 class=td height=18>后台目录修改</td></tr>
<tr><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><td colspan=2>
<INPUT name="ren" TYPE="hidden" value="ok"><INPUT TYPE="submit" value="在线更名"></td></tr>
</td></tr>
</form>
</table>
<br><font color=red>※提示：</font><br><br>
此操作需FSO功能支持。<br>
执行此操作前，请先关闭其它网页窗口，断开FTP连接。<br>
提交后，请耐心等待<font color=red>（请不要重复点击上面的按钮），</font>完成时间视网络状况而定。<br>
请在网络空闲时进行此操作，<b>执行此操作可能导致服务器变慢或不稳定</b>。
<%
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 checktext(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>
