📄 popedom_process.asp
字号:
<%
Option Explicit
'----------------------------------------------------------------------------------
'本页:
' 权限处理页面
'说明:
'
'----------------------------------------------------------------------------------
%>
<!--#include file="inc/Config.class.asp"-->
<!--#include file="inc/DBControl.class.asp"-->
<!--#include file="inc/FunctionLib.class.asp"-->
<!--#include file="inc/Manager.class.asp"-->
<!--#include file="inc/md5.asp"-->
<%
Dim Cfg, Db, FLib, Admin
Set Cfg = New Config
Set Db = New DBControl
Set FLib = New FunctionLib
Set Admin = New Manager
If Not Admin.Logined Then
FLib.Alert "对不起,你已经超时或未登录","./",1
Response.End
End If
If Not Admin.CheckPopedom("TSYS_GROUP3_POPEDOM") Then
FLib.Alert "权限不足", "BACK", 0
Response.End
ENd If
Db.Open()
Dim Work
Work = Request("Work")
'选择执行操作
Select Case Work
Case "MdyReco"
MdyReco()
Case "AddReco"
AddReco()
Case "DeleteReco"
DeleteReco()
End Select
'函数:增加记录
Function AddReco()
Dim parent, title, pope_key, remark, show, show_order
parent = FLib.SafeSql(Request("parent"))
title = FLib.SafeSql(Request("title"))
pope_key = UCase(FLib.SafeSql(Request("pope_key")))
remark = FLib.SafeSql(Request("remark"))
show = FLib.SafeSql(Request("show"))
show_order = FLib.SafeSql(Request("show_order"))
If Not FLib.Check_PopedomKey(pope_key) Then
FLib.Alert "权限标识格式有误","BACK",0
Response.End
End If
Dim Sql, Rs
Sql = "SELECT TOP 1 * FROM popedom_list WHERE pope_key='" & pope_key & "'"
Set Rs = Db.ExeCute(Sql)
If Not (Rs.Eof And Rs.Bof) Then
Rs.Close
Set Rs = Nothing
FLib.Alert "权限标识已经存在","BACK",0
Response.End
End If
Sql = "INSERT INTO popedom_list (parent, title, pope_key, remark, show, show_order, creator, owner, addtime)VALUES(" & parent & ", '" & title & "', '" & pope_key & "', '" & remark & "', " & show & ", " & show_order & ", '" & Admin.UserName & "', 2, GETDATE())"
Db.ExeCute(Sql)
FLib.AddLog "增加权限:" & title & ",键值为:" & pope_key
FLib.Alert "执行完毕","BACK",0
Response.End
End Function
'函数:修改记录
Function MdyReco()
Dim rId, parent, title, pope_key, remark, show, show_order
rId = FLib.SafeSql(Request("rId"))
parent = FLib.SafeSql(Request("parent"))
title = FLib.SafeSql(Request("title"))
pope_key = UCase(FLib.SafeSql(Request("pope_key")))
remark = FLib.SafeSql(Request("remark"))
show = FLib.SafeSql(Request("show"))
show_order = FLib.SafeSql(Request("show_order"))
If Not FLib.Check_PopedomKey(pope_key) Then
FLib.Alert "权限标识格式有误","BACK",0
Response.End
End If
Dim Sql, Rs
Sql = "SELECT TOP 1 * FROM popedom_list WHERE pope_key='" & pope_key & "' AND id<>" & rId
Set Rs = Db.ExeCute(Sql)
If Not (Rs.Eof And Rs.Bof) Then
Rs.Close
Set Rs = Nothing
FLib.Alert "权限标识已经存在","BACK",0
Response.End
End If
Sql = "UPDATE popedom_list SET parent=" & parent & ", title='" & title & "', pope_key='" & pope_key & "', remark='" & remark & "', show=" & show & ", show_order=" & show_order & " WHERE owner<>1 AND id=" & rId
Db.ExeCute(Sql)
FLib.AddLog "修改Id为:" & rId & "的权限"
FLib.Alert "执行完毕","BACK",0
Response.End
End Function
'函数:删除记录
Function DeleteReco()
Dim IdList
IdList = FLib.SafeSql(Request("IdList"))
If IdList = "" Then
Exit Function
End If
Dim arrIdList, I, Sql, Rs
arrIdList = Split(IdList, ",")
For I=0 To UBound(arrIdList)
Sql = "SELECT Top 1 * FROM popedom_list WHERE parent=" & arrIdList(I)
Set Rs = Db.ExeCute(Sql)
If Rs.Eof And Rs.Eof Then
Sql = "DELETE FROM popedom_list WHERE owner<>1 AND id = " & arrIdList(I)
Db.ExeCute(Sql)
End If
Next
FLib.AddLog "删除权限,Id:" & IdList
FLib.Alert "执行完毕","BACK",0
Response.End
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -