Source code of Windows XP (NT5)
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.

574 lines
17 KiB

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4. <% if Session("FONTSIZE") = "" then %>
  5. <!--#include file="iito.inc"-->
  6. <% else %>
  7. <!-- localizable strings for generic wizard functionality -->
  8. <!--#include file="iiwiz.inc"-->
  9. <!--#include file="iiwiz.str"-->
  10. <!-- localizable strings for new node wizard functionality -->
  11. <!--#include file="iiwiznew.inc"-->
  12. <!--#include file="iiwiznew.str"-->
  13. <!-- generic wizard global vars and functions -->
  14. <!--#include file="iiwizfncs.inc"-->
  15. <%
  16. '***************Required custom functions***************
  17. 'this is what happens when you press the finish button...
  18. Function sFinish()
  19. CreateNewNode()
  20. End Function
  21. 'This is a completely poor error handler.
  22. Function sHandleErrors(errnum)
  23. %>
  24. <SCRIPT LANGAUGE="JavaScript">
  25. <% if errnum = &H80005009 then %>
  26. alert("<%= L_DUPLICATEERR %>");
  27. //go back to the nodename page.
  28. <% else %>
  29. alert("<%= L_ERROROCCURED & " " & errnum & "(" & HEX(errnum) & ")" %>");
  30. <% end if %>
  31. </SCRIPT>
  32. <%
  33. End Function
  34. 'Draw our Welcome screen....
  35. Function sWriteWelcome()
  36. Dim sOutputStr
  37. sOutputStr = sFont("4","","",True)
  38. sOutputStr = sOutputStr & "<B>" & L_WELCOME_HEAD & "</B><P>"
  39. sOutputStr = sOutputStr & sFont("","","",True)
  40. sOutputStr = sOutputStr & L_WELCOME1 & "<P>"
  41. sOutputStr = sOutputStr & L_WELCOME2 & "<P>"
  42. sOutputStr = sOutputStr & L_WELCOME3 & "<P>"
  43. sWriteWelcome = sOutputStr
  44. End Function
  45. 'Draw our finish page...
  46. Function sWriteFinish()
  47. Dim sOutputStr
  48. sOutputStr = sFont("2","","",True)
  49. sOutputStr = sOutputStr & "<B>" & L_FINISH_HEAD & "</B><P>"
  50. sOutputStr = sOutputStr & sFont("","","",True)
  51. sOutputStr = sOutputStr & L_FINISH1 & "<P>"
  52. sOutputStr = sOutputStr & L_FINISH2 & "<P>"
  53. sOutputStr = sOutputStr & L_FINISH3 & "<P>"
  54. sWriteFinish = sOutputStr
  55. End Function
  56. 'Draw the title bar that runs across the top of the wizard.
  57. 'This varies based upon the page, but the basic layout is the same.
  58. 'There's a bold title(sHead), a nonbold description(sDescription),
  59. 'and an image (same for all...)
  60. Function sWriteTitle(iThisPage)
  61. Dim sOutputStr, sHead, sDescription, iNodeType,iSiteType
  62. Select Case iThisPage
  63. Case SITETYPE
  64. sHead = L_SITETYPE
  65. sDescription = L_SITETYPE_DESC
  66. Case NODENAME
  67. iNodeType = cInt(Request("NodeType"))
  68. iSiteType = cInt(Request("SiteType"))
  69. Select Case iNodeType
  70. Case SITE
  71. '=== Code Change RWS ==='
  72. 'sHead = SITETYPES(iSiteType) & " " & L_SITE_NODENAME
  73. If iSiteType = WEB Then
  74. sHead = L_WEB_SITE_NODENAME
  75. Else
  76. sHead = L_FTP_SITE_NODENAME
  77. End If
  78. '=== End Code Change RWS ==='
  79. sDescription = L_SITE_NODENAME_DESC
  80. Case VDIR
  81. sHead = L_VDIR_NODENAME
  82. sDescription = L_VDIR_NODENAME_DESC
  83. Case DIR
  84. sHead = L_DIR_NODENAME
  85. sDescription = L_DIR_NODENAME_DESC
  86. End Select
  87. Case BINDINGS
  88. iSiteType = cInt(Request("SiteType"))
  89. sHead = SITETYPES(iSiteType) & " " & L_BINDINGS
  90. sDescription = L_BINDINGS_DESC
  91. Case PATHNAME
  92. sHead = L_PATH
  93. sDescription = L_PATH_DESC
  94. Case ACCESSPERMS
  95. sHead = L_ACCESSPERMS
  96. sDescription = L_ACCESSPERMS_DESC
  97. End Select
  98. sOutputStr = "<TABLE WIDTH = 100% CELLPADDING=0 CELLSPACING=0 border=0>"
  99. sOutputStr = sOutputStr & "<TR>"
  100. sOutputStr = sOutputStr & "<TD WIDTH = 500 ALIGN=left VALIGN=top bgcolor='White'>"
  101. if true then
  102. sOutputStr = sOutputStr & "<TABLE CELLPADDING=0 CELLSPACING=0 border=0>"
  103. sOutputStr = sOutputStr & "<TR>"
  104. sOutputStr = sOutputStr & "<TD COLSPAN = 2 bgcolor='White'><BR>"
  105. sOutputStr = sOutputStr & sFont("","","",True)
  106. sOutputStr = sOutputStr & "<B>" & sHead & "</B>"
  107. sOutputStr = sOutputStr & "</FONT>"
  108. sOutputStr = sOutputStr & "</TD>"
  109. sOutputStr = sOutputStr & "</TR>"
  110. sOutputStr = sOutputStr & "<TR>"
  111. sOutputStr = sOutputStr & "<TD width = 10 bgcolor='White'>&nbsp;</TD>"
  112. sOutputStr = sOutputStr & "<TD bgcolor='White'>"
  113. sOutputStr = sOutputStr & sFont("","","",True)
  114. sOutputStr = sOutputStr & sDescription
  115. sOutputStr = sOutputStr & "</FONT>"
  116. sOutputStr = sOutputStr & "</TD>"
  117. sOutputStr = sOutputStr & "</TR>"
  118. sOutputStr = sOutputStr & "</TABLE>"
  119. else
  120. sOutputStr = sOutputStr & "&nbsp;"
  121. end if
  122. sOutputStr = sOutputStr & "</TD>"
  123. sOutputStr = sOutputStr & "<TD WIDTH = 5>&nbsp;</TD>"
  124. sOutputStr = sOutputStr & "<TD BGCOLOR='Teal' width = 74 ALIGN=right>"
  125. sOutputStr = sOutputStr & "<IMG SRC='images/websitehd.gif' WIDTH=74 HEIGHT=59 border = 0>"
  126. sOutputStr = sOutputStr & "</TD>"
  127. sOutputStr = sOutputStr & "</TR>"
  128. sOutputStr = sOutputStr & "</TABLE>"
  129. sWriteTitle = sOutputStr
  130. End Function
  131. 'Function that acutally draw the main form portion of each page.
  132. Function sWritePage(iThisPage)
  133. '** Debug, disabled for debug only.
  134. On Error Resume Next
  135. Dim sOutputStr, bCanAddSite, isSite, iSiteType, oParentNode, iNodeTypeDefault, sParentKeyType, sNameText
  136. Dim bNeedPath, iNodeType, thispath
  137. thispath = Session("ParentADSPath")
  138. 'This is a bit of a hack to create the dir node, in case it doesn't already have metabase properties associated with it.
  139. 'it assumes currentobj, path and dirkeytype, as it is included in some standard scripts
  140. 'where these are already defined.
  141. Dim currentobj, path, dirkeytype
  142. path = thispath
  143. dirkeytype = sGetKeyType(fixSiteType(Session("stype")), DIR)
  144. set currentobj = GetObject(thispath)
  145. %> <!--#include file="iifixpth.inc"--><%
  146. err.clear
  147. 'Find out some info about what we are adding, so we can display the
  148. 'appropriate pages/ask the appropriate qs
  149. set oParentNode = GetObject(thispath)
  150. sParentKeyType = UCase(oParentNode.KeyType)
  151. 'Response.write sParentKeyType
  152. 'You can't add a Site to a Vdir or Dir... so don't put a radio button for it...
  153. bCanAddSite = InStr(sParentKeyType,"DIR") = 0
  154. isSite = (Request("NodeType") = cStr(SITE) or (Request("NodeType") = "" and bCanAddSite))
  155. iSiteType = iGetSiteType(oParentNode.ADsPath,sParentKeyType)
  156. bNeedPath = isSite or (Request("NodeType") = cStr(VDIR))
  157. sOutputStr = sOutputStr & "<TABLE CELLPADDING = 0 CELLSPACING=0 >"
  158. sOutputStr = sOutputStr & "<TR>"
  159. sOutputStr = sOutputStr & "<TD WIDTH = 10>&nbsp;</TD>"
  160. sOutputStr = sOutputStr & "<TD>"
  161. sOutputStr = sOutputStr & "<TABLE CELLPADDING = 0 CELLSPACING=0>"
  162. sOutputStr = sOutputStr & "<TR>"
  163. sOutputStr = sOutputStr & "<TD>&nbsp;"
  164. sOutputStr = sOutputStr & "</TD>"
  165. sOutputStr = sOutputStr & "</TR>"
  166. 'Draw the actual wizard form pages...
  167. Select Case iThisPage
  168. Case SITETYPE
  169. 'We do some trickiness here to determine what page comes next...
  170. 'Admins vs operators will get different options,
  171. 'and depending on the parent type selected, different options will appear.
  172. if not Session("isAdmin") then
  173. Set oParentNode = GetObject(oParentNode.ADsPath & ROOT)
  174. sOutputStr = sOutputStr & sStaticText(L_DIRONLY,not BOLD)
  175. sOutputStr = sOutputStr & sStaticText(oParentNode.Path, BOLD)
  176. sOutputStr = sOutputStr & sHidden("NodeType",DIR)
  177. sOutputStr = sOutputStr & sHidden("SiteType",iSiteType)
  178. else
  179. if InStr(sParentKeyType, COMP) then
  180. sOutputStr = sOutputStr & sRadio("SiteType", WEB, L_WEBSITE, WEB, "")
  181. sOutputStr = sOutputStr & sRadio("SiteType", FTP, L_FTPSITE, WEB, "")
  182. sOutputStr = sOutputStr & sHidden("NodeType",SITE)
  183. else
  184. iNodeTypeDefault = 1
  185. if bCanAddSite then
  186. iNodeTypeDefault = 0
  187. sOutputStr = sOutputStr & sRadio("NodeType", SITE, SITETYPES(iSiteType) & " " & L_SITE, iNodeTypeDefault, "")
  188. end if
  189. sOutputStr = sOutputStr & sRadio("NodeType", VDIR, L_VDIR, iNodeTypeDefault, "")
  190. if iSitetype <> FTP then
  191. sOutputStr = sOutputStr & sRadio("NodeType", DIR, L_DIR, iNodeTypeDefault, "")
  192. end if
  193. sOutputStr = sOutputStr & sHidden("SiteType",iSiteType)
  194. end if
  195. end if
  196. Case NODENAME
  197. iNodeType = cInt(Request("NodeType"))
  198. iSiteType = cInt(Request("SiteType"))
  199. 'set the titles/skip pages as appropriate...
  200. Select Case iNodeType
  201. Case SITE
  202. '=== Code Change RWS ==='
  203. 'sNameText = SITETYPES(iSiteType) & " " & L_WEB_SITE_NAME
  204. If iSiteType = WEB Then
  205. sNameText = L_WEB_SITE_NAME
  206. Else
  207. sNameText = L_FTP_SITE_NAME
  208. End If
  209. '=== End Code Change RWS ==='
  210. iNextPage = BINDINGS
  211. if Instr(oParentNode.KeyType,SVC) = 0 then
  212. set oParentNode = GetObject(BASEPATH & SERVICES(iSiteType))
  213. end if
  214. Case VDIR
  215. sNameText = L_VDIR_NAME
  216. iNextPage = PATHNAME
  217. if Instr(oParentNode.KeyType,SSITE) <> 0 then
  218. set oParentNode = GetObject(oParentNode.ADsPath & ROOT)
  219. end if
  220. Case DIR
  221. sNameText = L_DIR_NAME
  222. iNextPage = ACCESSPERMS
  223. if Instr(oParentNode.KeyType,SSITE) <> 0 then
  224. set oParentNode = GetObject(oParentNode.ADsPath & ROOT)
  225. end if
  226. End Select
  227. sOutputStr = sOutputStr & sTextBox("NodeName", sNameText, 40, "")
  228. sOutputStr = sOutputStr & sHidden("hdnParentADsPath", oParentNode.ADsPath)
  229. sOutputStr = sOutputStr & sHidden("hdnINodeType", iNodeType)
  230. Case BINDINGS
  231. sOutputStr = sOutputStr & sTextBox("IPAddress", L_SELECTIP, 25, "")
  232. if iSiteType = WEB then
  233. sOutputStr = sOutputStr & sTextBoxwDefault("TCPPort", L_ENTERTCP, 5, "", "", CStr(WEBTCPDEFAULT))
  234. sOutputStr = sOutputStr & sTextBox("SSLPort", L_ENTERSSL, 5, "")
  235. else
  236. sOutputStr = sOutputStr & sTextBoxwDefault("TCPPort", L_ENTERTCP, 5, "", "", CStr(FTPTCPDEFAULT))
  237. end if
  238. Case PATHNAME
  239. sOutputStr = sOutputStr & sTextBox("VRPath", L_ENTERPATH, 40, "")
  240. sOutputStr = sOutputStr & "<TR><TD ALIGN='right'><INPUT TYPE='Button' VALUE='" & L_BROWSE & "' onClick='setPath(document.userform.VRPath);'></TD></TR>"
  241. if iSiteType = WEB then
  242. sOutputStr = sOutputStr & sCheckBox("AllowAnon", L_ALLOWANON)
  243. end if
  244. if not isSite then
  245. iPrevPage = NODENAME
  246. end if
  247. Case ACCESSPERMS
  248. sOutputStr = sOutputStr & sCheckBox("AllowRead", L_ALLOWREAD)
  249. sOutputStr = sOutputStr & sCheckBox("AllowWrite", L_ALLOWWRITE)
  250. if iSiteType = WEB then
  251. sOutputStr = sOutputStr & sCheckBox("AllowScript", L_ALLOWSCRIPT)
  252. sOutputStr = sOutputStr & sCheckBox("AllowExecute", L_ALLOWEXECUTE)
  253. sOutputStr = sOutputStr & sCheckBox("AllowDirBrowsing", L_ALLOWDIRBROWSING)
  254. if isSite then
  255. sOutputStr = sOutputStr & sCheckBox("AllowRemote", L_ALLOWREMOTE)
  256. end if
  257. end if
  258. if bNeedPath then
  259. iPrevPage = PATHNAME
  260. else
  261. iPrevPage = NODENAME
  262. end if
  263. End Select
  264. sOutputStr = sOutputStr + "</TABLE>"
  265. sOutputStr = sOutputStr & "</TD>"
  266. sOutputStr = sOutputStr & "</TR>"
  267. sOutputStr = sOutputStr & "</TABLE>"
  268. sWritePage = sOutputStr
  269. End Function
  270. %>
  271. <!--***************Optional Custom Functions***************-->
  272. <!--#include file="iiwiznew.fnc"-->
  273. <!--***************End***************-->
  274. <html>
  275. <head>
  276. <title><%= L_WIZARD_TEXT %></title>
  277. <% if Session("canBrowse") then %>
  278. <SCRIPT SRC="JSDirBrowser/JSBrowser.js">
  279. </SCRIPT>
  280. <SCRIPT LANGUAGE="JavaScript">
  281. //pop-up browse dialog... initialize the object.
  282. JSBrowser = new BrowserObj(null,false,TDIR,<%= Session("FONTSIZE") %>);
  283. function setPath(cntrl){
  284. JSBrowser = new BrowserObj(cntrl,POP,TDIR,<%= Session("FONTSIZE") %>);
  285. }
  286. function chkPath(pathCntrl)
  287. {
  288. if (pathCntrl.value != "")
  289. {
  290. top.connect.location.href = "iichkpath.asp?path=" + escape(pathCntrl.value) +
  291. "&onfail=" + "top.main.failPath();" +
  292. "&donext=" + "top.main.doNext();"
  293. ;
  294. }
  295. }
  296. function failPath()
  297. {
  298. document.userform.iThisPage.value = <%= PATHNAME %>;
  299. document.userform.submit();
  300. }
  301. function chkForDupeName(parentpath,nameCntrl,iNodeType)
  302. {
  303. var path = "iichknname.asp?ppath=" + escape(parentpath) +
  304. "&nname=" + escape(nameCntrl.value) +
  305. "&cntrl=" + "top.main.document.userform." + nameCntrl.name +
  306. "&nntype=" + iNodeType +
  307. "&onfail=" + "top.main.failName();" +
  308. "&donext=" + "top.main.doNextName();"
  309. ;
  310. top.connect.location.href = path
  311. }
  312. function failName()
  313. {
  314. document.userform.iThisPage.value = <%= NODENAME %>
  315. document.userform.submit();
  316. self.focus();
  317. }
  318. function doNext()
  319. {
  320. document.userform.iThisPage.value = <%= iNextPage %>;
  321. document.userform.submit();
  322. }
  323. function doNextName()
  324. {
  325. var iNextPage;
  326. iNextPage = <%= iNextPage %>;
  327. <% if iThisPage = NODENAME then %>
  328. <% Select Case CInt(Request("NodeType"))
  329. Case SITE %>
  330. iNextPage = <%= BINDINGS %>;
  331. <% Case VDIR %>
  332. iNextPage = <%= PATHNAME %>;
  333. <% Case DIR %>
  334. iNextPage = <%= ACCESSPERMS %>;
  335. <% End Select %>
  336. <% end if %>
  337. document.userform.iThisPage.value = iNextPage;
  338. document.userform.submit();
  339. }
  340. function publicNewWizardObject()
  341. {
  342. this.chkForDupeName = chkForDupeName;
  343. this.failName = failName;
  344. }
  345. publicNewWizard = new publicNewWizardObject();
  346. //validate each page, based upon what page we are on...
  347. function bNextPageOk()
  348. {
  349. <%
  350. Select Case iThisPage
  351. Case NODENAME
  352. %>
  353. if (document.userform.NodeName.value == "")
  354. {
  355. alert("<%= L_NONAME_ERR %>");
  356. return false;
  357. }
  358. chkForDupeName(document.userform.hdnParentADsPath.value,document.userform.NodeName,document.userform.hdnINodeType.value);
  359. return false;
  360. <%
  361. Case BINDINGS
  362. %>
  363. if (document.userform.TCPPort.value == "")
  364. {
  365. alert("<%= L_NOPORT_ERR %>");
  366. return false;
  367. }
  368. <%
  369. Case PATHNAME
  370. %>
  371. if (document.userform.VRPath.value == "")
  372. {
  373. alert("<%= L_NOPATH_ERR %>");
  374. return false;
  375. }
  376. chkPath( document.userform.VRPath );
  377. return false;
  378. <%
  379. End Select
  380. %>
  381. return true;
  382. }
  383. </SCRIPT>
  384. <% end if %>
  385. </head>
  386. <!-- MAIN HTML -->
  387. <body bgcolor="<%= Session("BGCOLOR") %>" topmargin=0 leftmargin=0>
  388. <% if Session("IsIE") and Session("browserver") < 4 then %>
  389. <table width="100%" height=100% cellpadding=0 cellspacing=0 Border=1>
  390. <% else %>
  391. <table width="100%" height=100% cellpadding=0 cellspacing=0 Border=0>
  392. <% end if %>
  393. <form name="userform" method="POST" action="iiwiznew.asp">
  394. <!-- data persistences -->
  395. <!--#include file="iiwiznew.dat"-->
  396. <!-- end data persistences -->
  397. <% Select Case iThisPage %>
  398. <% Case WELCOME %>
  399. <tr>
  400. <td bgcolor="teal" height=310 width = 163>
  401. <IMG SRC="images/Website.gif" WIDTH=163 HEIGHT=312>
  402. </td>
  403. <td bgcolor="White" ALIGN=left VALIGN=top>
  404. <TABLE CELLPADDING = 2 CELLSPACING=0 >
  405. <TR>
  406. <TD COLSPAN = 2>&nbsp;
  407. </TD>
  408. </TR>
  409. <TR>
  410. <TD WIDTH = 18>&nbsp;
  411. </TD>
  412. <TD>
  413. <%= sWriteWelcome() %>
  414. </TD>
  415. </TR>
  416. </TABLE>
  417. </td>
  418. </tr>
  419. <% Case FINISH %>
  420. <tr>
  421. <td height=315 width = 164><IMG SRC="images/website.gif" BORDER=0 HSPACE=0 VSPACE=0></td>
  422. <td bgcolor="White" ALIGN=left VALIGN=top>
  423. <TABLE CELLPADDING = 2 CELLSPACING=0>
  424. <TR>
  425. <TD COLSPAN = 2>&nbsp;
  426. </TD>
  427. </TR>
  428. <TR>
  429. <TD WIDTH = 18>&nbsp;
  430. </TD>
  431. <TD>
  432. <%= sFinish() %>
  433. <%= sWriteFinish() %>
  434. </TD>
  435. </TR>
  436. </TABLE>
  437. </td>
  438. </tr>
  439. <% Case Else %>
  440. <tr>
  441. <TD HEIGHT=315 COLSPAN = 2 VALIGN="top">
  442. <TABLE WIDTH = 100% cellspacing=0 cellpadding=0 cellspacing=0>
  443. <tr bgcolor="#FFFFFF">
  444. <td bgcolor="#FFFFFF" width = 10>&nbsp;</td>
  445. <td bgcolor="#FFFFFF" height = 59 ALIGN=left VALIGN=top>
  446. <%= sWriteTitle(iThisPage) %>
  447. </td>
  448. </tr>
  449. <tr>
  450. <td height = 1 colspan = 2 bgcolor="Gray"></td>
  451. </tr>
  452. <tr>
  453. <td height = 1 colspan = 2 bgcolor="White"></td>
  454. </tr>
  455. <tr>
  456. <td>&nbsp;</td>
  457. <td height=220 ALIGN=left VALIGN=top>
  458. <%= sWritePage(iThisPage) %>
  459. </td>
  460. </tr>
  461. </TABLE>
  462. </TD>
  463. </TR>
  464. <% end Select %>
  465. <% if Session("IsIE") and Session("browserver") < 4 then %>
  466. <% ' IE3 doesn't do the line well... we're using table-borders instead. %>
  467. <% else %>
  468. <tr>
  469. <td height = 1 colspan = 2 bgcolor="Gray"></td>
  470. </tr>
  471. <tr>
  472. <td height = 1 colspan = 2 bgcolor="White"></td>
  473. </tr>
  474. <% end if %>
  475. <!-- generic wizard buttons -->
  476. <!--#include file="iiwizbtns.inc"-->
  477. </table>
  478. </blockquote>
  479. </form>
  480. </body>
  481. </html>
  482. <% end if %>