home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / ins.cab / nnvs.asp < prev    next >
Text File  |  1997-10-12  |  11KB  |  414 lines

  1. <% Response.Expires = 0 %>
  2.  
  3. <%
  4. REM LOCALIZATION
  5.  
  6. L_PAGETITLE_TEXT            = "Microsoft NNTP Server Administration"
  7. L_SVCINSTNCPROPS_TEXT       = "Virtual Directory Properties for"
  8. L_PATHTYPE_TEXT              = "Path Type:"
  9. L_PATH_TEXT                   = "Path:"
  10. L_ALLOWPOSTING_TEXT          = "Allow Posting"
  11. L_LOGACCESS_TEXT             = "Log access to this virtual directory"
  12. L_EDITBUTTON_TEXT            = " Edit... "
  13. L_ACCESS_TEXT                 = "Access"
  14. L_RESTRICT_TEXT               = "Restrict Group Visibility"
  15. L_ACCOUNTINFO_TEXT           = "Account Information"
  16. L_SECURECOMM_TEXT            = "Secure Communications"
  17. L_REQUIRESECURECHANNEL_TEXT = "Require Secure Channel"
  18. L_REQUIRE128BIT_TEXT         = "Require 128-bit Encryption"
  19. L_INDEXNEWSCONTNET_TEXT         = "Index News Content"
  20. L_USERNAME_TEXT                    = "User name:"
  21. L_PASSWORD_TEXT                    = "Password:"
  22. L_ACCOUNTUNC_TEXT = "Account user name and password are only valid for UNC paths."        
  23. L_ENTERINTEGER_ERRORMESSAGE = "Please enter an integer between 0 and "
  24. L_DIRECTORYSYNTAX_TEXT = "The directory syntax is incorrect."
  25. L_REQUIRESECURECHANNEL128_TEXT = "Require Secure Channel must be enabled to Require 128-bit Encryption\nDo you want to enable Require Secure Channel?"
  26.  
  27.  
  28. REM END LOCALIZATION
  29. %>
  30.  
  31. <% REM Virtual Server Home Directory Page %> 
  32.  
  33. <% REM Get variables %>
  34. <% REM svr = Server name %>
  35.  
  36. <% svr = Request("svr") %>
  37.  
  38. <HTML>
  39. <HEAD>
  40. <TITLE><% = L_PAGETITLE_TEXT %></TITLE>
  41. </HEAD>
  42.  
  43. <SCRIPT LANGUAGE="javascript">
  44.  
  45. <% REM Determine browser to set pop-up window size %>
  46. <% if Instr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") then %>
  47.     winstr = "width=390,height=200,directories=no,status=no,scrollbars=no,resize=no";
  48. <% else %>
  49.     winstr = "width=420,height=270,menubar=no,directories=no,status=no,scrollbars=no,resize=no";
  50. <% end if %>
  51.  
  52. <% REM Create uForm object and methods %>
  53.  
  54. uForm = new Object();
  55. uForm.writeForm = writeForm;
  56. uForm.readCache = readCache; 
  57.  
  58. <% REM Javascript function readCache loads fields from hiddenform in sidebar %>
  59.  
  60. function readCache() 
  61. {
  62.     hform = top.menu.document.hiddenform;
  63.     uform = document.userform;
  64.     uform.txtDirectory.value = hform.txtDirectory.value;
  65.     uform.chkLogAccess.checked = (hform.chkLogAccess.value == "1");
  66.     uform.chkAllowPosting.checked = (hform.chkAllowPosting.value == "1");
  67.     uform.txtUNCUserName.value = hform.txtUNCUserName.value;
  68.     uform.txtUNCPassword.value = hform.txtUNCPassword.value;
  69.     uform.hdnUNCPassword.value = hform.txtUNCPassword.value;
  70.     uform.chkRestrictGroupVisibility.checked = (hform.chkRestrictGroupVisibility.value == "1");
  71.     uform.chkRequire128BitSsl.checked = (hform.chkRequire128BitSsl.value == "1");
  72.     uform.chkRequireSsl.checked = (hform.chkRequireSsl.value == "1");
  73.     uform.hdnRequire128BitSsl.value = hform.chkRequireSsl.value;
  74.     uform.chkIndexNewsContent.checked            = txtToChk(hform.txtIndexNewsContent);
  75. }
  76.  
  77. <% REM Javascript function writeForm sets values in hiddenform %>
  78.  
  79. function writeForm()
  80. {
  81.     hform = top.menu.document.hiddenform;
  82.     uform = document.userform;
  83.     hform.txtDirectory.value = uform.txtDirectory.value;
  84.     hform.chkLogAccess.value = chkToTxt(uform.chkLogAccess);
  85.     hform.chkAllowPosting.value = chkToTxt(uform.chkAllowPosting);
  86.     hform.txtUNCUserName.value = uform.txtUNCUserName.value;
  87.     hform.txtUNCPassword.value = uform.hdnUNCPassword.value;
  88.     hform.chkRestrictGroupVisibility.value = chkToTxt(uform.chkRestrictGroupVisibility);
  89.     hform.chkRequireSsl.value = chkToTxt(uform.chkRequireSsl);
  90.     hform.chkRequire128BitSsl.value = chkToTxt(uform.chkRequire128BitSsl);
  91.     hform.txtIndexNewsContent.value                = chkToTxt(uform.chkIndexNewsContent);
  92. }
  93.  
  94. <% REM Javascript function chkToTxt converts checkbox bools to text value for hiddenform %>
  95.     
  96. function chkToTxt(chkControl)
  97. {
  98.     if (chkControl.checked)
  99.     {
  100.         return "1";
  101.     }
  102.     else
  103.     {
  104.         return "0";
  105.     }
  106. }
  107.  
  108. function txtToChk(txtControl)
  109. {
  110.     if ((txtControl.value == "0") || (txtControl.value == ""))
  111.     {
  112.         return false;
  113.     }
  114.     else
  115.     {
  116.         return true;
  117.     }
  118. }
  119. <% REM Javascript function setPassword %>
  120.  
  121. function setPassword() 
  122. {
  123.     if (document.userform.txtUNCPassword.value != "") 
  124.     {
  125.         document.userform.hdnUNCPassword.value = document.userform.txtUNCPassword.value;
  126.         document.userform.txtUNCPassword.value = "**************";
  127.     }
  128. }
  129.  
  130. <% REM Javascript function chkUNC %>
  131.  
  132. function chkUNC(thisControl) 
  133. {
  134.     dirstr = document.userform.txtDirectory.value;
  135.     if (dirstr.substring(1,2) != "\\") 
  136.     {
  137.         alert("<% = L_ACCOUNTUNC_TEXT %>");
  138.         thisControl.value = "";    
  139.     }
  140.     else 
  141.     {
  142.         setPassword();
  143.     }
  144. }
  145.  
  146. <% REM Javascript function setUNCAccount %>
  147.  
  148. function setUNCAccount(dirString) 
  149. {
  150.     if (dirString.substring(1,2)!= "\\") 
  151.     {
  152.         document.userform.txtUNCUserName.value = "";
  153.         document.userform.txtUNCPassword.value = "";
  154.     }
  155. }
  156.  
  157. <% REM Javascript function setUpdated sets "updated" flag in hiddenform when a field is changed %>
  158.  
  159. function setUpdated() {
  160.     top.menu.document.hiddenform.updated.value = "true";    
  161. }    
  162.  
  163. <% REM Javascript function checkRange checks values between 0 and specified range %>
  164.  
  165. function checkRange(thisControl,range)
  166. {
  167.     if (isFull(thisControl.value) && isNum(thisControl.value))
  168.     {
  169.         if (thisControl.value > range)
  170.         {
  171.             alert("<% = L_ENTERINTEGER_ERRORMESSAGE %>" + range + ".");
  172.             thisControl.focus();
  173.         }
  174.     }
  175. }
  176.  
  177. <% REM Ensures that characters in directory text input field are valid %>
  178. function chkChar(txtfield) 
  179. {
  180.     txtvalue = txtfield.value
  181.     i = (txtvalue.indexOf("'") + txtvalue.indexOf('"'));
  182.     i = (i + txtvalue.indexOf("<") + txtvalue.indexOf('>') + txtvalue.indexOf('%'));
  183.     i = (i + txtvalue.indexOf("&") + txtvalue.indexOf("#") + txtvalue.indexOf("("));
  184.     i = (i + txtvalue.indexOf("+") + txtvalue.indexOf(")") + txtvalue.indexOf("@"));
  185.     i = (i + txtvalue.indexOf("~") + txtvalue.indexOf("`") + txtvalue.indexOf("!"));
  186.     i = (i + txtvalue.indexOf("^") + txtvalue.indexOf("*") + txtvalue.indexOf("="));
  187.     i = (i + txtvalue.indexOf("|") + txtvalue.indexOf(";"));
  188.     i = (i + txtvalue.indexOf(",") + txtvalue.indexOf("?"));
  189.     if (i != -21) 
  190.     {
  191.         alert("<% = L_DIRECTORYSYNTAX_TEXT %>");
  192.         document.userform.txtDirectory.value = top.menu.document.hiddenform.txtDirectory.value;
  193.         document.userform.txtDirectory.focus();
  194.         return false; 
  195.     }
  196.     else 
  197.     {
  198.         return true;
  199.     }
  200. }
  201.  
  202. <% REM Javascript function maintainChk %>
  203. function maintainChk() 
  204. {
  205.     uform = document.userform;
  206.     if (uform.chkRequireSsl.checked) 
  207.     {
  208.         uform.chkRequire128BitSsl.checked = (uform.hdnRequire128BitSsl.value == "1");
  209.     }
  210.     else 
  211.     {
  212.         uform.hdnRequire128BitSsl.value = chkToTxt(uform.chkRequire128BitSsl);
  213.         uform.chkRequire128BitSsl.checked = false;
  214.     }
  215. }
  216.  
  217. function chkSsl()
  218. {
  219.     if (!uform.chkRequireSsl.checked)
  220.     {
  221.         if(confirm("<% = L_REQUIRESECURECHANNEL128_TEXT %>"))
  222.         {
  223.             uform.chkRequireSsl.checked = true;
  224.             uform.chkRequire128BitSsl.checked = true;
  225.             return true;
  226.         }
  227.         else
  228.         {
  229.             uform.chkRequire128BitSsl.checked = false;
  230.             return false;
  231.         }
  232.     }
  233. }
  234.     
  235.  
  236. <% REM Javascript function editItem %>
  237. function editItem()
  238. {
  239.     win = window.open("nnvsed.asp?svr=<% = svr %>","PropWindow",winstr)
  240.     if (win.opener == null)
  241.     {
  242.         win.opener = self;
  243.     }
  244. }
  245.     
  246. </SCRIPT>
  247. <% REM Generic Javascript functions %>
  248.  
  249. <!--#include file="nnisnum.htm" -->
  250. <!--#include file="nnisfull.htm" -->
  251.  
  252. <BODY BGCOLOR="#CCCCCC" TEXT="#000000" TOPMARGIN="10">
  253. <FORM NAME="userform" onSubmit="return false;">
  254. <P>
  255. <IMG SRC="images/gnicttl.gif" ALIGN="textmiddle" HEIGHT=10 WIDTH=10> <FONT SIZE=2 FACE="Arial"><B><% = L_SVCINSTNCPROPS_TEXT %>  </B></FONT><FONT FACE="Times New Roman" SIZE=3><I><% = svr %></I></FONT>
  256. <FONT FACE="Arial" SIZE=2>
  257. <P>    
  258. <P>
  259. <P>
  260. <P>
  261. <BLOCKQUOTE>
  262. <TABLE BORDER="0" WIDTH="400">
  263.     <TR>
  264.         <TD COLSPAN="2" HEIGHT="10">
  265.          
  266.         </TD>
  267.     </TR>
  268.     <TR>
  269.         <TD WIDTH=80>
  270.             <FONT SIZE=2 FACE="Arial"><B><% = L_PATH_TEXT %></B></FONT>
  271.         </TD>
  272.         <TD WIDTH=220>
  273.             <INPUT TYPE="text" NAME="txtDirectory" value="" size="25" onBlur="setUpdated();setUNCAccount(this.value);chkChar(this);" onChange="setUpdated();setUNCAccount(this.value);chkChar(this);">
  274.         </TD>
  275.     </TR>
  276.     <TR>
  277.         <TD COLSPAN=2 HEIGHT=10></TD>
  278.     </TR>
  279.     <TR>
  280.         <TD COLSPAN=2>
  281.             <FONT FACE="Arial" SIZE=2>
  282.                 <B><% = L_ACCOUNTINFO_TEXT %></B>
  283.             </FONT>
  284.         </TD>
  285.     </TR>
  286.     <TR>
  287.         <TD COLSPAN=2>
  288. <BLOCKQUOTE>
  289.     <TABLE>
  290.         <TR>
  291.             <TD><FONT SIZE=2 FACE="Arial"><% = L_USERNAME_TEXT %>  </TD>
  292.             <TD><INPUT TYPE="text" NAME="txtUNCUserName" SIZE = 25 VALUE="" onBlur="chkUNC(this);" onChange="chkUNC(this);"></TD></TR>
  293.         <TR>
  294.             <TD COLSPAN=2 HEIGHT=4></TD>
  295.         </TR>
  296.         <TR>
  297.             <TD>
  298.                 <FONT SIZE=2 FACE="Arial"><% = L_PASSWORD_TEXT %>
  299.             </TD>
  300.             <TD>
  301.             <% if (UNCPassword <> "") then %>
  302.                 <INPUT TYPE="text" NAME="txtUNCPassword" SIZE=25 VALUE="**************" onBlur="chkUNC(this);" onChange="chkUNC(this);">
  303.             <% else %>
  304.                 <INPUT TYPE="text" NAME="txtUNCPassword" SIZE=25 VALUE="" onBlur="chkUNC(this);" onChange="chkUNC(this);">
  305.             <% end if %>
  306.                 <INPUT TYPE="hidden" NAME="hdnUNCPassword" VALUE=""></TD>
  307.         </TR>
  308.     </TABLE>
  309.  
  310. </BLOCKQUOTE>
  311.     <TR>
  312.         <TD COLSPAN=2 HEIGHT=4></TD>
  313.     </TR>
  314.         <TR>
  315.         <TD COLSPAN=2>
  316.             <FONT FACE="Arial" SIZE=2>
  317.                 <B><% = L_ACCESS_TEXT %></B>
  318.             </FONT>
  319.         </TD>
  320.     </TR>
  321.     <TR>
  322.         <TD COLSPAN=2>
  323.         <BLOCKQUOTE>
  324.         <TABLE>
  325.         <TR>
  326.             <TD>
  327.              
  328.             </TD>
  329.             <TD>
  330.                 <INPUT NAME="chkAllowPosting" TYPE="checkbox" onClick="setUpdated();"> <FONT SIZE=2 FACE="Arial"><% = L_ALLOWPOSTING_TEXT %></FONT>
  331.                 
  332.             </TD>
  333.         </TR>
  334.         <TR>
  335.             <TD HEIGHT=4>
  336.             </TD>
  337.         </TR>
  338.         <TR>
  339.             <TD>
  340.              
  341.             </TD>
  342.             <TD>
  343.                 <INPUT NAME="chkLogAccess" TYPE="checkbox" onClick="setUpdated();"> <FONT SIZE=2 FACE="Arial"><% = L_LOGACCESS_TEXT %></FONT>
  344.                 
  345.             </TD>
  346.         </TR>    
  347.         <TR>
  348.             <TD HEIGHT=4>
  349.             </TD>
  350.         </TR>
  351.         <TR>
  352.             <TD>
  353.              
  354.             </TD>
  355.             <TD>
  356.                 <INPUT NAME="chkRestrictGroupVisibility" TYPE="checkbox" onClick="setUpdated();"> <FONT SIZE=2 FACE="Arial"><% = L_RESTRICT_TEXT %></FONT>
  357.                 
  358.             </TD>
  359.         </TR><TR>
  360.             <td> </td>
  361.             <TD>
  362.                 <INPUT NAME="chkIndexNewsContent" type="checkbox" OnClick="setUpdated();"> <FONT SIZE=2 FACE="Arial"><% = L_INDEXNEWSCONTNET_TEXT %></FONT>
  363.             </TD>
  364.         </TR>    
  365.     </TABLE>
  366.     </BLOCKQUOTE>
  367.         <TR>
  368.         <TD COLSPAN=2 HEIGHT=4></TD>
  369.     </TR>
  370.     <TR>
  371.     <TD COLSPAN=2>
  372.         <FONT FACE="Arial" SIZE=2>
  373.             <B><% = L_SECURECOMM_TEXT %></B>
  374.         </FONT>
  375.     </TD>
  376.     </TR>
  377.     <TR>
  378.         <TD COLSPAN=2>
  379.         <BLOCKQUOTE>
  380.         <TABLE>
  381.         <TR>
  382.             <TD>
  383.              
  384.             </TD>
  385.             <TD>
  386.                 <INPUT NAME="chkRequireSsl" TYPE="checkbox" onClick="maintainChk();setUpdated();"> <FONT SIZE=2 FACE="Arial"><% = L_REQUIRESECURECHANNEL_TEXT %></FONT>
  387.                 
  388.             </TD>
  389.         </TR>
  390.         <TR>
  391.             <TD HEIGHT=4>
  392.             </TD>
  393.         </TR>
  394.         <TR>
  395.             <TD>
  396.              
  397.             </TD>
  398.             <TD>
  399.                 <INPUT NAME="chkRequire128BitSsl" TYPE="checkbox" onClick="chkSsl();setUpdated();"> <FONT SIZE=2 FACE="Arial"><% = L_REQUIRE128BIT_TEXT %></FONT>
  400.                 <INPUT NAME="hdnRequire128BitSsl" TYPE="hidden" VALUE="">
  401.             </TD>
  402.         </TR>    
  403.     </TABLE>
  404.     </TD>
  405. </TR>
  406. </TABLE>
  407. </BLOCKQUOTE>
  408. </FORM> 
  409. <script language="javascript">
  410.     readCache();
  411. </script>
  412. </BODY>
  413. </HTML>
  414.