<!-- #include file="setup.asp" -->
<%
if SiteSettings("AdminPassword")<>session("pass") then response.redirect "Admin_Default.asp?menu=Login"
Log("")

AdminTop
if UserRoleID <> 1 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 [BBSXP_Users] where UserName='"&n1&"'" ).eof Then
error("<li>系统不存在"&n1&"的资料")
end if


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


conn.execute("update [BBSXP_Users] set UserName='"&n2&"' where UserName='"&n1&"'")
<!-----------蓝色部分为更新结婚会员名称的操作---------------------------------->
conn.execute("update [BBSXP_Users] set Consort='"&n2&"' where Consort='"&n1&"'")
<!-----------红色部分为更新回复表与主表的操作---------------------------------->
conn.execute("update [BBSXP_Threads] set UserName='"&n2&"' where UserName='"&n1&"'")
conn.execute("update [BBSXP_Threads] set LastName='"&n2&"' where LastName='"&n1&"'")
conn.execute("update [BBSXP_Posts] 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="80%" 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">
“旧名”改成“新名”......脱胎换骨，重新做人哦。</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 = "";">    
<input size="15" name="n2" value="请输入新名" onfocus="this.value = "";"><input type="submit" value=" 改 啦 " name="Submit2">
</td></form>
</tr>
</table>
</center>
</div>

</td>
</tr>

</center>

<%htmlend%>
