📄 permission.asp
字号:
<!--#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"))
Session("LoginName")=Session("LoginName")
r_Rights=trim(rs("rights"))
Session("UserName")=trim(rs("Name"))
Session("Unit")=rs("Unit")
Session("Department")=rs("Dept")
Session("FGDept")=trim(rs("FGDept"))
Session("ReadAtt")=trim(rs("ReadAtt"))
Session("ZhiBie")=rs("ZhiBie")
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -