Subversion Repositories DevTools

Rev

Rev 183 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
141 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
Option explicit
4
Response.Expires = 0   ' always load the page, dont store
5
%>
6
<%
7
'=====================================================
8
'               System Unlock Package
9
'=====================================================
10
%>
11
<!--#include file="common/conf.asp"-->
12
<!--#include file="common/globals.asp"-->
13
<!--#include file="common/formating.asp"-->
14
<!--#include file="common/qstr.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/common_dbedit.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_login.asp"-->
21
<!--#include file="_access_control_general.asp"-->
22
<!--#include file="_access_control_project.asp"-->
23
<%
24
'------------ Variable Definition -------------
25
Dim parPv_id
26
Dim QueryString, rsQry
27
'------------ Constants Declaration -----------
28
'------------ Variable Init -------------------
29
parPv_id = QStrPar("pv_id")
30
parRtag_id = QStrPar("rtag_id")
31
'----------------------------------------------
32
%>
33
<%
183 brianf 34
Sub UnlockPackage (bRunAdminTools)
141 ghuddy 35
   Dim objWSH
36
 
37
   OraDatabase.Parameters.Add "PV_ID",   Request("pv_id"),        ORAPARM_INPUT, ORATYPE_NUMBER
38
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
39
 
40
   objEH.TryORA ( OraSession )
41
   On Error Resume Next
42
 
43
   OraDatabase.ExecuteSQL _
44
   "BEGIN  Unlock_Package( :PV_ID, :USER_ID );  END;"
45
 
46
   objEH.CatchORA ( OraSession )
47
 
48
   OraDatabase.Parameters.Remove "PV_ID"
49
   OraDatabase.Parameters.Remove "USER_ID"
50
 
183 brianf 51
   If (objEH.LastOraFailed = FALSE) AND (bRunAdminTools) Then
141 ghuddy 52
      Set objWSH = Server.CreateObject("WScript.Shell")
53
 
54
      objWSH.Run   "cmd.exe /c cscript.exe //B //NoLogo "& rootPath & SCRIPTS_FOLDER &"\Admin_Tools.wsf //job:onMakeUnofficial "&_
55
                  "/pv_id:"& Request("pv_id") , _
56
                  0, FALSE
57
   End If
58
End Sub
59
%>
60
<%
171 brianf 61
 
141 ghuddy 62
'Process submition
63
'---------------------------------------
64
' THIS IS FOR SYSTEM ADMIN ONLY
65
'---------------------------------------
66
QueryString = "SELECT pv.DLOCKED, pv.IS_PATCH FROM PACKAGE_VERSIONS pv WHERE pv.PV_ID = "& parPv_id
67
Set rsQry = OraDatabase.DbCreateDynaset( QueryString, cint(0))
171 brianf 68
Dim bis_patch: bis_patch = Not IsNull(rsQry("is_patch"))
69
Dim spkgtype: spkgtype = iif(bis_patch,"patch","package")
183 brianf 70
Dim bcan_unlock
171 brianf 71
 
183 brianf 72
If bis_patch Then
73
  bcan_unlock = objAccessControl.IsDataActive ("PROJECTS", DB_PROJ_ID, "EditProjects") AND objAccessControl.IsActive("UnlockPatch")
74
Else
75
  bcan_unlock = objAccessControl.IsActive("EditCriticalInfoForLockedPackage")
76
End If
77
 
78
If bcan_unlock  Then
171 brianf 79
  If rsQry("dlocked") = "Y" Then
183 brianf 80
    Call UnlockPackage (bis_patch)
81
    If bis_patch Then
82
      Response.Redirect ("dependencies.asp?rtag_id="& parRtag_id &"&pv_id="& parPv_id)
83
    Else
84
      Response.Redirect ( "fixed_issues.asp?rtag_id="& parRtag_id &"&pv_id="& parPv_id)
85
    End If
171 brianf 86
  Else
87
    Call RaiseMsg(enum_MSG_ERROR, "Can only unlock a " & spkgtype & " that is currently locked." )
88
  End If
141 ghuddy 89
Else
171 brianf 90
  Call RaiseMsg(enum_MSG_ERROR, "You do not have permissions to lock/unlock " & spkgtype & "." )
141 ghuddy 91
End If
171 brianf 92
 
141 ghuddy 93
rsQry.Close
94
Set rsQry = nothing
171 brianf 95
 
141 ghuddy 96
%>
97
 
98
<!-- DESTRUCTOR ------->
99
<!--#include file="common/destructor.asp"-->