Subversion Repositories DevTools

Rev

Rev 187 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 187 Rev 3959
Line 1... Line 1...
1
<%
1
<%
2
'=============================================================
2
'=============================================================
3
'//
3
'//
4
'//                  Access Control
4
'//                  Access Control
5
'//
5
'//
6
'// version:       5.0
-
 
7
'//   last modified:    15-June-2005 14:04 by Sasha Vukovic
-
 
8
'=============================================================
6
'=============================================================
9
%>
7
%>
10
<%
8
<%
11
'--------------- Global Constants ----------------
9
'--------------- Global Constants ----------------
12
Const enumSESSION_TIMEOUT = 200      ' Minutes
10
Const enumSESSION_TIMEOUT = 200      ' Minutes
Line 82... Line 80...
82
      End If
80
      End If
83
 
81
 
84
      IsApplicationRunning = mbIsApplicationRunning
82
      IsApplicationRunning = mbIsApplicationRunning
85
   End Property
83
   End Property
86
 
84
 
-
 
85
   Public Property Get isDevSystem()
-
 
86
      isDevSystem = FALSE
-
 
87
      If OraDatabase.DatabaseName = "RELMANU1" Then isDevSystem = TRUE
-
 
88
   End Property
-
 
89
 
87
   '-----------------------------------------------------------------------------------------------------------------
90
   '-----------------------------------------------------------------------------------------------------------------
88
   Public Function UserApplication ( nAppId )
91
   Public Function UserApplication ( nAppId )
89
      UserApplication = FALSE
92
      UserApplication = FALSE
90
 
93
 
91
      If InStr( sSEPARATOR & Session(enumUSER_APPLICATIONS_SESSION) & sSEPARATOR,  sSEPARATOR & nAppId & sSEPARATOR)  Then
94
      If InStr( sSEPARATOR & Session(enumUSER_APPLICATIONS_SESSION) & sSEPARATOR,  sSEPARATOR & nAppId & sSEPARATOR)  Then
Line 115... Line 118...
115
      Dim tempArr, tempSTR
118
      Dim tempArr, tempSTR
116
 
119
 
117
      tempArr = Split( sString, sSEPARATOR )
120
      tempArr = Split( sString, sSEPARATOR )
118
      tempSTR = Join( Filter( tempArr, sField &"=" ) )   ' Append "=" to field name to get e.g. "user_name="
121
      tempSTR = Join( Filter( tempArr, sField &"=" ) )   ' Append "=" to field name to get e.g. "user_name="
119
 
122
 
120
      Extract = Right( tempSTR, Len(tempSTR) - Len( sField &"=" ))   ' Strip the filed name from value
123
      Extract = Right( tempSTR, Len(tempSTR) - Len( sField &"=" ))   ' Strip the fieled name from value
121
 
124
 
122
   End Function
125
   End Function
123
   '-----------------------------------------------------------------------------------------------------------------
126
   '-----------------------------------------------------------------------------------------------------------------
124
   Private Function GetDataPermission ( sTableName, nRowId, nPermissionType )
127
   Private Function GetDataPermission ( sTableName, nRowId, nPermissionType )
125
      Dim cPermissionValue
128
      Dim cPermissionValue
Line 349... Line 352...
349
            Err.Raise 8, sMessage, ""
352
            Err.Raise 8, sMessage, ""
350
 
353
 
351
         Else
354
         Else
352
 
355
 
353
            ' Proceed with authentication
356
            ' Proceed with authentication
354
            If Authenticated( sUserName, sUserPassword, rsQry("user_password"), "VIX" ) Then
357
            If Authenticated( sUserName, sUserPassword, rsQry("user_password"), rsQry("domain") ) Then
355
               ' Login OK.
358
               ' Login OK.
356
               Call SessionsAndCookieSetup ( rsQry("user_id") )
359
               Call SessionsAndCookieSetup ( rsQry("user_id") )
357
 
360
 
358
               ' Tag user login
361
               ' Tag user login
359
               Call TagLogon ( rsQry )
362
               Call TagLogon ( rsQry )
Line 433... Line 436...
433
      Dim objLoginAuth, return, sMessage
436
      Dim objLoginAuth, return, sMessage
434
      sMessage = NULL
437
      sMessage = NULL
435
 
438
 
436
      Authenticated = FALSE
439
      Authenticated = FALSE
437
 
440
 
-
 
441
      ' Hook for testing access control features
-
 
442
      ' Any login allowed to the Test Database
-
 
443
      '
-
 
444
      If isDevSystem() Then
-
 
445
        Authenticated = TRUE
-
 
446
 
-
 
447
        '-- Login Trail --
-
 
448
        Call LoginTrail ( enumACCESS_MANAGER_EVENT_LOGON_SUCCESS, sUserName, NULL )
-
 
449
 
438
      If NOT IsNull(sDBdomain) Then
450
      ElseIf NOT IsNull(sDBdomain) Then
439
         ' DOMAIN auth.
451
         ' DOMAIN auth.
440
 
452
 
441
         Set objLoginAuth = Server.CreateObject("LoginAdmin.ImpersonateUser")
453
         Set objLoginAuth = Server.CreateObject("LoginAdmin.ImpersonateUser")
442
 
454
 
443
         return = -1
455
         return = -1