permission.asp

来自「投资管理系统, asp+ mssql server」· ASP 代码 · 共 57 行

ASP
57
字号
<!--#include file="conn.asp"-->
<%
response.expires=-1
session.timeout=1200
if Session("LoginName")="" or Session("LoginOK")=False or Session("Pwd")="" then
	%>
	<!-- #include file="close.asp" -->
	<%
	ErrorMessage="请登录后再维护!"
	response.redirect("index.asp?errormessage="& Server.URLencode(ErrorMessage))
end if

set rs=server.createobject("adodb.recordset")
sql="select * from tblUserLogin where LoginName='" & Session("LoginName")&"'"
rs.open sql,conn,1,1
dim r_Rights,ID
Session("ID")=trim(rs("ID"))
r_Rights=trim(rs("rights"))
Session("UserName")=trim(rs("Name"))
Session("ZhiBie")=rs("ZhiBie")
Session("Unit")=rs("Unit")
Session("Department")=rs("Dept")
Session("FGDept")=trim(rs("FGDept"))
Session("ReadAtt")=trim(rs("ReadAtt"))

if rs.eof then
	rs.close
    Session("LoginName") = ""
	Session("LoginID") = ""
	Session("LoginOK")= false
	Session("Name")= ""
	%>
	<!-- #include file="close.asp" -->
	<%
	response.Redirect "index.asp"
elseif trim(rs("pwd"))<>Session("Pwd") then
	rs.close
    Session("LoginName") = ""
	Session("LoginID") = ""
	Session("LoginOK")= false%>
	<!-- #include file="close.asp" -->
	<%
	ErrorMessage="请输入正确的用户名称和密码。"
	response.redirect("index.asp?errormessage="& Server.URLencode(ErrorMessage))
elseif trim(rs("pwd"))=Session("Pwd") then
	rs.close
	set rs=nothing%>
	<!-- #include file="close.asp" -->
<%
end if
if instr(r_Rights,ThisKey)<1 then
	ErrorMessage="你没有操作这个模块的权限。"
	response.redirect("index.asp?errormessage="& Server.URLencode(ErrorMessage))
end if
%>

⌨️ 快捷键说明

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