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.

193 lines
5.5 KiB

  1. <%@ Language=VBScript %>
  2. <% Option Explicit %>
  3. <%
  4. '-------------------------------------------------------------------------
  5. ' POP3 Mail Add-in - New Domain
  6. ' Copyright (C) Microsoft Corporation. All rights reserved.
  7. '-------------------------------------------------------------------------
  8. %>
  9. <!-- #include virtual="/admin/inc_framework.asp" -->
  10. <!-- #include virtual="/admin/ots_main.asp" -->
  11. <!-- #include file="p3cminc.asp" -->
  12. <%
  13. '-------------------------------------------------------------------------
  14. ' Global Constants
  15. '-------------------------------------------------------------------------
  16. Dim SOURCE_FILE
  17. SOURCE_FILE = SA_GetScriptFileName()
  18. Const FLD_NAME = "fldName"
  19. Const FLD_CREATEUSERS = "fldCreateUsers"
  20. '-------------------------------------------------------------------------
  21. ' Global Variables
  22. '-------------------------------------------------------------------------
  23. Dim g_page
  24. Dim g_strName
  25. '----------------------------------------------------------------------
  26. ' Global Localized Strings
  27. '----------------------------------------------------------------------
  28. Dim l_strPageTitle
  29. l_strPageTitle = GetLocString(RES_DLL_NAME, _
  30. POP3_PAGETITLE_DOMAINS_NEW, _
  31. "")
  32. Dim l_strCaptionName
  33. l_strCaptionName = GetLocString(RES_DLL_NAME, _
  34. POP3_CAPTION_DOMAINS_NEW_NAME, _
  35. "")
  36. Dim l_strCaptionCreateUsers
  37. l_strCaptionCreateUsers = GetLocString(RES_DLL_NAME, _
  38. POP3_CAPTION_DOMAINS_NEW_CREATEUSERS, _
  39. "")
  40. Dim l_strSetAuth
  41. l_strSetAuth = GetLocString ( RES_DLL_NAME, _
  42. POP3_CAPTION_DOMAINS_NEW_SETAUTH, _
  43. "" )
  44. '**********************************************************************
  45. '* E N T R Y P O I N T
  46. '**********************************************************************
  47. Call SA_CreatePage(l_strPageTitle, "", PT_PROPERTY, g_page)
  48. Call SA_ShowPage (g_page)
  49. '**********************************************************************
  50. '* H E L P E R S U B R O U T I N E S
  51. '**********************************************************************
  52. '---------------------------------------------------------------------
  53. ' ServeCommonJavaScript
  54. '---------------------------------------------------------------------
  55. Function ServeCommonJavaScript()
  56. %>
  57. <script language="JavaScript" src="../inc_global.js">
  58. </script>
  59. <script language="JavaScript">
  60. function Init()
  61. {
  62. frmTask.<%= FLD_NAME %>.focus() ;
  63. }
  64. function ValidatePage()
  65. {
  66. return true;
  67. }
  68. function SetData()
  69. {
  70. }
  71. </script>
  72. <%
  73. End Function
  74. '**********************************************************************
  75. '* E V E N T H A N D L E R S
  76. '**********************************************************************
  77. '---------------------------------------------------------------------
  78. ' OnInitPage
  79. '---------------------------------------------------------------------
  80. Public Function OnInitPage(ByRef PageIn, ByRef EventArg)
  81. g_strName = ""
  82. OnInitPage = TRUE
  83. End Function
  84. '---------------------------------------------------------------------
  85. ' OnServePropertyPage
  86. '---------------------------------------------------------------------
  87. Public Function OnServePropertyPage(ByRef PageIn, ByRef EventArg)
  88. On Error Resume Next
  89. OnServePropertyPage = TRUE
  90. '
  91. ' Emit Javascript functions required by Web Framework
  92. Call ServeCommonJavaScript()
  93. %>
  94. <TABLE CLASS="TasksBody" CELLPADDING=0 CELLSPACING=0>
  95. <%
  96. Dim oConfig
  97. Set oConfig = Server.CreateObject("P3Admin.P3Config")
  98. If oConfig.Domains.Count < 1 Then
  99. %>
  100. <tr>
  101. <td colspan="2">
  102. <%= Server.HTMLEncode ( l_strSetAuth ) %>
  103. </td>
  104. </tr>
  105. <tr>
  106. <td colspan="2">&nbsp;</td>
  107. </tr>
  108. <%
  109. End If
  110. %>
  111. <TR>
  112. <TD CLASS="TasksBody">
  113. <%=Server.HTMLEncode(l_strCaptionName)%>
  114. </TD>
  115. <TD CLASS="TasksBody">
  116. <INPUT TYPE="text"
  117. CLASS="FormField"
  118. NAME="<%=FLD_NAME%>"
  119. ID="<%=FLD_NAME%>"
  120. VALUE="<%=Server.HTMLEncode(g_strName)%>"
  121. STYLE="width: 350px"
  122. MAXLENGTH="255">
  123. </TD>
  124. </TR>
  125. </TABLE>
  126. <BR>
  127. <%
  128. If (Err.number <> 0) Then
  129. Call SA_SetErrMsg( HandleUnexpectedError() )
  130. End If
  131. End Function
  132. '---------------------------------------------------------------------
  133. ' OnPostBackPage
  134. '---------------------------------------------------------------------
  135. Public Function OnPostBackPage(ByRef PageIn, ByRef EventArg)
  136. On Error Resume Next
  137. g_strName = Request.Form(FLD_NAME).Item(1)
  138. OnPostBackPage = TRUE
  139. End Function
  140. '---------------------------------------------------------------------
  141. ' OnSubmitPage
  142. '---------------------------------------------------------------------
  143. Public Function OnSubmitPage(ByRef PageIn, ByRef EventArg)
  144. On Error Resume Next
  145. Dim oConfig
  146. Set oConfig = Server.CreateObject("P3Admin.P3Config")
  147. oConfig.Domains.Add(g_strName)
  148. If (Err.number <> 0) Then
  149. Call SA_SetErrMsg( HandleUnexpectedError() )
  150. OnSubmitPage = false
  151. Exit Function
  152. End If
  153. OnSubmitPage = true
  154. End Function
  155. '---------------------------------------------------------------------
  156. ' OnClosePage
  157. '---------------------------------------------------------------------
  158. Public Function OnClosePage(ByRef PageIn, ByRef EventArg)
  159. OnClosePage = TRUE
  160. End Function
  161. %>