| Line 1... |
Line 1... |
| 1 |
<%@LANGUAGE="VBSCRIPT"%>
|
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
| 2 |
<%
|
2 |
<%
|
| 3 |
Option explicit
|
3 |
Option explicit
|
| 4 |
Response.Expires = 0 ' always load the page, dont store
|
4 |
Response.Expires = 0 ' always load the page, dont store
|
| 5 |
%>
|
5 |
%>
|
| 6 |
<%
|
6 |
<%
|
| 7 |
'=====================================================
|
7 |
'=====================================================
|
| 8 |
' Change Owner
|
8 |
' Change Owner
|
| 9 |
'=====================================================
|
9 |
'=====================================================
|
| 10 |
%>
|
10 |
%>
|
| 11 |
<!--#include file="common/conf.asp"-->
|
11 |
<!--#include file="common/conf.asp"-->
|
| 12 |
<!--#include file="common/globals.asp"-->
|
12 |
<!--#include file="common/globals.asp"-->
|
| 13 |
<!--#include file="common/qstr.asp"-->
|
13 |
<!--#include file="common/qstr.asp"-->
|
| Line 29... |
Line 29... |
| 29 |
parPv_id = QStrPar("pv_id")
|
29 |
parPv_id = QStrPar("pv_id")
|
| 30 |
'----------------------------------------------
|
30 |
'----------------------------------------------
|
| 31 |
%>
|
31 |
%>
|
| 32 |
<%
|
32 |
<%
|
| 33 |
Sub Get_Pkg_Info_With_Owner ( NNpv_id )
|
33 |
Sub Get_Pkg_Info_With_Owner ( NNpv_id )
|
| 34 |
Dim rsTemp, Query_String
|
34 |
Dim rsTemp, Query_String
|
| 35 |
|
35 |
|
| 36 |
Query_String = _
|
36 |
Query_String = _
|
| 37 |
" SELECT pkg.pkg_name, pv.pkg_version, pv.owner_id"&_
|
37 |
" SELECT pkg.pkg_name, pv.pkg_version, pv.owner_id"&_
|
| 38 |
" FROM packages pkg, package_versions pv"&_
|
38 |
" FROM packages pkg, package_versions pv"&_
|
| 39 |
" WHERE pkg.pkg_id = pv.pkg_id"&_
|
39 |
" WHERE pkg.pkg_id = pv.pkg_id"&_
|
| 40 |
" AND pv.pv_id = "& NNpv_id
|
40 |
" AND pv.pv_id = "& NNpv_id
|
| 41 |
|
41 |
|
| 42 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
42 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 43 |
|
43 |
|
| 44 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
44 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
| 45 |
pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
|
45 |
pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
|
| 46 |
pkgInfoHash.Add "pkg_version", (rsTemp.Fields("pkg_version"))
|
46 |
pkgInfoHash.Add "pkg_version", (rsTemp.Fields("pkg_version"))
|
| 47 |
pkgInfoHash.Add "owner_id", (rsTemp.Fields("owner_id"))
|
47 |
pkgInfoHash.Add "owner_id", (rsTemp.Fields("owner_id"))
|
| 48 |
End If
|
48 |
End If
|
| 49 |
|
49 |
|
| 50 |
rsTemp.Close
|
50 |
rsTemp.Close
|
| 51 |
Set rsTemp = nothing
|
51 |
Set rsTemp = nothing
|
| 52 |
End Sub
|
52 |
End Sub
|
| 53 |
|
53 |
|
| 54 |
|
54 |
|
| 55 |
Function Users_List ( )
|
55 |
Function Users_List ( )
|
| 56 |
Users_List = _
|
56 |
Users_List = _
|
| 57 |
" SELECT usr.user_id, usr.full_name"&_
|
57 |
" SELECT usr.user_id, usr.full_name"&_
|
| 58 |
" FROM users usr"&_
|
58 |
" FROM users usr"&_
|
| 59 |
" WHERE usr.IS_DISABLED IS NULL"&_
|
59 |
" WHERE usr.IS_DISABLED IS NULL"&_
|
| 60 |
" ORDER BY UPPER(usr.full_name)"
|
60 |
" ORDER BY UPPER(usr.full_name)"
|
| 61 |
End Function
|
61 |
End Function
|
| 62 |
|
62 |
|
| 63 |
Sub Update_Owner ( NNpv_id, NNown_id )
|
63 |
Sub Update_Owner ( NNpv_id, NNown_id )
|
| 64 |
Dim rsTemp, Query_String, sComments, previousOwner, isOfficial
|
64 |
Dim rsTemp, Query_String, sComments, previousOwner, isOfficial
|
| 65 |
Dim objWSH, sPackage
|
65 |
Dim objWSH, sPackage
|
| 66 |
|
66 |
|
| 67 |
|
67 |
|
| 68 |
'-- Get package details
|
68 |
'-- Get package details
|
| 69 |
Query_String = _
|
69 |
Query_String = _
|
| 70 |
" SELECT pv.owner_id, pv.dlocked, pkg.pkg_name, pv.pkg_version"&_
|
70 |
" SELECT pv.owner_id, pv.dlocked, pkg.pkg_name, pv.pkg_version"&_
|
| 71 |
" FROM package_versions pv, packages pkg"&_
|
71 |
" FROM package_versions pv, packages pkg"&_
|
| 72 |
" WHERE pv.pv_id = "& NNpv_id &_
|
72 |
" WHERE pv.pv_id = "& NNpv_id &_
|
| 73 |
" AND pv.pkg_id = pkg.pkg_id"
|
73 |
" AND pv.pkg_id = pkg.pkg_id"
|
| 74 |
|
74 |
|
| 75 |
Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
|
75 |
Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
|
| 76 |
previousOwner = rsTemp.Fields("owner_id").Value
|
76 |
previousOwner = rsTemp.Fields("owner_id").Value
|
| 77 |
|
77 |
|
| 78 |
isOfficial = rsTemp("dlocked")
|
78 |
isOfficial = rsTemp("dlocked")
|
| 79 |
sPackage = rsTemp("pkg_name") &" "& rsTemp("pkg_version")
|
79 |
sPackage = rsTemp("pkg_name") &" "& rsTemp("pkg_version")
|
| 80 |
|
80 |
|
| 81 |
rsTemp.Close
|
81 |
rsTemp.Close
|
| 82 |
Set rsTemp = nothing
|
82 |
Set rsTemp = nothing
|
| 83 |
|
- |
|
| 84 |
|
83 |
|
| 85 |
'-- Update database to change the owner
|
84 |
'-- Update database to change the owner
|
| - |
|
85 |
objEH.TryORA ( OraSession )
|
| 86 |
OraSession.BeginTrans
|
86 |
On Error Resume Next
|
| 87 |
|
87 |
|
| 88 |
OraDatabase.ExecuteSQL _
|
88 |
OraDatabase.ExecuteSQL _
|
| 89 |
" UPDATE PACKAGE_VERSIONS pv SET "&_
|
89 |
" UPDATE PACKAGE_VERSIONS pv SET "&_
|
| 90 |
" pv.owner_id = "& NNown_id &_
|
90 |
" pv.owner_id = "& NNown_id &_
|
| 91 |
" WHERE pv.pv_id = "& NNpv_id
|
91 |
" WHERE pv.pv_id = "& NNpv_id
|
| 92 |
|
92 |
|
| 93 |
OraSession.CommitTrans
|
93 |
objEH.CatchORA ( OraSession )
|
| 94 |
|
- |
|
| 95 |
|
94 |
|
| 96 |
'-- Make dpkg_archive folder writable by all if Unofficial
|
95 |
'-- Make dpkg_archive folder writable by all if Unofficial
|
| - |
|
96 |
If objEH.LastOraFailed = FALSE Then
|
| 97 |
If UCase(isOfficial) = "N" Then
|
97 |
If UCase(isOfficial) = "N" Then
|
| 98 |
|
98 |
|
| 99 |
Set objWSH = Server.CreateObject("WScript.Shell")
|
99 |
Set objWSH = Server.CreateObject("WScript.Shell")
|
| 100 |
|
100 |
|
| 101 |
objWSH.Run "cmd.exe /c cscript.exe //B //NoLogo "& rootPath & SCRIPTS_FOLDER &"\Admin_Tools.wsf //job:onMakeUnofficial "&_
|
101 |
objWSH.Run "cmd.exe /c cscript.exe //B //NoLogo "& rootPath & SCRIPTS_FOLDER &"\Admin_Tools.wsf //job:onMakeUnofficial "&_
|
| 102 |
"/pv_id:"& NNpv_id , _
|
102 |
"/pv_id:"& NNpv_id , _
|
| 103 |
0, FALSE
|
103 |
0, FALSE
|
| 104 |
|
104 |
|
| 105 |
End If
|
105 |
End If
|
| 106 |
|
- |
|
| 107 |
|
106 |
|
| 108 |
'-- Notify new owner
|
107 |
'-- Notify new owner
|
| 109 |
Call Send_Email ( "Release Manager Notification", adminEmail, GetUserEmail( NNown_id ), "You are now the owner of """& sPackage &"""", Empty, NULL )
|
108 |
Call Send_Email ( "Release Manager Notification", adminEmail, GetUserEmail( NNown_id ), "You are now the owner of """& sPackage &"""", Empty, NULL )
|
| 110 |
|
- |
|
| 111 |
|
- |
|
| 112 |
|
109 |
|
| 113 |
'-- Log the change
|
110 |
'-- Log the change
|
| 114 |
sComments = "Changed from "& GetUsername(previousOwner) &" to "& GetUsername(NNown_id)
|
111 |
sComments = "Changed from "& GetUsername(previousOwner) &" to "& GetUsername(NNown_id)
|
| 115 |
call Log_Action ( NNpv_id, "owner_change", sComments )
|
112 |
call Log_Action ( NNpv_id, "owner_change", sComments )
|
| 116 |
|
- |
|
| 117 |
|
113 |
End If
|
| 118 |
End Sub
|
114 |
End Sub
|
| 119 |
%>
|
115 |
%>
|
| 120 |
<%
|
116 |
<%
|
| 121 |
'Process submition
|
117 |
'Process submition
|
| 122 |
If CBool(QStrPar("action")) AND objAccessControl.UserLogedIn Then
|
118 |
If CBool(QStrPar("action")) AND objAccessControl.UserLogedIn Then
|
| 123 |
Call Update_Owner ( parPv_id, Request("own_id") )
|
119 |
Call Update_Owner ( parPv_id, Request("own_id") )
|
| 124 |
|
120 |
|
| 125 |
Call OpenInParentWindow ( "dependencies.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id )
|
121 |
Call OpenInParentWindow ( "dependencies.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id )
|
| 126 |
Call CloseWindow
|
122 |
Call CloseWindow
|
| 127 |
|
123 |
|
| 128 |
End If
|
124 |
End If
|
| 129 |
%>
|
125 |
%>
|
| 130 |
<%
|
126 |
<%
|
| 131 |
Call Get_Pkg_Info_With_Owner ( parPv_id )
|
127 |
Call Get_Pkg_Info_With_Owner ( parPv_id )
|
| 132 |
%>
|
128 |
%>
|
| Line 143... |
Line 139... |
| 143 |
</head>
|
139 |
</head>
|
| 144 |
|
140 |
|
| 145 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
|
141 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
|
| 146 |
<form name="chowner" method="post" action="<%=scriptName%>">
|
142 |
<form name="chowner" method="post" action="<%=scriptName%>">
|
| 147 |
<table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
|
143 |
<table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
|
| 148 |
<tr>
|
144 |
<tr>
|
| 149 |
<td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/i_owner.gif" width="20" height="29" hspace="5"></td>
|
145 |
<td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/i_owner.gif" width="20" height="29" hspace="5"></td>
|
| 150 |
<td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl"> Change Owner</td>
|
146 |
<td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl"> Change Owner</td>
|
| 151 |
<td background="images/lbox_bg_blue.gif" align="right" width="50%">
|
147 |
<td background="images/lbox_bg_blue.gif" align="right" width="50%">
|
| 152 |
<input type="submit" name="btn" value="Update" class="form_btn_comp">
|
148 |
<input type="submit" name="btn" value="Update" class="form_btn_comp">
|
| 153 |
<input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
|
149 |
<input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
|
| 154 |
</td>
|
150 |
</td>
|
| 155 |
<td background="images/lbox_bg_blue.gif" align="right" width="1%%" nowrap>
|
151 |
<td background="images/lbox_bg_blue.gif" align="right" width="1%%" nowrap>
|
| 156 |
<img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
|
152 |
<img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
|
| 157 |
</tr>
|
153 |
</tr>
|
| 158 |
<tr>
|
154 |
<tr>
|
| 159 |
<td height="100%" width="1%"> </td>
|
155 |
<td height="100%" width="1%"> </td>
|
| 160 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
|
156 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
|
| 161 |
<table width="100%" border="0" cellspacing="1" cellpadding="2">
|
157 |
<table width="100%" border="0" cellspacing="1" cellpadding="2">
|
| 162 |
<tr>
|
158 |
<tr>
|
| 163 |
<td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
|
159 |
<td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
|
| 164 |
<td width="1%" nowrap class="form_group" valign="bottom"></td>
|
160 |
<td width="1%" nowrap class="form_group" valign="bottom"></td>
|
| 165 |
<td nowrap width="100%"> </td>
|
161 |
<td nowrap width="100%"> </td>
|
| 166 |
</tr>
|
162 |
</tr>
|
| 167 |
<tr>
|
163 |
<tr>
|
| 168 |
<td width="1%"> </td>
|
164 |
<td width="1%"> </td>
|
| 169 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
|
165 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
|
| 170 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
|
166 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
|
| 171 |
<%=pkgInfoHash.Item ("pkg_name") &" "& pkgInfoHash.Item ("pkg_version")%></td>
|
167 |
<%=pkgInfoHash.Item ("pkg_name") &" "& pkgInfoHash.Item ("pkg_version")%></td>
|
| 172 |
</tr>
|
168 |
</tr>
|
| 173 |
<tr>
|
169 |
<tr>
|
| 174 |
<td width="1%"> </td>
|
170 |
<td width="1%"> </td>
|
| 175 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Owner</td>
|
171 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Owner</td>
|
| 176 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif">
|
172 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif">
|
| 177 |
<select name="own_id" class="form_item">
|
173 |
<select name="own_id" class="form_item">
|
| 178 |
<%
|
174 |
<%
|
| 179 |
Dim rsUsers
|
175 |
Dim rsUsers
|
| 180 |
Set rsUsers = OraDatabase.DbCreateDynaset( Users_List( ), cint(0))
|
176 |
Set rsUsers = OraDatabase.DbCreateDynaset( Users_List( ), cint(0))
|
| 181 |
While ((NOT rsUsers.BOF) AND (NOT rsUsers.EOF))%>
|
177 |
While ((NOT rsUsers.BOF) AND (NOT rsUsers.EOF))%>
|
| 182 |
<option <%If CInt(rsUsers("user_id")) = CInt(pkgInfoHash.Item("owner_id")) Then%>selected<%End If%> value="<%=rsUsers.Fields("user_id")%>"><%=rsUsers.Fields("full_name")%></option>
|
178 |
<option <%If CInt(rsUsers("user_id")) = CInt(pkgInfoHash.Item("owner_id")) Then%>selected<%End If%> value="<%=rsUsers.Fields("user_id")%>"><%=rsUsers.Fields("full_name")%></option>
|
| 183 |
<% rsUsers.MoveNext
|
179 |
<% rsUsers.MoveNext
|
| 184 |
WEnd
|
180 |
WEnd
|
| 185 |
rsUsers.Close
|
181 |
rsUsers.Close
|
| 186 |
set rsUsers = nothing
|
182 |
set rsUsers = nothing
|
| 187 |
%>
|
183 |
%>
|
| 188 |
</select>
|
184 |
</select>
|
| 189 |
<input type="hidden" name="pv_id" value="<%=parPv_id%>">
|
185 |
<input type="hidden" name="pv_id" value="<%=parPv_id%>">
|
| 190 |
<input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
|
186 |
<input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
|
| 191 |
<input type="hidden" name="action" value="true">
|
187 |
<input type="hidden" name="action" value="true">
|
| 192 |
</td>
|
188 |
</td>
|
| 193 |
</tr>
|
189 |
</tr>
|
| 194 |
<tr>
|
190 |
<tr>
|
| 195 |
<td width="1%"> </td>
|
191 |
<td width="1%"> </td>
|
| 196 |
<td width="1%" nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
|
192 |
<td width="1%" nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
|
| 197 |
<td nowrap width="100%">
|
193 |
<td nowrap width="100%">
|
| 198 |
<p> </p>
|
194 |
<p> </p>
|
| 199 |
</td>
|
195 |
</td>
|
| 200 |
</tr>
|
196 |
</tr>
|
| 201 |
</table>
|
197 |
</table>
|
| 202 |
</td>
|
198 |
</td>
|
| Line 213... |
Line 209... |
| 213 |
</body>
|
209 |
</body>
|
| 214 |
</html>
|
210 |
</html>
|
| 215 |
|
211 |
|
| 216 |
|
212 |
|
| 217 |
<!-- DESTRUCTOR ------->
|
213 |
<!-- DESTRUCTOR ------->
|
| 218 |
<!--#include file="common/destructor.asp"-->
|
- |
|
| 219 |
|
214 |
<!--#include file="common/destructor.asp"-->
|
| - |
|
215 |
|