?? inc_customer_action.asp
字號:
<!-- #include file = "../inc_action.asp" -->
<%
'===================================================================
'= ASP FILENAME : /inc/inc_action.asp
'= CREATED TIME : 2006-4-17 11:10
'= LAST MODIFIED: 2006-4-17 11:10
'= VERSION INFO : CCASP Framework Ver 2.0.1 ALL RIGHTS RESERVED BY www.cclinux.com
'= DESCRIPTION : Action處理
'= Change Log:
'===================================================================
'====================================================================
'= Function : ActionFilter
'= Time : Created At 2206/05/02
'= Input :
'= Description : 用戶請求校驗與分揀
'= Change Log :
'= 2006-7-20 增加非法字符校驗
'===================================================================
Function ActionFilter(strPageName,strAction)
Dim i
Dim blnAuthFlag : blnAuthFlag = True '== 不需要做權限校驗的頁面
Dim strActionName '== 請求名
Dim strActionFile '== 所屬文件
Dim intActionType '== 請求類型 0--show 1--pure execute
'== 若未加載則需即可加載才能使用
If Application(GBL_strCookieURL & "APP_ConfigLoaded") = "" Or IsNull(Application(GBL_strCookieURL & "APP_ConfigLoaded")) Then
Call LoadParaLogic()
End If
'== 論壇相關
GBL_strForumMasterName = Application(GBL_strCookieURL & "strForumMasterName")
GBL_strForumMasterAccount = Application(GBL_strCookieURL & "strForumMasterAccount")
GBL_strForumMasterId = Application(GBL_strCookieURL & "strForumMasterId")
'== 網站公告
GBL_strWebBoard = Application(GBL_strCookieURL & "APP_strBoard")
GBL_strWebReg = Application(GBL_strCookieURL & "APP_strReg")
GBL_intAlbumMaxSize = Application(GBL_strCookieURL & "APP_intAlbumSize")
'== for cc test
GBL_strUserRole = GBL_strUserAction
If GBL_intUserId = 0 Then
Dim strUser,strPwd
strUser = Trim(Request.Cookies(GBL_strCookieURL)("user"))
strPwd = Trim(Request.Cookies(GBL_strCookieURL)("pass"))
If CheckPass(strUser,strPwd,1) Then
Call ActionOver()
Response.Redirect GBL_strHomeUrl & "user/user_info_show.asp"
Exit Function
Else
'== destory cookie
Response.Cookies(GBL_strCookieURL)("user") = ""
Response.Cookies(GBL_strCookieURL)("pass") = ""
Response.Cookies(GBL_strCookieURL).Expires = Date - 1
If Not ParseActionNoAuth(strAction,strActionName,intActionType,strActionFile) Then
Call ActionOver()
Response.Redirect GBL_strHomeUrl & "user/user_login_form.asp"
Exit Function
End If
End If
End If
'== 更新在線用戶情況
'If Not GetNowOnline() Then
' Exit Function
'End If
'== 不需要做權限校驗的頁面
If Not ParseActionNoAuth(strAction,strActionName,intActionType,strActionFile) Then
blnAuthFlag = True
Else
blnAuthFlag = False
End If
'== 權限校驗
If blnAuthFlag = True Then
If Not ParseAction(strAction,strActionName,intActionType,strActionFile) Then
If GBL_intUserId = 0 Or IsNull(GBL_intUserId) Then '== 未登陸則返回登陸頁
Call ActionOver()
Response.Redirect GBL_strHomeUrl & "user/user_login_form.asp"
Response.End
Exit Function
Else '== 登陸則錯誤提示
Call GBL_objException.catchErr(E_USER_PUB,"該頁面不存在或您沒有訪問權限")
Exit Function
End If
End If
End If
'== 非法數據校驗
If CTL_FORBIDDEN_VALID Then
Call ForSqlForm()
End If
'== 執行邏輯
If intActionType = 1 Then
Call ActionExecute(strAction)
Call ExceptionExecute()
ElseIf intActionType = 0 Then
'== 當頁顯示成功信息模式
If GBL_intSuccType = 3 Then
GBL_strSuccInfoHint = Trim(Request.QueryString("succInfo"))
End If
'== 加載頁面
Call LoadPageTpl()
Call ExceptionExecute()
Else
Call GBL_objException.catchErr(E_USER_PUB,"錯誤的頁面請求")
Exit Function
End If
End Function
'===================================================================
'= Function : ActionAuThenCheck(intAuThen)
'= Time : Created At 2006-5-3
'= Input : None
'= Description : 用戶訪問權限校驗
'===================================================================
Function ActionAuThenCheck(intAuThen)
Dim intAuthenNow
Dim strUser,strPwd
strUser = Trim(Request.Cookies(GBL_strCookieURL)("user"))
strPwd = Trim(Request.Cookies(GBL_strCookieURL)("pass"))
If Not IsEmpty(Session(GBL_strCookieURL & "SEN_strUserAuThen")) Then
If IsNumeric(Session(GBL_strCookieURL & "SEN_strUserAuThen")) Then
intAuthenNow = Cint(Session(GBL_strCookieURL & "SEN_strUserAuThen"))
Else
intAuthenNow = -1
End If
Else
intAuthenNow = -1
End If
'== open for all (include guest)
If intAuThen = 9 Then
If CONST_PAGE_FILE = "user/user_login_form.asp" Or CONST_PAGE_FILE = "user/user_announce.asp" Or CONST_PAGE_FILE = "user/user_reg_form.asp" Then
Exit Function
End If
'== check cookie exsit
If (Not IsEmpty(strUser)) And _
(strUser <> "") And _
Not IsEmpty(strPwd) And _
(strPwd <> "") And _
(IsEmpty(Session(GBL_strCookieURL & "SEN_UserId")) Or _
Session(GBL_strCookieURL & "SEN_UserId") = "") _
Then
If CheckPass(strUser,strPwd,1) Then
Set GBL_objPubDB = Nothing
Response.Redirect GBL_strHomeUrl & "user/user_info_show.asp?action=ShowUserAllInfo"
Exit Function
Else
'== destory cookie
Response.Cookies(GBL_strCookieURL)("user") = ""
Response.Cookies(GBL_strCookieURL)("pass") = ""
Response.Cookies(GBL_strCookieURL).Expires = Date - 1
Set GBL_objPubDB = Nothing
Response.Redirect GBL_strHomeUrl & "user/user_login_form.asp?action=FormUserLogin"
Exit Function
End If
Else
Exit Function
End If
End If
'== check the comm user
If IsEmpty(Session(GBL_strCookieURL & "SEN_strUserRealName")) Or _
IsEmpty(Session(GBL_strCookieURL & "SEN_UserId")) Or _
IsEmpty(Session(GBL_strCookieURL & "SEN_strUserAccount")) Or _
Session(GBL_strCookieURL & "SEN_strUserRealName") = "" Or _
Session(GBL_strCookieURL & "SEN_UserId") = "" Or _
Session(GBL_strCookieURL & "SEN_strUserAccount") = "" Then
If CheckPass(strUser,strPwd,1) Then
Set GBL_objPubDB = Nothing
Response.Redirect GBL_strHomeUrl & "user/user_info_show.asp?action=ShowUserAllInfo"
Exit Function
Else
Set GBL_objPubDB = Nothing
Response.Redirect GBL_strHomeUrl & "user/user_login_form.asp?action=FormUserLogin"
Exit Function
End If
End If
'== check the administrator
If intAuThen = 1 Then
If intAuthenNow <> intAuThen Then
Call ResultExecute(18,"管理員權限","ES_ERR")
Exit Function
End If
End If
End Function
'===================================================================
'= Function : ParseAction
'= Time : Created At 2006-5-3
'= Input : None
'= Description : 解析權限字符串
'===================================================================
Function ParseAction(strNowAction,ByRef strActionName,ByRef intActionType,ByRef strActionFile)
Dim objReg,Matches,strTmp,arrTmp,Item
Dim strActionStr '== 目前的權限校驗字符串
'== 檢驗是否登陸
If GBL_intUserId <> "" And GBL_strUserRole <> "" Then
strActionStr = GBL_strUserRole & "|||"
Else
strActionStr = GBL_strDefaultUserRole & "|||"
End If
Set objReg = new RegExp ' 建立正則表達式
objReg.IgnoreCase = true ' 忽略大小寫
objReg.Global = false ' 設置全局可用
objReg.Pattern = "\|\|\|" & strNowAction & "(.|\n)*?\|\|\|"
Set Matches = objReg.Execute(strActionStr)
strTmp = ""
For Each Item in Matches
strTmp = strTmp & Item.Value
Next
Set objReg = Nothing
Set Matches = Nothing
Set Item = Nothing
If Trim(strTmp) = "" Then
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -