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.

115 lines
3.4 KiB

  1. <%
  2. function getBinding(bindstr)
  3. Dim one, two, ia, ip, hn
  4. one=Instr(bindstr,":")
  5. two=Instr((one+1),bindstr,":")
  6. ia=Mid(bindstr,1,(one-1))
  7. ip=Mid(bindstr,(one+1),((two-one)-1))
  8. hn=Mid(bindstr,(two+1))
  9. getBinding=Array(ia,ip,hn)
  10. end function
  11. ' Boolean value used only by iivs.asp (Web sites)
  12. Dim multibind
  13. ' Included in iivs.asp (web) and iifvs.asp (ftp)
  14. '
  15. ' function writeBinding
  16. '
  17. ' Writes out the controls that display the service/sites IP and Port information.
  18. ' This function is shared by both web and ftp sites
  19. '
  20. ' DEFAULTPORT - defined differently by iivs.asp and iifvs.asp
  21. ' currentobj - initialized in iivs.asp and iifvs.asp
  22. ' Session("vtype") = "svc" - indicates that we are looking at the master properties
  23. '
  24. function writeBinding(fieldname,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly)
  25. On Error Resume Next
  26. ' Common binding declarations - Web and Ftp sites
  27. Dim aBinding, Binding, host, ipport, ipaddress, readonly
  28. ' Secure binding definitions - Ftp sites only
  29. Dim aSecBinding, SecBinding, secport, j
  30. ' Get the bindings from our current object and set any defaults if necessary
  31. aBinding=currentobj.ServerBindings
  32. if Session("vtype") = "svc" then
  33. multibind = false
  34. readonly = true
  35. Binding=split(aBinding(0),":")
  36. else
  37. if aBinding(0) <> "" then
  38. multibind=(UBound(aBinding)>0)
  39. readonly = multibind
  40. Binding=split(aBinding(0),":")
  41. else
  42. readonly=false
  43. aBinding(0)=":" & DEFAULTPORT & ":"
  44. Binding=split(aBinding(0),":")
  45. end if
  46. end if
  47. ' Write out the binding for a specific fieldname
  48. if fieldname="Host" then
  49. host=Binding(2)
  50. if readonly then
  51. writeBinding=host & inputbox(err,"hidden","hdnHost",host,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  52. else
  53. writeBinding=inputbox(err,"hidden","hdnHost",host,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  54. end if
  55. elseif fieldname="IPPort" then
  56. ipport=Binding(1)
  57. if readonly then
  58. if ipport="" then
  59. ipport=DEFAULTPORT
  60. end if
  61. writeBinding=ipport & inputbox(err,"hidden","hdnPort",ipport,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  62. else
  63. writeBinding=inputbox(err,"TEXT","hdnPort",ipport,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  64. end if
  65. elseif fieldname="IPAddress" then
  66. ipaddress=Binding(0)
  67. if ipaddress="" then
  68. ipaddress=L_ALLUNASSIGNED_TEXT
  69. end if
  70. if readonly then
  71. writeBinding=ipaddress & inputbox(err,"hidden","hdnIPA",ipaddress,fieldsize,onchangeproc,onfocusproc, onblurproc,True,adminonly,False)
  72. else
  73. writeBinding=inputbox(err,"TEXT","hdnIPA",ipaddress,fieldsize,onchangeproc,onfocusproc, onblurproc,True,adminonly,False)
  74. end if
  75. elseif fieldname="SecureBinding" then
  76. ' This only applies to Web sites
  77. secPort=""
  78. aSecBinding=currentobj.SecureBindings
  79. if aSecBinding(0) <> "" then
  80. arraybound=UBound(aSecBinding)
  81. for j=0 to arraybound
  82. SecBinding=split(aSecBinding(0),":")
  83. if SecBinding(0)=Binding(0) then
  84. secPort=SecBinding(1)
  85. exit for
  86. end if
  87. Next
  88. end if
  89. if readonly then
  90. writeBinding=secPort & inputbox(err,"hidden","hdnSecBinding",secPort,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  91. else
  92. writeBinding=inputbox(err,"TEXT","hdnSecBinding",secPort,fieldsize,onchangeproc,onfocusproc, onblurproc,hidden,adminonly,False)
  93. end if
  94. end if
  95. end function
  96. %>