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

  1. <% Response.Expires = 0 %>
  2. <%
  3. REM LOCALIZATION
  4.  
  5. L_PAGETITLE_TEXT = "Microsoft Internet Service Manager"
  6.  
  7. REM END LOCALIZATION
  8. %>
  9.  
  10. <% REM Logging Page %>
  11.  
  12. <% REM Get variables %>
  13. <% REM svr = Server name %>
  14. <% REM lgt = Logging type passed from menu frame (0 -- disabled, 1 -- file, 2-- database) %>
  15.  
  16. <% svr = Request("svr") %> 
  17. <% lgt = Request("lgt") %>
  18.  
  19. <HTML>
  20. <HEAD>
  21. <TITLE><% = L_PAGETITLE_TEXT %></TITLE>
  22.  
  23. <SCRIPT LANGUAGE="javascript">
  24.  
  25.  
  26. <% REM Create uForm object and methods %>
  27.  
  28.     uForm = new Object();
  29.     uForm.writeForm = writeForm;
  30.     uForm.readCache = readCache; 
  31.  
  32.     
  33. <% REM Javascript function readCache loads fields from hiddenform in sidebar %>
  34.  
  35.     function readCache() 
  36.     {
  37.         hform = parent.menu.document.hiddenform;
  38.         uform = document.userform;
  39.     <% if (lgt = "0") then %>
  40.         return;
  41.     <% elseif (lgt = "1") then %>
  42.         uform.txtLogFileDirectory.value = hform.txtLogFileDirectory.value;    
  43.         getLogPeriod();
  44.     <% elseif (lgt = "2") then %>
  45.         uform.txtLogDatasource.value = hform.txtLogDataSource.value;
  46.         uform.txtLogTableName.value = hform.txtLogTableName.value;
  47.         uform.txtLogUserName.value = hform.txtLogUserName.value;
  48.         uform.hdnLogPassword.value = hform.txtLogPassword.value;
  49.     <% end if %>
  50.     }
  51.  
  52.     
  53.  
  54. <% REM Javascript function writeForm sets values in hiddenform %>
  55.  
  56.     function writeForm() {
  57.         hform = parent.menu.document.hiddenform;
  58.         uform = document.userform;
  59.     <% if (lgt = "0") then %>
  60.         hform.rdoLogType.value = "0";
  61.     <% elseif (lgt = "1") then %>
  62.         hform.rdoLogType.value = "1";
  63.         hform.rdoLogPeriod.value = uform.hdnLogPeriod.value;
  64.         hform.txtLogSizeForTruncation.value = uform.txtLogSizeForTruncation.value;
  65.         hform.txtLogFileDirectory.value = uform.txtLogFileDirectory.value;
  66.     <% elseif (lgt = "2") then %>
  67.         hform.rdoLogType.value = "2";
  68.         hform.txtLogDatasource.value = uform.txtLogDatasource.value;
  69.         hform.txtLogTableName.value = uform.txtLogTableName.value;
  70.         hform.txtLogUserName.value = uform.txtLogUserName.value;
  71.         hform.txtLogPassword.value = uform.hdnLogPassword.value;
  72.         if (hform.txtLogPassword.value != "")
  73.         {
  74.             uform.txtLogPassword.value = "**************";
  75.         }
  76.     <% end if %>
  77.     }
  78.  
  79.     
  80. <% REM Javascript function getLogPeriod sets period radio buttons, "When file size reaches" fields  %>
  81.  
  82.     function getLogPeriod() 
  83.     {
  84.         hform = parent.menu.document.hiddenform;
  85.         uform = document.userform;
  86.         LogSizeForTruncation = hform.txtLogSizeForTruncation.value;        
  87.         if ((LogSizeForTruncation == "-1") || (LogSizeForTruncation == "0") || (LogSizeForTruncation == "")) 
  88.         {
  89.             uform.hdnLogSizeForTruncation.value = "4";
  90.         }
  91.         else {
  92.             uform.hdnLogSizeForTruncation.value = LogSizeForTruncation;
  93.         }
  94.         LogPeriod = hform.rdoLogPeriod.value; 
  95.         for (i=1; i<4; i++) 
  96.         {
  97.             if (LogPeriod == i) 
  98.             {
  99.                 uform.chkLogAutoOpen.checked = "true";
  100.                 uform.rdoLogPeriod[i-1].checked = "true";
  101.             }
  102.         }
  103.         if ((LogSizeForTruncation != "-1") && (LogPeriod == "0")) 
  104.         {
  105.             uform.chkLogAutoOpen.checked = "true";
  106.             uform.rdoLogPeriod[3].checked = "true";
  107.             uform.txtLogSizeForTruncation.value = uform.hdnLogSizeForTruncation.value;
  108.         } 
  109.     }
  110.  
  111.  
  112. <% REM Javascript function setUpdated sets "updated" flag in hiddenform when a field is changed %>
  113.  
  114.     function setUpdated() 
  115.     {
  116.         top.menu.document.hiddenform.updated.value = "true";    
  117.     }    
  118.  
  119.  
  120. <% REM Javascript function changeLogType reloads page with disabled, file, or database logging parameter %>
  121.  
  122.     function changeLogType(lgt) 
  123.     {
  124.         self.location = "nnlg.asp?svr=<% = svr %>&lgt=" + lgt;
  125.     }
  126.  
  127.     
  128. <% REM Javascript function changeLogPeriod fills/clears "When file size reaches" field according to which radio button is checked%>
  129.  
  130.     function changeLogPeriod(t) 
  131.     {
  132.         var txtLogSizeForTruncation = document.userform.txtLogSizeForTruncation;
  133.         var hdnLogSizeForTruncation = document.userform.hdnLogSizeForTruncation;
  134.         if (t == 0) 
  135.         {
  136.             txtLogSizeForTruncation.value = hdnLogSizeForTruncation.value; 
  137.         }    
  138.         else {
  139.             if (txtLogSizeForTruncation.value != "") 
  140.             {
  141.                 hdnLogSizeForTruncation.value = txtLogSizeForTruncation.value; 
  142.             }
  143.             txtLogSizeForTruncation.value = "";
  144.         }
  145.         if (!(document.userform.chkLogAutoOpen.checked)) 
  146.         {
  147.             document.userform.chkLogAutoOpen.checked = true;
  148.         }
  149.         document.userform.hdnLogPeriod.value = t;
  150.     }
  151.  
  152.  
  153. <% REM Javascript function maintainChk clears period fields when "Automatically open" is unchecked %>
  154.  
  155.     function maintainChk() 
  156.     {
  157.         if (document.userform.chkLogAutoOpen.checked == false) 
  158.         {
  159.             for (i=0; i > 4; i++) {
  160.                 document.userform.rdoLogPeriod[i].checked = false;
  161.             }            
  162.             document.userform.txtLogSizeForTruncation.value = "";
  163.             document.userform.hdnLogPeriod.value = "4";
  164.         }
  165.         else {
  166.             getLogPeriod();
  167.         }
  168.     }
  169.  
  170.     
  171. <% REM Javascript function maintainTxt checks "When file size reaches" field and checks corresponding radio button %>
  172.     
  173.     function maintainTxt() 
  174.     {
  175.         var txtLogSizeForTruncation = document.userform.txtLogSizeForTruncation;
  176.         if ((!(isNum(txtLogSizeForTruncation.value))) || (!(isFull(txtLogSizeForTruncation.value)))) 
  177.         {
  178.             txtLogSizeForTruncation.value = "";
  179.             txtLogSizeForTruncation.focus();
  180.         }
  181.         else {
  182.             if (txtLogSizeForTruncation.value > 4095) 
  183.             {
  184.                 txtLogSizeForTruncation.value = 4095;    
  185.             }
  186.             document.userform.hdnLogSizeForTruncation.value = txtLogSizeForTruncation.value;
  187.             if (!(document.userform.rdoLogPeriod[3].checked)) 
  188.             {
  189.                 document.userform.rdoLogPeriod[3].checked = true;
  190.                 top.menu.document.hiddenform.rdoLogPeriod.value = "0";
  191.             }
  192.         }
  193.     }
  194.  
  195.     
  196. <% REM Javascript function setPassword replaces text in password field with asterisks, transfers value to hidden field %>
  197.  
  198.     function setPassword() 
  199.     {
  200.         txtLogPassword = document.userform.txtLogPassword;
  201.         if (txtLogPassword.value != "") 
  202.         {
  203.             document.userform.hdnLogPassword.value = txtLogPassword.value;
  204.             txtLogPassword.value = "**************";
  205.         }
  206.     }
  207.  
  208.  
  209.  
  210.  
  211. </SCRIPT>
  212.  
  213. <% REM Generic Javascript functions isNum and isFull %>
  214. <!-- # include file="nnisnum.htm" -->
  215. <!-- # include file="nnisfull.htm" -->
  216.  
  217. </HEAD>
  218.  
  219. <BODY BGCOLOR="#CCCCCC" TEXT="#000000" TOPMARGIN=10 onLoad="readCache();">
  220.  
  221. <P><IMG SRC="images/gnicttl.gif" ALIGN="textmiddle" HEIGHT=10 WIDTH=10> <FONT SIZE=2 FACE="Arial"><B>Logging Properties for  </B></FONT><FONT SIZE=3 FACE="Times New Roman"><I><% = svr %></I></FONT>
  222.  
  223. <FONT SIZE=2 FACE="Arial">
  224.  
  225. <FORM NAME="userform" onSubmit="return false;">
  226.  
  227.  
  228. <% REM If logging is enabled, display Enable logging checkbox as checked %> 
  229.  
  230. <% if (lgt <> "0") then %>
  231.  
  232. <P>
  233. <INPUT TYPE="checkbox" NAME="chkLogEnable" onClick="changeLogType(0);setUpdated();" CHECKED> Enable logging
  234.  
  235.  
  236. <% REM If logging to file, display file fields %>
  237.  
  238. <% if (lgt = "1") then %>
  239.  
  240. <P><B>Log To</B>
  241.  
  242. <BLOCKQUOTE>
  243.  
  244.     <TABLE WIDTH=325>
  245.         <TR>
  246.             <TD WIDTH=125><FONT SIZE=2 FACE="Arial"><INPUT TYPE="radio" NAME="rdoLogType" VALUE="1" CHECKED> File</FONT></TD>
  247.             <TD WIDTH=200><FONT SIZE=2 FACE="Arial"><INPUT TYPE="radio" NAME="rdoLogType" VALUE="2" onClick="changeLogType(2);setUpdated();"> SQL/ODBC database</FONT></TD>
  248.         </TR>
  249.     </TABLE>
  250.  
  251. </BLOCKQUOTE>
  252.  
  253. <P><B>Log File Properties</B>
  254.  
  255. <BLOCKQUOTE>
  256.  
  257.     <P><INPUT TYPE="checkbox" NAME="chkLogAutoOpen" onClick="maintainChk();setUpdated();"> Automatically open new log
  258.         <INPUT TYPE="hidden" NAME="hdnLogPeriod" VALUE="">
  259.  
  260.     <P>
  261.     <BLOCKQUOTE>
  262.  
  263.         <INPUT TYPE="radio" NAME="rdoLogPeriod" onClick="changeLogPeriod('1');setUpdated();"> Daily
  264.         <P><INPUT TYPE="radio" NAME="rdoLogPeriod" onClick="changeLogPeriod('2');setUpdated()"> Weekly
  265.         <P><INPUT TYPE="radio" NAME="rdoLogPeriod" onClick="changeLogPeriod('3');setUpdated();"> Monthly
  266.         <P><INPUT TYPE="radio" NAME="rdoLogPeriod" onClick="changeLogPeriod('0');setUpdated();"> When file size reaches  
  267.             <INPUT TYPE="text" SIZE=5 NAME="txtLogSizeForTruncation" onChange="maintainTxt();setUpdated();" VALUE=""> MB
  268.             <INPUT TYPE="hidden" NAME="hdnLogSizeForTruncation" VALUE="">
  269.  
  270.     </BLOCKQUOTE>
  271.  
  272.     <P>Log file directory:  <INPUT TYPE="text" SIZE=45 NAME="txtLogFileDirectory" VALUE="" onChange="setUpdated();">
  273.  
  274. </BLOCKQUOTE>
  275.  
  276. <% REM If logging to database, display database fields %>
  277.  
  278. <% elseif (lgt = "2") then %>
  279.  
  280. <P><B>Log To</B>
  281.  
  282. <BLOCKQUOTE>
  283.  
  284.     <TABLE WIDTH=325>
  285.         <TR>
  286.             <TD WIDTH=125>
  287.                 <FONT SIZE=2 FACE="Arial"><INPUT TYPE="radio" NAME="rdoLogType" VALUE="1" onClick="changeLogType(1);setUpdated();"> File</FONT>
  288.             </TD>
  289.             <TD WIDTH=200>
  290.                 <FONT SIZE=2 FACE="Arial"><INPUT TYPE="radio" NAME="rdoLogType" VALUE="2" CHECKED> SQL/ODBC database</FONT>
  291.             </TD>
  292.         </TR>
  293.     </TABLE>
  294.  
  295. </BLOCKQUOTE>
  296.  
  297. <P><B>SQL/ODBC Database Properties</B>
  298.  
  299. <BLOCKQUOTE>
  300.  
  301.     <P>
  302.     <TABLE BORDER=0>
  303.         <TR>
  304.             <TD><FONT SIZE=2 FACE="Arial">ODBC datasource name (DSN):  </FONT></TD>
  305.             <TD><INPUT TYPE="text" SIZE=25 NAME="txtLogDatasource" VALUE="" onChange="setUpdated();"></TD>
  306.         </TR>
  307.         <TR>
  308.             <TD HEIGHT=4></TD>
  309.         </TR>
  310.         <TR>
  311.             <TD><FONT SIZE=2 FACE="Arial">Table:</FONT></TD>
  312.             <TD><INPUT TYPE="text" SIZE=25 NAME="txtLogTableName" VALUE="" onChange="setUpdated();"></TD>
  313.         </TR>
  314.         <TR>
  315.             <TD HEIGHT=4></TD>
  316.         </TR>
  317.         <TR>
  318.             <TD><FONT SIZE=2 FACE="Arial">Username:</FONT></TD>
  319.             <TD><INPUT TYPE="text" SIZE=25 NAME="txtLogUserName" VALUE="" onChange="setUpdated();"></TD>
  320.         </TR>
  321.         <TR>
  322.             <TD HEIGHT=4></TD>
  323.         </TR>
  324.         <TR>
  325.             <TD><FONT SIZE=2 FACE="Arial">Password:</FONT></TD>
  326.             <TD><INPUT TYPE="text" SIZE=25 NAME="txtLogPassword" VALUE="" onChange="setPassword();setUpdated();">
  327.                 <INPUT TYPE="hidden" NAME="hdnLogPassword" VALUE=""></TD>
  328.         </TR>
  329.     </TABLE>
  330.  
  331. </BLOCKQUOTE>
  332.  
  333. <% end if %>
  334.  
  335. <% REM If logging is disabled, display checkbox as unchecked and show explanatory message %>
  336.  
  337. <% else %>
  338.  
  339. <P><INPUT TYPE="checkbox" NAME="chkLogEnable" onClick="changeLogType(1);setUpdated();"> Enable logging
  340.  
  341. <BR> 
  342. <BR> 
  343.  
  344. <P>
  345.     Check <B>Enable Logging</B> to start or stop logging. Logging provides valuable information 
  346.     about how the Microsoft Internet News Server is used. Send log data to files or to a SQL/ODBC 
  347.     (Open Data Base Connectivity) supported database. 
  348.  
  349. <% end if %>
  350.  
  351. </FORM>
  352.  
  353. </BODY>
  354. </HTML>
  355.  
  356.