📄 checkuser.asp
字号:
<%
dim membername,clsid
membername=session("txlusr")
menberpwd=session("txlpwd")
if membername="" or menberpwd="" then
Errormsg=Errormsg+"<br>"+"<li>对不起,您还没有<a href=login.asp>登录</a>!"
founderror=true
else
set objrs =conn.execute("Select userid,userpwd,locked from student where userid='"&membername&"'")
if objrs.EOF then
Errormsg=Errormsg+"<br>"+"<li>用户名不存在!请先<a href=register.asp>注册</a>。"
founderror=true
elseif menberpwd<>objrs("userpwd") then
Errormsg=Errormsg+"<br>"+"<li>密码错误!"
founderror=true
elseif objrs("locked")=true then
Errormsg=Errormsg+"<br>"+"<li>对不起,您的同学录帐号已被锁定,若有任何问题,请与<a href=mailto:"&SystemEmail&">系统管理员联系</a>!"
founderror=true
end if
set objrs=nothing
end if
if founderror=true then
call disperrs(errormsg)
response.end
end if
function isjoinclass(bisshowerrmsg)
dim tmprs,tmprs1
tmpsql="select classid,status from [student] where userid='"&membername&"'"
set tmprs=conn.execute(tmpsql)
if tmprs("classid")=0 then
Errmsg=Errmsg+"<br>"+"<li>执行非法操作,您还没有加入任何班级!"
founderr=true
else
set tmprs1=conn.execute("select classid from [class] where classid="&tmprs("classid"))
if tmprs1.eof then
Errmsg=Errmsg+"<br>"+"<li>操作失败!您加入的班级不存在或已被删除。"
founderr=true
elseif tmprs("status")=true then
Errmsg=Errmsg+"<br>"+"<li>操作失败!您还没有通过班级管理员的审核。"
founderr=true
end if
set tmprs1=nothing
end if
isjoinclass=not founderr
if founderr=true and bisshowerrmsg=true then
call error(errmsg)
response.end
else
clsid=tmprs("classid")
end if
set tmprs=nothing
end function
function isClassadmin(bshowmsg)
dim tmprs,tmpsql
tmpsql = "Select admin from [class] where classid="&clsid
set tmprs=conn.execute(tmpsql)
if isnull(tmprs("admin")) or tmprs("admin")="" then
Errmsg=Errmsg+"<li>目前本班还没有人申请为班级管理员。"
founderr=true
elseif tmprs("admin")<>membername then
Errmsg=Errmsg+"<li>您不是本班的管理员。"
founderr=true
end if
if founderr=true then
if bshowmsg<>0 then call error(errmsg)
isclassadmin=false
else
isclassadmin=true
end if
end function
function isSystemAdmin(byval bshowmsg)
dim tmprs,tmpsql
tmpsql = "select isadmin from [student] where userid='"&membername&"'"
set tmprs=conn.execute(tmpsql)
if tmprs("isadmin")<>"3" then
Errmsg=Errmsg+"<li>对不起!您不是同学录系统管理员。"
founderr=true
end if
if founderr=true then
if bshowmsg<>0 then call error(errmsg)
isSystemAdmin=false
else
isSystemAdmin=true
end if
end function
sub disperrs(errormsg)
%>
<html><head>
<meta NAME=GENERATOR Content="Microsoft FrontPage 4.0" CHARSET=GB2312>
<title><%=SchoolmateName%>——错误提示</title>
<link rel=stylesheet type=text/css href=txl.css>
</head>
<body alink=#333333 vlink=#333333 link=#333333 topmargin=0>
<br><br>
<table cellpadding=0 cellspacing=0 border=0 width=90% bgcolor=<%=TableborderColor%> align=center>
<tr>
<td>
<table cellpadding=5 cellspacing=1 border=0 width=100%>
<tr align="center">
<td width="100%" bgcolor=<%=TabletitleColor%>><font color="<%=TableFontColor%>"><b>同学录错误信息</b></font></td>
</tr>
<tr>
<td width="100%" bgcolor=<%=TablebodyColor2%>><font color="<%=TableContentColor%>"><br><b>产生错误的可能原因:</b><br><br>
<li>您是否仔细阅读了<a href=help.asp><font color="<%=TableContentColor%>">帮助文件</font></a>
<%=errormsg%><br><br></font>
</td>
</tr>
<tr align="center">
<td width="100%" bgcolor=<%=TabletitleColor%>>
<a href="javascript:history.go(-1)"><font color="<%=TableFontColor%>"> << 返回上一页</font></a>
</td>
</tr>
</table> </td></tr></table>
<!--#INCLUDE FILE="footer.asp" -->
<%
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -