userupgrade3.asp

来自「聊天室源码呵呵你好用~~~~~~2.0版本」· ASP 代码 · 共 122 行

ASP
122
字号
<%@ LANGUAGE=VBScript%>
<%Server.ScriptTimeout=600
Response.Expires=0
if Session("a_c_user_name")="" then
 Response.write "<b>[操作失败]</b><p>您尚未登录(或已经超时退出),不能进行此操作!" 
 Response.end
end if
if Session("a_c_user_level")<7 then
 Response.Write "<b>[操作失败]</b><p>您没有升级操作的权限!<a href=javascript:history.go(-1)>【返回】</a>"
 Response.End
end if
upusername=Server.HTMLEncode(Trim(Request.Form("upusername")))
upuserlevel=Request.Form("level")
upwhy=server.HTMLEncode(Trim(Request.Form("upwhy")))
if upwhy="" then
 Response.Write "<b>[操作失败]</b><p>请输入升级的原因!<a href=javascript:history.go(-1)>【返回】</a>"
 Response.End
end if
if upusername="" or upuserlevel="" then
 Response.Write "<b>[操作失败]</b><p>用户名或用户等级的为空!<a href=javascript:history.go(-1)>【返回】</a>"
 Response.End
end if
if Session("a_c_user_level")<10 and upuserlevel>5 then
 Response.Write "<b>[操作失败]</b><p>您不能将用户等级升至 5 级以上!<a href=javascript:history.go(-1)>【返回】</a>"
 Response.End
end if
dim show(8)
Application.Lock
input=Application("a_c_reg_data")
countud=Application("a_c_reg_num")
countudnum=(countud-4)/8
yzc=0
for i=5 to countud step 8
 if input(i)=upusername then
  show(1)=input(i)
  show(2)=input(i+1)
  show(3)=input(i+2)
  show(4)=input(i+3)
  show(5)=input(i+4)
  show(6)=input(i+5)
  show(7)=input(i+6)
  show(8)=input(i+7)
  yzc=1
 end if
next
if yzc=0 then
 Response.Write "<b>[操作失败]</b><p>该用户名不存在!<a href=javascript:history.go(-1)>【返回】</a>"
 Response.End
end if
if int(show(3))>=int(upuserlevel) then
 Response.Write "<b>[操作失败]</b><p>新等级 <= 原等级,不能完成升级操作!<a href=javascript:history.go(-1)>【返回】</a>"
 Response.End
end if
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
sj = s & ":" & f & ":" & m
sj2= n & "-" & y & "-" & r & " " & sj
for i=5 to countud step 8
 if input(i)=upusername then
  userupgrade=sj2 & " " & Session("a_c_user_name") & "(" & Request.ServerVariables("REMOTE_ADDR") & ") 把 " & input(i) & " 由 " & input(i+2) & " 级升至 " & upuserlevel & " 级!【原因:" & upwhy & "】"
  input(i+2)=upuserlevel
 end if
next
Application("a_c_reg_data")=input
Application.UnLock
dim log()
logfile=server.mappath("logdata.asp")
Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.OpenTextFile(logfile,1,False)
countlog = 0
do while not thisfile.AtEndOfStream
 thisline = thisfile.readline
 Redim preserve log(countlog)
 log(countlog) = thisline
 countlog = countlog + 1
loop
thisfile.Close
Set outfile = fs.CreateTextFile(logfile)
outfile.WriteLine log(0)
outfile.WriteLine userupgrade
if countlog>500 then countlog=500
for i=1 to countlog-1
 outfile.WriteLine log(i)
next
outfile.Close%><html>
<head>
<title>升级操作</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type='text/css'>
<!--
.p9 {line-height: 150%; font-size: 9pt;}
.p12 {line-height: 150%; font-size: 12pt;}
body {line-height: 150%;font-size : 12pt;}
A  {text-decoration: none;}
A:Hover  {text-decoration : none;}
a:visited {  color: #0000FF}
-->
</style>
</head>
<body bgcolor="FFFFFF">
<h1 align="center"><font color="0099FF">【升级操作】</font></h1>
<hr noshade size="1" color=009900>
<p><b>[升级操作完成]</b></p>
<blockquote>
<p>已经成功地将用户 <font color="FF0000"><b><%=upusername%></b></font> 升级,本操作已经记入“聊务公开栏”。</p>
<p><font color="FF0000"><span class="p9"><%=userupgrade%></span></font></p>
<p><a href=javascript:history.go(-2)>【返回级别管理】</a></p>
</blockquote>
<hr noshade size="1" color=009900>
<div align="center" class="p9"><script src="use.asp"></script> <script src="sn.asp"></script><br><script src="copyright.asp"></script></div>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?