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.

392 lines
11 KiB

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4. <!--#include file="iilogmn.str"-->
  5. <%
  6. Const MD_UNLIMITED_FILESIZE = "&HFFFFFFFF"
  7. Const ISM_FILESIZE_DEFAULT = "512"
  8. Const EXTW3SVCPATH = "IIS://localhost/w3svc"
  9. Const EXTMSFTPSVCPATH = "IIS://localhost/msftpsvc"
  10. Const CUSTOMLOGPATH = "IIS://localhost/Logging/Custom Logging"
  11. Const CUSTOMLOGKEYTYPE = "IISCustomLogModule"
  12. 'On Error Resume Next
  13. Dim path, currentobj, lfSize, svctype, svrname, ExtSvcPath,objExtSVC
  14. path=Session("spath")
  15. Session("path")=path
  16. Session("SpecObj")=""
  17. Session("SpecProps")=""
  18. Set currentobj=GetObject(path)
  19. if Session("stype") = "www" then
  20. ExtSvcPath = EXTW3SVCPATH
  21. else
  22. ExtSvcPath = EXTMSFTPSVCPATH
  23. end if
  24. svctype = Mid(path, InStr(7,path, "/")+1)
  25. if Instr(svctype,"/") then
  26. svctype = Mid(svctype,1,Instr(svctype, "/")-1)
  27. end if
  28. svrname = Mid(path, InStrRev(path, "/")+1)
  29. %>
  30. <!--#include file="iiset.inc"-->
  31. <!--#include file="iisetfnt.inc"-->
  32. <%
  33. ' Do not use top.title.Global.update flag if page is loaded into a dialog
  34. bUpdateGlobal = false
  35. %>
  36. <HTML>
  37. <HEAD>
  38. <TITLE></TITLE>
  39. <% if Session("canBrowse") then %>
  40. <SCRIPT LANGUAGE="JavaScript" SRC="JSDirBrowser/JSBrowser.js">
  41. </SCRIPT>
  42. <SCRIPT LANGUAGE="JavaScript">
  43. JSBrowser = new BrowserObj(null,false,TDIR,<%= Session("FONTSIZE") %>);
  44. </SCRIPT>
  45. <% end if %>
  46. <SCRIPT LANGUAGE="JavaScript">
  47. var aLogFileNames = Array("<%= L_LIMITLOG %>", "<%= L_DAYLOG %>","<%= L_WEEKLOG %>","<%= L_MONTHLOG %>","<%= L_HOURLOG %>");
  48. var aHiddenFields = Array();
  49. function buildListForm(){
  50. <% if Session("setLogUI") = "EXT" then %>
  51. setParentFlag();
  52. <% end if %>
  53. qstr="numrows=0";
  54. top.hlist.location.href="iihdn.asp?"+qstr;
  55. }
  56. function SetListVals(){
  57. }
  58. function setParentFlag()
  59. {
  60. <% if Session("setLogUI") <> "ODBC" then %>
  61. <% if Session("IsIE") then %>
  62. var extform = document.EXTFRAME.document.extuserform;
  63. <% else %>
  64. var extform = document.extuserform;
  65. <% end if %>
  66. var extformsize = extform.elements.length;
  67. var extformflags = 0;
  68. var fldname = "";
  69. for (var i=0; i < aHiddenFields.length; i++)
  70. {
  71. document.userform[aHiddenFields[i]].value = 0;
  72. }
  73. for (var i=0; i < extformsize; i++)
  74. {
  75. if (extform.elements[i].checked)
  76. {
  77. //this is quite ridiculous, but necessary.. otherwise it treats these values as strings & concats 'em...
  78. oldval = new Number(document.userform[extform.elements[i].name].value);
  79. newval = new Number(extform.elements[i].value);
  80. x = newval + oldval;
  81. document.userform[extform.elements[i].name].value = x ;
  82. }
  83. }
  84. <% end if %>
  85. }
  86. function calcLFSize(mbCntrl)
  87. {
  88. num = parseInt(mbCntrl.value);
  89. if (!isNaN(num))
  90. {
  91. mbCntrl.value = num;
  92. // We only want to update if file size radio is checked.
  93. // Note: we are depending on the radio being the last one in the list.
  94. if( document.userform.rdoLogFilePeriod[document.userform.rdoLogFilePeriod.length - 1].checked )
  95. {
  96. document.userform.LogFileTruncateSize.value = mbCntrl.value * 1048576;
  97. }
  98. }
  99. else
  100. {
  101. alert("<%= L_INTEGERREQ_TEXT %>");
  102. }
  103. }
  104. function noUNCPaths(pathCntrl)
  105. {
  106. var pathval = pathCntrl.value;
  107. if (pathval.substring(0,1) == "\\\\")
  108. {
  109. alert("<%= L_NOUNCS %>");
  110. pathCntrl.value = "";
  111. }
  112. }
  113. function listFuncs(){
  114. this.bHasList = false;
  115. this.writeList=buildListForm;
  116. this.SetListVals=SetListVals;
  117. this.mainframe = top.opener.top;
  118. }
  119. function setLogFile(intLogType)
  120. {
  121. document.userform.LogFilePeriod.value = intLogType;
  122. document.userform.hdnLogFileName.value = "<%= svctype %><%= svrname %>\\" + aLogFileNames[intLogType];
  123. }
  124. <% if Session("setLogUI") = "ODBC" then %>
  125. function chkPassword(pass2, pass1)
  126. {
  127. if (pass1.value != pass2.value)
  128. {
  129. alert("<%= L_PASSNOTMATCH_TEXT %>");
  130. pass2.value = "";
  131. pass2.focus();
  132. }
  133. }
  134. <% end if %>
  135. listFunc=new listFuncs();
  136. </SCRIPT>
  137. </HEAD>
  138. <BODY TOPMARGIN=10 LEFTMARGIN=10 BGCOLOR="silver" LINK="#000000" VLINK="#000000" <%if Session("setLogUI") <> "ODBC" then %>onLoad="setLogFile(document.userform.LogFilePeriod.value);"<% end if %>>
  139. <%= sFont("","","",True) %>
  140. <% if Session("setLogUI") = "ODBC" then %>
  141. <FORM NAME="userform">
  142. <A NAME="ODBC"></A>
  143. <TABLE WIDTH =100% HEIGHT = <%= L_PAGEHEIGHT_NUM %>>
  144. <TR>
  145. <TD COLSPAN = 2>
  146. <%= sFont("","","",True) %>
  147. <B><%= L_ODBCOPTIONS_TEXT %></B><P>
  148. </FONT>
  149. </TD>
  150. </TR>
  151. <TR>
  152. <TD COLSPAN = 2 VALIGN="top">
  153. <%= sFont("","","",True) %>
  154. <%= L_ODBCDSNAME_TEXT %><BR>
  155. <%= text("LogOdbcDataSource",L_ODBCTEXTFIELDS_NUM,"","", "",False,False) %><P>
  156. <%= L_TABLE_TEXT %><BR>
  157. <%= text("LogOdbcTableName",L_ODBCTEXTFIELDS_NUM,"","", "",False,False) %><P>
  158. <%= L_USER_TEXT %><BR>
  159. <%= text("LogOdbcUserName",L_ODBCTEXTFIELDS_NUM,"","", "",False,False) %><P>
  160. <%= L_PASSWORD_TEXT %><BR>
  161. <%= pword("LogOdbcPassword",L_ODBCTEXTFIELDS_NUM,"hdnLogODBCPassword.value='';","", "",False,False) %><P>
  162. <%= L_CONFIRMPASSWORD_TEXT %><BR>
  163. <%= inputbox(0,"PASSWORD","hdnLogODBCPassword", currentobj.LogOdbcPassword,L_ODBCTEXTFIELDS_NUM,"","","chkPassword(this,LogOdbcPassword);",False,False,False) %>
  164. </TR>
  165. </TABLE>
  166. </FORM>
  167. <% else %>
  168. <A NAME="GENERAL">
  169. <FORM NAME="userform">
  170. <TABLE WIDTH =100% HEIGHT = <%= L_PAGEHEIGHT_NUM %>>
  171. <TR>
  172. <TD COLSPAN = 2>
  173. <%= sFont("","","",True) %>
  174. <B><%= L_GENERAL_TEXT %></B>
  175. (<%= Session("LogName") %>)
  176. <P>
  177. </FONT>
  178. </TD>
  179. </TR>
  180. <TR>
  181. <TD COLSPAN = 2 VALIGN="top">
  182. <%= sFont("","","",True) %>
  183. <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">
  184. <%= L_NEWTIMEPERIOD_TEXT %>
  185. <IMG SRC="images/hr.gif" WIDTH=<%= L_NEWTIMEPERIOD_HR %> HEIGHT=2 BORDER=0 ALIGN="middle">
  186. <P>
  187. <INPUT TYPE="hidden" NAME="LogFilePeriod" VALUE="<%= currentobj.LogFilePeriod %>">
  188. <%= printradio("LogFilePeriod", currentobj.LogFilePeriod = 4, "setLogFile(4);",False) %>
  189. <%= L_HOURLY_TEXT %><BR>
  190. <%= printradio("LogFilePeriod", currentobj.LogFilePeriod = 1, "setLogFile(1);",False) %>
  191. <%= L_DAILY_TEXT %><BR>
  192. <%= printradio("LogFilePeriod", currentobj.LogFilePeriod = 2, "setLogFile(2);",False) %>
  193. <%= L_WEEKLY_TEXT %><BR>
  194. <%= printradio("LogFilePeriod", currentobj.LogFilePeriod = 3, "setLogFile(3);",False) %>
  195. <%= L_MONTHLY_TEXT %><BR>
  196. <%= printradio("LogFilePeriod", currentobj.LogFilePeriod = 0 and currentobj.LogFileTruncateSize = CLng(MD_UNLIMITED_FILESIZE), "setLogFile(0);document.userform.LogFileTruncateSize.value='" & CLng(MD_UNLIMITED_FILESIZE) & "';",False) %>
  197. <%= L_UNLIMITED_TEXT %><BR>
  198. <%= printradio("LogFilePeriod", currentobj.LogFilePeriod = 0 and currentobj.LogFileTruncateSize <> CLng(MD_UNLIMITED_FILESIZE), "setLogFile(0);document.userform.LogFileTruncateSize.value=document.userform.hdnLogFileTruncateSize.value * 1048576;",False) %>
  199. <%= L_LIMITED_TEXT %>&nbsp;
  200. <%
  201. ' Set the defualt value for the hdnLogFileTruncateSize text box
  202. if currentobj.LogFileTruncateSize = CLng(MD_UNLIMITED_FILESIZE) then
  203. lfSize = ISM_FILESIZE_DEFAULT
  204. else
  205. lfSize = currentobj.LogFileTruncateSize/1048576
  206. end if
  207. %>
  208. <%= inputbox(0,"text", "hdnLogFileTruncateSize",lfSize,L_FILESIZETEXT_NUM,"","", "calcLFSize(this);",True,False,False) %>&nbsp;<%= L_MB_TEXT %>
  209. <INPUT TYPE="hidden" NAME="LogFileTruncateSize" VALUE="<%= currentobj.LogFileTruncateSize %>">
  210. <BR>
  211. <% if Session("setLogUI") = "EXT" then %>
  212. <%= checkbox("LogFileLocaltimeRollover","",False) %>&nbsp;
  213. <%= L_LOCALTIME_TEXT %>
  214. <%
  215. mainWriteLoggingFields
  216. Sub mainWriteLoggingFields()
  217. 'On Error Resume Next
  218. Dim objExtCustomLogging, objExtCustomModule, objExtW3SVC, sOutputScript
  219. Set objExtSVC = GetObject(EXTSVCPATH)
  220. Set objExtCustomLogging = GetObject(CUSTOMLOGPATH)
  221. 'Run through all of our custom modules, looking for new fields
  222. sOutputScript = writeCustomLogField(objExtCustomLogging, objExtSVC, 0, "")
  223. Response.write "<SCRIPT LANGUAGE='JavaScript'>" & sOutputScript & "</SCRIPT>"
  224. End Sub
  225. Function writeCustomLogField(objExtCustomModule, objExtSVC, itemCounter, lastField)
  226. 'On Error Resume Next
  227. Dim objExtAttributes, objCustomProp, thisOutputScript
  228. Dim foundit, service
  229. if objExtCustomModule.KeyType = EXTCUSTOMLOGKEYTYPE then
  230. 'Response.write objExtCustomModule.Name & "<BR>"
  231. foundit = false
  232. for each service in objExtCustomModule.LogCustomPropertyServicesString
  233. if (UCase(service) = UCase(objExtSVC.Name)) then
  234. foundit = true
  235. exit for
  236. end if
  237. next
  238. if foundit then
  239. if objExtCustomModule.LogCustomPropertyID <> 0 then
  240. Set objExtAttributes = objExtSVC.getPropertyAttribObj(objExtCustomModule.LogCustomPropertyID)
  241. if InStr(lastField,objExtAttributes.PropName)<= 0 then
  242. thisOutputScript = "aHiddenFields[" & itemCounter & "] = '" & objExtAttributes.PropName & "';"
  243. Response.write "<INPUT TYPE='hidden' NAME='" & objExtAttributes.PropName & "' VALUE='" & currentobj.Get(objExtAttributes.PropName) & "'>"
  244. itemCounter = itemCounter + 1
  245. lastField = lastField & "," & objExtAttributes.PropName
  246. end if
  247. end if
  248. For Each objCustomProp In objExtCustomModule
  249. thisOutputScript = thisOutputScript & writeCustomLogField(objCustomProp, objExtSVC, itemCounter, lastField)
  250. Next
  251. end if
  252. end if
  253. writeCustomLogField = thisOutputScript
  254. End Function
  255. %>
  256. <P>
  257. <% end if %>
  258. <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">
  259. <%= L_LOGFILEPROPS_TEXT %>
  260. <IMG SRC="images/hr.gif" WIDTH=<%= L_LOGFILEPROPS_HR %> HEIGHT=2 BORDER=0 ALIGN="middle">
  261. <P>
  262. <TABLE>
  263. <TR>
  264. <TD> <%= sFont("","","",True) %>
  265. <%= L_LOGDIR_TEXT %>
  266. </TD>
  267. <TD>
  268. <%= sFont("","","",True) %>
  269. <%= text("LogFileDirectory",L_LOGDIRTEXT_NUM,"","", "noUNCPaths(this);",False,False) %>
  270. </TD>
  271. </TR>
  272. <TR>
  273. <TD COLSPAN = 2 ALIGN="right">
  274. <% if Session("canBrowse") then %>
  275. <INPUT TYPE="button" NAME="hdnBrowser" VALUE="<%= L_BROWSE_TEXT %>" OnClick="JSBrowser = new BrowserObj(document.userform.LogFileDirectory,true,TFILE,<%= Session("FONTSIZE") %>);">
  276. <% end if %>
  277. </TD>
  278. </TR>
  279. <TR HEIGHT = 3>
  280. <TD COLSPAN = 2>
  281. &nbsp;
  282. </TD>
  283. </TR>
  284. <TR>
  285. <TD>
  286. <%= sFont("","","",True) %>
  287. <%= L_LOGFILE_TEXT %>
  288. </TD>
  289. <TD>
  290. <%= sFont("","","",True) %>
  291. <INPUT TYPE="text" NAME="hdnLogFileName" VALUE="" SIZE=<%= L_LOGFILETEXT_NUM %> DISABLED onChange="setLogFile(document.userform.LogFilePeriod.value);" <%= Session("DEFINPUTSTYLE") %>>
  292. </TD>
  293. </TR>
  294. </TABLE>
  295. </TD>
  296. </TR>
  297. </TABLE>
  298. </FORM>
  299. </A>
  300. <% if Session("setLogUI") = "EXT" then %>
  301. <A NAME="EXT">
  302. <TABLE WIDTH =90% HEIGHT = <%= L_PAGEHEIGHT_NUM %>>
  303. <TR>
  304. <TD COLSPAN = 2>
  305. <%= sFont("","","",True) %>
  306. <B><%= L_EXTPROPERTIES_TEXT %></B>
  307. </FONT>
  308. </TD>
  309. </TR>
  310. <TR>
  311. <TD VALIGN= "TOP" >
  312. <P>&nbsp;
  313. <% if Session("IsIE") then %>
  314. <IFRAME NAME="EXTFRAME" WIDTH = <%= L_PROPTREEFRAME_W %> HEIGHT = <%= L_PROPTREEFRAME_H %> SRC="iilogext.asp">
  315. <FRAME NAME="EXTFRAME" WIDTH = <%= L_PROPTREEFRAME_W %> HEIGHT = <%= L_PROPTREEFRAME_H %> SRC="iilogext.asp">
  316. </IFRAME>
  317. <% else %>
  318. <!--#include file="iilogext.inc"-->
  319. <% end if %>
  320. </TD>
  321. </TR>
  322. </TABLE>
  323. </FORM>
  324. </A>
  325. <% end if %>
  326. <% end if %>
  327. <SCRIPT LANGUAGE="JavaScript">
  328. <% if not Session("setLogUI") = "ODBC" then %>
  329. <% if Session("hasDHTML") then %>
  330. self.location.href="#GENERAL";
  331. <% else %>
  332. <% if not Session("IsIE") then %>
  333. document.userform.rdoLogFilePeriod[0].focus();
  334. <% end if %>
  335. <% end if %>
  336. <% end if %>
  337. </SCRIPT>
  338. </FONT>
  339. </BODY>
  340. </HTML>