📄 manaccregrenameok.asp
字号:
<%@ LANGUAGE=VBScript.Encode codepage ="936" %>
<%
On Error Resume Next
Response.Buffer = True
Response.Expires = 0
Response.CacheControl = "Private"
Sub Msg (v)
Response.Write "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><meta http-equiv='pragma' content='no-cache'><style type=text/css>body{color:black;font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}</style></head><body leftMargin=0 topMargin=0 marginheight=0 marginwidth=0>"
Response.Write "<script Language=JavaScript>alert('" & v & "');history.go(-1);</script></body></html>"
Response.End
End Sub
userip=Request.ServerVariables("REMOTE_ADDR")
nickname=Session("hxf_u_nickname")
grade=Session("hxf_u_grade")
If nickname = "" Then Msg "不在聊天室中,不能改名。"
If Session("hxf_u_inthechat") <> "1" Then Msg "不在聊天室中,不能改名。"
If user(0) <> "聊天室管理员" Then
f3="yes"
Else
f3 = Trim(Request.Form("f3"))
End If
If Int(grade)<>12 Then Msg "无权执行此操作。"
f1 = Trim(Request.Form("f1"))
f2 = Trim(Request.Form("f2"))
f4 = Trim(Request.Form("f4"))
If Instr(LCase(Application("wsaxhxf_c_useronlinename"))," "&LCase(f1)&" ")<>0 Then Msg "用户名“" & f1 & "”正在聊天室中,不能改名。"
If f1 = "" Then Msg "请输入旧用户名。"
If f2 = "" Then Msg "请输入改名原因。"
If f3 <> "no" Then f3 = "yes"
If f4 = "" Then Msg "请输入新用户名!"
If Len(f2) > 50 Then f2 = Left(f2, 50)
f2 = Replace(f2, Chr(13) & Chr(10), "")
f2 = Server.HTMLEncode(f2)
f2 = Replace(f2, "\", "\\")
f2 = Replace(f2, "/", "\/")
f2 = Replace(f2, "'", "\'")
f2 = Replace(f2, Chr(34), "\" & Chr(34))
f2 = SqlStr(f2)
If f1 = f4 Then Msg "新用户名不能与旧用户名相同!"
For i = 1 To Len(f4)
su = Mid(f4, i, 1)
xx = Asc(su)
zhengchu = -1 * xx \ 256
yushu = -1 * xx Mod 256
If (xx > 122 Or (xx > 57 And xx < 97) Or (xx < -10241 And xx > -10247) Or yushu = 129 Or yushu > 192 Or (yushu < 2 And yushu > -1) Or (((zhengchu > 1 And zhengchu < 8) Or (zhengchu > 79 And zhengchu < 86)) And yushu < 96) Or (xx > -352 And xx < 48) Or (xx < -22016 And xx > -24321) Or (xx < -32448)) Then
Chuser = False
Else
Chuser = True
end if
Next
If Chuser = False Then Msg "新用户名中不能够带有任何特殊字符。只能够使用汉字或字母。"
Set conn=Server.CreateObject("ADODB.CONNECTION")
Set rs=Server.CreateObject("ADODB.RecordSet")
connstr=Application("wsaxhg_connstr")
conn.open connstr
sql = "SELECT username FROM reginfo WHERE username = '" & f4 & "'"
rs.Open sql, conn, 1, 1
If Not (rs.Eof And rs.Bof) Then
f4 = rs("username")
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
Msg "新用户名“" & f4 & "”已经被使用,不能改为此名。"
End If
rs.Close
sql = "SELECT username FROM reginfo WHERE username = '" & f1 & "'"
rs.Open sql, conn, 1, 3
If rs.Eof And rs.Bof Then
rs.Close
conn.Close
Set rs = Nothing
Set conn = Nothing
Msg "旧用户名“" & f1 & "”不存在,不能改名!"
End If
f1 = rs("username")
rs("username") = f4
rs.Update
rs.Close
If f3 = "yes" Then
n = Year(Date)
y = Month(Date)
r = Day(Date)
s = Hour(Time())
f = Minute(Time())
m = Second(Time())
If Len(y) = 1 Then y = "0" & y
If Len(r) = 1 Then r = "0" & r
If Len(s) = 1 Then s = "0" & s
If Len(f) = 1 Then f = "0" & f
If Len(m) = 1 Then m = "0" & m
sjsfm = s & ":" & f & ":" & m
sj = n & "-" & y & "-" & r & " " & sjsfm
sql = "INSERT INTO logs (type, logtime, name, ip, opertion) VALUES ('3', '" & sj & "', '" & nickname & "', '" & userip & "', '改名:<font color=red>" & f1 & "</font> --> <font color=red>" & f4 & "</font>。<br><font class=yy>【原因:" & f2 & "】</font>')"
conn.Execute sql
End If
conn.Close
Set rs = Nothing
Set conn = Nothing
Response.Write "<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><meta http-equiv='pragma' content='no-cache'><style type=text/css>body{color:black;font-family:宋体;font-size:9pt;background-color:buttonface;border-bottom:medium none;border-left:medium none;border-right:medium none;border-top:medium none;padding-bottom:0px;padding-left:0px;padding-right:0px;padding-top:0px}</style></head><body leftMargin=0 topMargin=0 marginheight=0 marginwidth=0>"
Response.Write "<script Language=JavaScript>alert('■ 操作完成 ■\n\n已经将用户名 [" & f1 & "] 改为 [" & f4 & "]。 ');window.close();</script></body></html>"
Response.End
Function SqlStr(v)
SqlStr = Replace(v, "'", "''")
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -