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.

316 lines
7.3 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. <!--#include file="iiacsshd.str"-->
  8. <%
  9. On Error Resume Next
  10. Dim path, currentobj, ipsecobj
  11. path=Session("dpath")
  12. Session("path")=path
  13. Set currentobj=GetObject(path)
  14. Set ipsecobj=currentobj.IPSecurity
  15. Session("SpecObj")="IPSecurity"
  16. Session("SpecProps")="GrantbyDefault,IPDeny,IPGrant,DomainGrant,DomainDeny"
  17. %>
  18. <!--#include file="iiset.inc"-->
  19. <!--#include file="iisetfnt.inc"-->
  20. <%
  21. ' Do not use top.title.Global.update flag if page is loaded into a dialog
  22. bUpdateGlobal = false
  23. %>
  24. <!--#include file="iiaspstr.inc"-->
  25. <HTML>
  26. <SCRIPT LANGUAGE="JavaScript">
  27. function SetBool(){
  28. if (document.userform.rdoGrantbyDefault[0].checked){
  29. document.userform.GrantbyDefault.value="True"
  30. }
  31. else{
  32. document.userform.GrantbyDefault.value="False"
  33. }
  34. loadList();
  35. }
  36. </SCRIPT>
  37. <BODY BGCOLOR="<%= Session("BGCOLOR") %>" LINK="#000000" VLINK="#000000" ALINK="navy" LEFTMARGIN=5 TOPMARGIN=5 onLoad="loadList();loadHelp();">
  38. <FORM NAME="userform">
  39. <TABLE CELLSPACING=0 CELLPADDING=2>
  40. <TR><TD ><%= sFont("","","",True) %><B><%= L_TCPRESTRICT_TEXT %></B></FONT></TD></TR>
  41. <TR><TD>
  42. <BLOCKQUOTE>
  43. <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=2>
  44. <TR>
  45. <TD VALIGN="top" >
  46. <%= sFont("","","",True) %>
  47. <%= L_BYDEFAULT_TEXT %>
  48. </FONT>
  49. </TD>
  50. <TD VALIGN="top" >
  51. <TABLE>
  52. <TR>
  53. <TD>
  54. <%= sFont("","","",True) %>
  55. <IMG SRC="images/smallkey.gif" WIDTH=17 HEIGHT=18 BORDER=0 ALIGN="middle">
  56. </FONT>
  57. </TD>
  58. <TD>
  59. <%= sFont("","","",True) %>
  60. <% if ipsecobj.GrantbyDefault then %>
  61. <INPUT TYPE="hidden" NAME="GrantbyDefault" VALUE="True">
  62. <INPUT TYPE="radio" NAME="rdoGrantbyDefault" CHECKED OnClick="SetBool();">
  63. <% else %>
  64. <INPUT TYPE="hidden" NAME="GrantbyDefault" VALUE="False">
  65. <INPUT TYPE="radio" NAME="rdoGrantbyDefault" OnClick="SetBool();">
  66. <% end if %>
  67. </FONT>
  68. </TD>
  69. <TD>
  70. <%= sFont("","","",True) %>
  71. <%= L_GRANTED_TEXT %>
  72. </FONT>
  73. </TD>
  74. </TR>
  75. <TR>
  76. <TD>
  77. <%= sFont("","","",True) %>
  78. <IMG SRC="images/lock.gif" WIDTH=16 HEIGHT=18 BORDER=0 ALIGN="middle">
  79. </FONT>
  80. </TD>
  81. <TD>
  82. <%= sFont("","","",True) %>
  83. <% if ipsecobj.GrantbyDefault then %>
  84. <INPUT TYPE="radio" NAME="rdoGrantbyDefault" OnClick="SetBool();">
  85. <% else %>
  86. <INPUT TYPE="radio" NAME="rdoGrantbyDefault" CHECKED OnClick="SetBool();">
  87. <% end if %>
  88. </FONT>
  89. </TD>
  90. <TD>
  91. <%= sFont("","","",True) %>
  92. <%= L_DENIED_TEXT %>
  93. </FONT>
  94. </TD>
  95. </TR>
  96. </TABLE>
  97. </TD>
  98. </TR>
  99. <TR>
  100. <TD ><%= sFont("","","",True) %><%= L_EXCEPTBELOW_TEXT %></FONT></TD>
  101. </TR>
  102. </TABLE>
  103. </BLOCKQUOTE>
  104. </TD></TR>
  105. </TABLE>
  106. </FORM>
  107. <SCRIPT LANGUAGE="JavaScript">
  108. <!--#include file="iijsfuncs.inc"-->
  109. <!--#include file="iijsls.inc"-->
  110. function loadHelp(){
  111. top.title.Global.helpFileName="iipy_4";
  112. }
  113. function SetList(){
  114. }
  115. function disableDefault(dir,fromCntrl, toCntrl){
  116. if (!dir){
  117. if (fromCntrl.value !=""){
  118. toCntrl.value=fromCntrl.value;
  119. fromCntrl.value="";
  120. }
  121. }
  122. else{
  123. if (toCntrl.value !=""){
  124. fromCntrl.value=toCntrl.value;
  125. toCntrl.value="";
  126. }
  127. }
  128. }
  129. function enableDefault(chkCntrl){
  130. chkCntrl.checked=true;
  131. }
  132. function loadList(){
  133. parent.list.location="iiacssls.asp";
  134. }
  135. function buildListForm(){
  136. numrows=0;
  137. for (var i=0; i < cachedList.length; i++) {
  138. fullstr = cachedList[i].ip + cachedList[i].Subnet+ cachedList[i].domain;
  139. if ((!cachedList[i].deleted) && (fullstr !="")){
  140. numrows=numrows + 1;
  141. }
  142. }
  143. qstr="numrows="+numrows;
  144. qstr=qstr+"&cols=IPGrant&cols=IPDeny&cols=DomainGrant&cols=DomainDeny"
  145. top.hlist.location.href="iihdn.asp?"+qstr;
  146. <% 'the list values will be grabbed by the hiddenlistform script... %>
  147. }
  148. function SetListVals(){
  149. listForm=top.hlist.document.hiddenlistform;
  150. j=0;
  151. for (var i=0; i < cachedList.length; i++) {
  152. fullstr = cachedList[i].ip + cachedList[i].Subnet+ cachedList[i].domain;
  153. if ((!cachedList[i].deleted) && (fullstr !="")){
  154. ipSubnet=cachedList[i].ip + "," + cachedList[i].Subnet;
  155. if (ipSubnet==","){
  156. ipSubnet=""
  157. }
  158. else{
  159. //if there is no subnet, set it to default...
  160. if (ipSubnet.indexOf(",") == ipSubnet.length-1){
  161. ipSubnet = ipSubnet + "255.255.255.255"
  162. }
  163. }
  164. if (cachedList[i].access){
  165. // this works because on entry, if the user enters a domain, the ip/Subnet will be cleared.
  166. // if they enter an ip the domain will be cleared.
  167. // ip/Subnet and domain should be mutually exclusive...
  168. listForm.elements[j++].value=ipSubnet;
  169. listForm.elements[j++].value="";
  170. listForm.elements[j++].value=cachedList[i].domain;
  171. listForm.elements[j++].value="";
  172. }
  173. else{
  174. listForm.elements[j++].value="";
  175. listForm.elements[j++].value=ipSubnet;
  176. listForm.elements[j++].value="";
  177. listForm.elements[j++].value=cachedList[i].domain;
  178. }
  179. }
  180. cachedList[i].updated=false;
  181. }
  182. }
  183. function listObj(i,a,ip,s,dmn){
  184. this.id = i;
  185. this.deleted=false;
  186. this.updated=false;
  187. this.newitem=false;
  188. if (a == null)
  189. {
  190. if (document.userform != null)
  191. {
  192. a = !document.userform.rdoGrantbyDefault[0].checked;
  193. }
  194. else
  195. {
  196. a = false;
  197. }
  198. }
  199. this.access=initParam(a,"");
  200. this.ip=initParam(ip,"");
  201. this.Subnet=initParam(s,"");
  202. this.domain=initParam(dmn,"");
  203. }
  204. listFunc=new listFuncs("ip","",top.opener.top);
  205. cachedList=new Array()
  206. <%
  207. Dim agrantlist, arraybound, aAccess, i, Nexti
  208. Dim agrantDomains, adenylist, adenyDomains
  209. agrantlist=ipsecobj.IPGrant
  210. if IsArray(agrantlist) then
  211. arraybound=UBound(agrantlist)
  212. if agrantlist(0) <> "" then
  213. for i=0 to arraybound
  214. aAccess=getIP(agrantlist(i))
  215. %>cachedList[<%= i %>]=new listObj(<%= i %>, true, "<%= aAccess(0) %>","<%= aAccess(1) %>","");<%
  216. Next
  217. end if
  218. end if
  219. Nexti=UBound(agrantlist)+1
  220. agrantdomains=ipsecobj.DomainGrant
  221. if IsArray(agrantdomains) then
  222. arraybound=UBound(agrantdomains)
  223. if agrantdomains(0) <> "" then
  224. for i=0 to arraybound
  225. %>cachedList[<%= Nexti %>]=new listObj(<%= Nexti %>, true, "","","<%= sJSLiteral(agrantdomains(i)) %>");<%
  226. Nexti=Nexti + 1
  227. Next
  228. end if
  229. end if
  230. adenylist=ipsecobj.IPDeny
  231. if IsArray(adenylist) then
  232. arraybound=UBound(adenylist)
  233. if adenylist(0) <> "" then
  234. for i=0 to arraybound
  235. aAccess=getIP(adenylist(i))
  236. %>cachedList[<%= Nexti %>]=new listObj(<%= Nexti %>, false, "<%= aAccess(0) %>","<%= aAccess(1) %>","");<%
  237. Nexti=Nexti + 1
  238. Next
  239. end if
  240. end if
  241. adenydomains=ipsecobj.DomainDeny
  242. if IsArray(adenydomains) then
  243. arraybound=UBound(adenydomains)
  244. if adenydomains(0) <> "" then
  245. for i=0 to arraybound
  246. %>cachedList[<%= Nexti %>]=new listObj(<%= Nexti %>, false, "","","<%= sJSLiteral(adenydomains(i)) %>");<%
  247. Nexti=Nexti + 1
  248. Next
  249. end if
  250. end if
  251. function getIP(bindstr)
  252. dim one, ip, sn
  253. one=Instr(bindstr,",")
  254. if one > 0 then
  255. ip=Trim(Mid(bindstr,1,(one-1)))
  256. sn=Trim(Mid(bindstr,(one+1)))
  257. if sn = "255.255.255.255" then
  258. sn = ""
  259. end if
  260. else
  261. ip=bindstr
  262. end if
  263. getIP=Array(ip,sn)
  264. end function
  265. %>
  266. </SCRIPT>
  267. </BODY>
  268. </HTML>
  269. <% end if %>