Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

224 lines
6.4 KiB

  1. <%@ Language=VBScript %>
  2. <% Option Explicit %>
  3. <% '------------------------------------------------------------------------
  4. ' nfsclientgroup_delete.asp : Deletes the selected nfs Client Group
  5. '
  6. ' Copyright (c) Microsoft Corporation. All rights reserved.
  7. '
  8. ' Date Description
  9. ' 22-09-2000 Created date
  10. '--------------------------------------------------------------------
  11. %>
  12. <!-- #include virtual="/admin/inc_framework.asp" -->
  13. <!-- #include file="loc_NFSSvc.asp" -->
  14. <!-- #include file="inc_NFSSvc.asp" -->
  15. <%
  16. Err.Clear
  17. On Error Resume Next
  18. '-------------------------------------------------------------------------
  19. ' Form Variables
  20. '-------------------------------------------------------------------------
  21. Dim F_CllientGroupName 'The nfs Clientgroup name as displayed to the user
  22. '-------------------------------------------------------------------------
  23. ' Create the page and Event handler
  24. '-------------------------------------------------------------------------
  25. Dim page
  26. Dim rc
  27. rc = SA_CreatePage(L_TASKTITLE_DELETE_TEXT, "", PT_PROPERTY, page)
  28. If rc = 0 Then
  29. SA_ShowPage( page )
  30. End If
  31. Public Function OnInitPage( ByRef PageIn, ByRef EventArg)
  32. SetVariablesFromSystem
  33. OnInitPage = True
  34. End Function
  35. Public Function OnPostBackPage( ByRef PageIn, ByRef EventArg)
  36. SetVariablesFromForm
  37. OnPostBackPage = True
  38. End Function
  39. Public Function OnServePropertyPage( ByRef PageIn, ByRef EventArg)
  40. Call ServeCommonJavaScript()
  41. %>
  42. <TABLE WIDTH=518 VALIGN=middle ALIGN=left BORDER=0 CELLSPACING=0
  43. CELLPADDING=2>
  44. <tr>
  45. <td class="TasksBody">
  46. <%=Server.HTMLEncode(SA_GetLocString("nfssvc.dll","&H40370076",Array(F_CllientGroupName)))%>
  47. </td>
  48. </tr>
  49. </TABLE>
  50. <input TYPE="hidden" NAME="hdnClientGroupName" VALUE="<%=server.HTMLEncode(F_CllientGroupName) %>">
  51. <%
  52. OnServePropertyPage = True
  53. End Function
  54. Public Function OnSubmitPage( ByRef PageIn, ByRef EventArg)
  55. OnSubmitPage = deleteNfsClientGroup()
  56. End Function
  57. Public Function OnClosePage( ByRef PageIn, ByRef EventArg)
  58. OnClosePage = True
  59. End Function
  60. Function ServeCommonJavaScript()
  61. %>
  62. <script language = "JavaScript" src = "<%=m_VirtualRoot%>inc_global.js">
  63. </script>
  64. <script language = "JavaScript">
  65. function Init()
  66. {
  67. document.frmTask.action = location.href
  68. EnableCancel();
  69. }
  70. function ValidatePage()
  71. {
  72. return true;
  73. }
  74. function SetData()
  75. {
  76. }
  77. </script>
  78. <%
  79. End Function
  80. '----------------------------------------------------------------------
  81. 'Function name: SetVariablesFromSystem
  82. 'Description: Getting the data from system
  83. 'Input Variables: None
  84. 'Output Variables: None
  85. 'Returns: None
  86. 'Global Variables: None
  87. ' In :F_CllientGroupName- Nfs ClientGroup Name
  88. ' Out:F_CllientGroupName
  89. '------------------------------------------------------------------------
  90. Function SetVariablesFromSystem
  91. Err.Clear
  92. On Error Resume Next
  93. Dim StrClientGroupName
  94. ' Nfs ClientGroupName is obtained from QueryString
  95. StrClientGroupName= Request.QueryString("Pkey")
  96. F_CllientGroupName=StrClientGroupName
  97. If F_CllientGroupName = "" OR Err.Number <> 0 Then
  98. SA_ServeFailurePage L_PROPERTYNOTRETRIEVED_ERRORMESSAGE
  99. End if
  100. ' handing over the NfsClientGroup Name to display as a header
  101. 'mstrPageTitle = F_CllientGroupName
  102. End Function
  103. '-------------------------------------------------------------------------
  104. 'Function name: SetVariablesFromForm
  105. 'Description: Getting the data from Client
  106. 'Input Variables: None
  107. 'Output Variables: None
  108. 'Returns: None
  109. 'Global Variables: None
  110. ' Out:F_CllientGroupName
  111. 'Nfs ClientGroup Name
  112. '--------------------------------------------------------------------------
  113. Function SetVariablesFromForm
  114. Err.Clear
  115. On Error Resume Next
  116. 'Get Nfs ClientGroup Name from the hidden values of form
  117. F_CllientGroupName = Request.Form("hdnClientGroupName")
  118. 'Handing over the Nfs ClientGroup Name to display as a header
  119. mstrPageTitle = F_CllientGroupName
  120. End Function
  121. '-------------------------------------------------------------------------
  122. 'Function name: deleteNfsClientGroup()
  123. 'Description: Serves in Deleting the Nfs ClientGroup
  124. 'Input Variables: None
  125. 'Output Variables: None
  126. 'Returns: True if Client Group is deleted else False
  127. 'Global Variables: In:L_(*)-localization variables
  128. ' In:F_(*)-Form variables
  129. '-------------------------------------------------------------------------
  130. Function deleteNfsClientGroup
  131. 'Err.Clear
  132. 'On Error Resume Next
  133. Dim nRetValue
  134. Dim nRetError
  135. nRetError = 0
  136. nRetValue = NFS_DeleteGroup( F_CllientGroupName )
  137. if Err.number<>0 then
  138. SA_ServeFailurePage L_FAILEDTOREMOVECLIENTGROUP_ERRORMESSAGE
  139. deleteNfsClientGroup=false
  140. Exit Function
  141. else
  142. deleteNfsClientGroup=true
  143. end if
  144. deleteNfsClientGroup = HandleError( nRetValue )
  145. End function
  146. '-------------------------------------------------------------------------
  147. 'Function name: ValidGroup()
  148. 'Description: Serves in Checking for whether that client Group
  149. ' is existing or not
  150. 'Input Variables: GroupName
  151. 'Output Variables: None
  152. 'Returns: True if Client Group is Existing else False
  153. 'Global Variables: In:L_(*)-localization variables
  154. ' In:F_(*)-Form variables
  155. '-------------------------------------------------------------------------
  156. Function ValidGroup(GroupName)
  157. Err.Clear
  158. On Error Resume Next
  159. Dim ObjClientGroups
  160. Dim intGroup
  161. Dim intGroupsCount
  162. 'Taking Nfs related object instance
  163. set ObjClientGroups=Server.CreateObject("CliGrpEnum.1")
  164. 'If instance of this object fails, display message
  165. If Err.number<>0 then
  166. SA_ServeFailurePage L_FAILEDTOCREATEOBJECT_ERRORMESSAGE
  167. End IF
  168. ObjClientGroups.machine = GetComputerName()
  169. ObjClientGroups.ReadClientGroupsReg()
  170. ObjClientGroups.mode = 1
  171. intGroupsCount=ObjClientGroups.grpCount
  172. ObjClientGroups.moveFirst()
  173. 'check for the group already exists
  174. For intGroup = 0 to Cint(intGroupsCount)-1
  175. if Ucase(GroupName)=Ucase(ObjClientGroups.grpName) then
  176. ValidGroup=true
  177. Exit Function
  178. End if
  179. ObjClientGroups.moveNext()
  180. next
  181. ValidGroup=false
  182. set ObjClientGroups = nothing
  183. End Function
  184. %>