<!-- #include file="setup.asp" -->
<%
if adminpassword<>session("pass") then response.redirect "admin.asp?menu=login"
log(""&Request.ServerVariables("script_name")&"<br>"&Request.ServerVariables("Query_String")&"<br>"&Request.form&"")
content=HTMLEncode(Request("content"))

sql="select * from [user] where username='"&rcusername&"'"
rs.Open sql,Conn,1,3
if membercode<5 then error("<li>只有区长才能给人改名")

select case Request("menu")


case "kill"
n2=HTMLEncode(Request("n2"))
n1=HTMLEncode(Request("n1"))

if n2=n1 then error("<li>晕，根本就没改名嘛！")



If conn.Execute("Select id From [user] where username='"&n1&"'" ).eof Then
error("<li>系统不存在"&n1&"的资料")
end if


If conn.Execute("Select id From [user] where username='"&n2&"'" ).eof Then


conn.execute("update [user] set username='"&n2&"' where username='"&n1&"'")

Application(CacheName&"kill") = n2
error2(""&n1&"改成"&n2&"啦，恭喜！")


end if




end select

%>


<title>Kill bad name</title>

<center>
<table border="0" cellpadding="3" cellspacing="1" width="<%=dkuan%>" class=a2>
<tr class=a1>

<td width="50%" height="5" align="center" colspan="2"><b>更改注册用户名称</b></td>
</tr>
<tr>

<td width="8%" height="4" align="center" rowspan="2" bgcolor="FFFFFF"><b>
更改用户姓名</b></td>
<td width="25%" height="2" bgcolor="FFFFFF">
“旧名”改成“新名”脱胎换骨，重新做人哦。<font color=red>注意：第一位区长名不能更改，否则会出现错误</font></td>
</tr>
<tr>

<td width="25%" height="2" bgcolor="FFFFFF"><form method=POST action=?menu=kill>
<input size="15" name="n1" value="请输入旧名" onfocus="this.value = &quot;&quot;;">&nbsp;&nbsp;&nbsp;&nbsp;
<input size="15" name="n2" value="请输入新名" onfocus="this.value = &quot;&quot;;"><input type="submit" value=" 改 啦 " name="Submit2">
</td></form>
</tr>
</table>
</center>
</div><br>
</td>
</tr>

</center>

<%
rs.close
htmlend%>