home *** CD-ROM | disk | FTP | other *** search
Wrap
<% Response.Expires = 0 %> <% REM Advanced Page add/edit pop-up window %> <% REM Get variables %> <% REM svr = Server name %> <% REM a = Action to be performed by server-side code (add,save,new,edit) %> <% REM SecListTypeGranted = Access type %> <% REM SecAddress = IP address %> <% REM SecMask = Subnet mask %> <% svr = Request("svr") %> <% a = Request("a") %> <% SecListTypeGranted = Request("SecListTypeGranted") %> <% SecAddress = Request("SecAddress") %> <% SecMask = Request("SecMask") %> <!--#include file="_cnst.asp" --> <% if (cont = true) then %> <HTML> <HEAD> <SCRIPT LANGUAGE="javascript"> <% REM Javascript function onOK submits form when "OK" link is clicked %> function onOk() { <% if (a = "new") then %> document.userform.a.value = "add"; <% else %> document.userform.a.value = "save"; <% end if %> document.userform.submit(); } <% REM Javascript function maintainChk fills/clears "Mask" field accordingly when "Group" radio is clicked %> function maintainChk(group) { if (group) { if (document.userform.hdnSecMask.value != "255.255.255.255") { document.userform.txtSecMask.value = document.userform.hdnSecMask.value; } document.userform.txtSecMask.focus(); } else { document.userform.txtSecMask.value = ""; } } <% REM Javascript function maintainTxt checks "Groups" radio button when "Mask" field is filled %> function maintainTxt() { document.userform.hdnSecMask.value = document.userform.txtSecMask.value; if (!(document.userform.rdoSecAddressType[1].checked)) { document.userform.rdoSecAddressType[1].checked = true; } } </SCRIPT> <TITLE><% if (SecListTypeGranted = "0") then %>Deny <% else %>Grant <% end if %>Access On</TITLE> </HEAD> <% REM Perform actions %> <% if ((a = "add") OR (a = "save"))then %> <% set nntp = Server.CreateObject("MSWC.Nntp") %> <% txtSecAddress = Request("txtSecAddress") %> <% txtSecMask = Request("txtSecMask") %> <% if (a = "add") then %> <% if (SecListTypeGranted = "0") then %> <% nntp.SecTypeGranted = FALSE %> <% else %> <% nntp.SecTypeGranted = TRUE %> <% end if %> <% nntp.SecAddress = txtSecAddress %> <% if (Request("rdoSecAddressType") = "single") then %> <% nntp.SecMask = "255.255.255.255" %> <% else %> <% nntp.SecMask = txtSecMask %> <% end if %> <% error = nntp.SecAdd %> <% elseif (a = "save") then %> <% error = nntp.SecEnumerate %> <% if (SecListTypeGranted = "0") then %> <% nntp.SecTypeGranted = FALSE %> <% else %> <% nntp.SecTypeGranted = TRUE %> <% end if %> <% nntp.SecAddress = Request("hdnSecAddress") %> <% error = nntp.SecGetInfo %> <% nntp.SecAddress = txtSecAddress %> <% if (Request("rdoSecAddressType") = "single") then %> <% nntp.SecMask = "255.255.255.255" %> <% else %> <% nntp.SecMask = txtSecMask %> <% end if %> <% error = nntp.SecSetInfo %> <% end if %> <% if (error <> 0) then %> <SCRIPT LANGUAGE="javascript"> alert("<% = nntp.ErrorToString (error) %>"); self.location = "nnadved.asp?svr=<% = svr %>&SecAddress=<% = hdnSecAddress %>&SecMask=<% = txtSecMask %>"; </SCRIPT> <% else %> <SCRIPT LANGUAGE="javascript"> opener.location = "nnadvhd.asp?svr=<% = svr %>"; self.close(); </SCRIPT> <% end if %> <% elseif (a = "new") then %> <% rdoSecAddressType = "single" %> <% elseif (a = "edit") then %> <% if (SecMask = "255.255.255.255") then %> <% rdoSecAddressType = "single" %> <% else %> <% rdoSecAddressType = "group" %> <% end if %> <% end if %> <BODY BGCOLOR="#000000" TEXT="#000000" TOPMARGIN=15 LINK="#000000" VLINK="#000000" ALINK="#000000"> <FORM NAME="userform" ACTION="nnadved.asp" onSubmit="return false;" METHOD="post"> <INPUT TYPE="hidden" NAME="svr" VALUE="<% = svr %>"> <INPUT TYPE="hidden" NAME="SecListTypeGranted" VALUE="<% = SecListTypeGranted %>"> <INPUT TYPE="hidden" NAME="a" VALUE="<% = a %>"> <P> <TABLE BORDER=1 BGCOLOR="#CCCCCC" WIDTH=100% CELLPADDING=10> <TR><TD> <FONT SIZE=2 FACE="Arial"> <B><IMG SRC="images/gnicttl.gif" ALIGN="textmiddle" HEIGHT=10 WIDTH=10> <% if (SecListTypeGranted = "0") then %>Deny <% else %>Grant <% end if %>Access On</B> <% if (rdoSecAddressType = "single") then %> <P><INPUT NAME="rdoSecAddressType" TYPE="radio" onClick="maintainChk(false);" VALUE="single" CHECKED>Single computer <P><INPUT NAME="rdoSecAddressType" TYPE="radio" onClick="maintainChk(true);" VALUE="group">Group of computers <% else %> <P><INPUT NAME="rdoSecAddressType" TYPE="radio" onClick="maintainChk(false);" VALUE="single">Single computer <P><INPUT NAME="rdoSecAddressType" TYPE="radio" onClick="maintainChk(true);" VALUE="group" CHECKED>Group of computers <% end if %> <P> <TABLE WIDTH=250> <TR> <TD WIDTH=125><FONT SIZE=2 FACE="Arial">IP address:</TD> <TD WIDTH=125><INPUT NAME="txtSecAddress" TYPE="text" VALUE="<% = SecAddress %>" SIZE=15></TD> <INPUT NAME="hdnSecAddress" TYPE="hidden" VALUE="<% = SecAddress %>"> </TR> <TR> <TD HEIGHT=4 COLSPAN=2></TD> </TR> <TR> <TD WIDTH=125><FONT SIZE=2 FACE="Arial">Subnet mask:</TD> <% if (SecMask <> "255.255.255.255") then %> <TD WIDTH=125><INPUT NAME="txtSecMask" TYPE="text" VALUE="<% = SecMask %>" SIZE=15 onChange="maintainTxt();"> <% else %> <TD WIDTH=125><INPUT NAME="txtSecMask" TYPE="text" VALUE="" SIZE=15 onChange="maintainTxt();"> <% end if %> <INPUT TYPE="hidden" NAME="hdnSecMask" VALUE="<% = SecMask %>"> </TD> </TR> </TABLE> </TD></TR> </TABLE> <P> <TABLE ALIGN="right" CELLPADDING=1 CELLSPACING=1> <TR> <TD><TABLE VALIGN="top" BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#FFCC00"> <TR> <TD VALIGN="middle"> <FONT FACE="Arial" SIZE=2> <B><A HREF="javascript:onOk();"> <IMG SRC="images/gnicok.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A> <A HREF="javascript:onOk();">OK</A></B> </FONT> </TD> </TR> </TABLE></TD> <P> <TD><TABLE VALIGN="top" BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#FFCC00"> <TR> <TD VALIGN="middle"> <FONT FACE="Arial" SIZE=2> <B><A HREF="javascript:close();"> <IMG SRC="images/gniccncl.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A> <A HREF="javascript:close();">Cancel</A></B> </FONT> </TD> </TR> </TABLE></TD> <TD> </TD> </TR> </TABLE> </TD></TR> </TABLE> </FORM> </BODY> </HTML> <% end if %>