home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 February
/
CHIP_2_98.iso
/
software
/
pelne
/
optionp
/
iis4_03.cab
/
iierrhd.asp
< prev
next >
Wrap
Text File
|
1997-11-12
|
8KB
|
349 lines
<%@ LANGUAGE=VBScript %>
<%'Option Explicit %>
<% Response.Expires = 0 %>
<%
Const L_CERR_TEXT ="Custom Errors"
Const L_CUSTOMERR_TEXT="Custom Error Messages can be a text stream or a pointer to a file (such as an HTML document or an Active Server Page)"
Const L_ERROR_TEXT="HTTP Error"
Const L_OUTPUTTYPE_TEXT="Type"
Const L_TEXTORFILE_TEXT="Contents"
Const L_ACCESSDENIED_TEXT="Access Denied" %>
<%
function heading(width,thestring)
width=width - Len(thestring)
for i=width to 0 step -1
thestring=thestring & " "
Next
heading=thestring
end function
%>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY BGCOLOR="#CCCCCC" LINK="#000000" VLINK="#000000" TOPMARGIN=10 TEXT="#000000" >
<FORM NAME="userform">
<FONT SIZE=1 FACE="Helv,ARIAL">
<B><%= L_CERR_TEXT %></B>
<P>
<TABLE WIDTH=490 BORDER=0>
<TR>
<TD COLSPAN=3 STYLE="font-face: Helv,Arial; font-size:10pt;">
<FONT SIZE=1 FACE="Helv,ARIAL">
<%= L_CUSTOMERR_TEXT %>
<BR>
</FONT>
</TD>
</TR>
</TABLE>
<TABLE BORDER=1 BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#CCCCCC" BORDERCOLORLIGHT="#CCCCCC" CELLPADDING=2 CELLSPACING=0>
<TR>
<TD BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" STYLE="font-face: Helv,Arial; font-size:10pt;"><FONT SIZE=1 FACE="HELV,ARIAL">
<A HREF="javascript:sortList('error');">
<% if Session("FONTSIZE")="LARGE" then %>
<%= heading(12,L_ERROR_TEXT) %>
<% else %>
<%= heading(20,L_ERROR_TEXT) %>
<% end if %>
</A>
</FONT>
</TD>
<TD BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" STYLE="font-face: Helv,Arial; font-size:10pt;"><FONT SIZE=1 FACE="HELV,ARIAL">
<A HREF="javascript:sortList('outType');">
<% if Session("FONTSIZE")="LARGE" then %>
<%= heading(26,L_OUTPUTTYPE_TEXT) %>
<% else %>
<%= heading(18,L_OUTPUTTYPE_TEXT) %>
<% end if %>
</A>
</FONT>
</TD>
<TD BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" STYLE="font-face: Helv,Arial; font-size:10pt;"><FONT SIZE=1 FACE="HELV,ARIAL">
<A HREF="javascript:sortList('msgPath');">
<% if Session("FONTSIZE")="LARGE" then %>
<%= heading(90,L_TEXTORFILE_TEXT) %>
<% else %>
<%= heading(99,L_TEXTORFILE_TEXT) %>
<% end if %>
</A>
</FONT>
</TD>
</TR>
</TABLE>
</FORM>
<FORM name="hiddenform">
<INPUT TYPE="hidden" NAME="index" VALUE=-1>
</FORM>
</BODY>
<SCRIPT LANGUAGE="JavaScript">
top.title.Global.helpFileName="iipy_13";
function loadList(){
<% if Session("IsIE") then %>
parent.list.location.href = "iierrls.asp";
<% else %>
parent.frames[2].location.href="iierrls.asp";
<% end if %>
}
function addItem(){
}
function delItem(){
}
function setLastSel(id){
for (var i=0; i < cachedList.length; i++) {
if (cachedList[i].id == id){
document.hiddenform.index.value = i;
return;
}
}
}
function sortList(sortby)
{
i=eval(document.hiddenform.index.value);
if ( i != -1)
{
lastsel = cachedList[i].id
}
if (sortby != listFunc.sortby)
{
listFunc.sortby = sortby;
listFunc.sortAsc = true;
}
else
{
listFunc.sortAsc = !listFunc.sortAsc;
}
var num = parseFloat(cachedList[sortby]);
if (isNaN(num))
{
cachedList.sort(sortOrder);
}
else
{
cachedList.sort(numOrder);
}
if (!listFunc.sortAsc)
{
cachedList.reverse();
}
if ( i != -1)
{
setLastSel(lastsel);
}
loadList();
}
function sortOrder(a,b)
{
if (a[listFunc.sortby] < b[listFunc.sortby])
{
return -1;
}
else
{
if (a[listFunc.sortby] > b[listFunc.sortby])
{
return 1;
}
else
{
return 0;
}
}
}
function crop(thestring,size)
{
<% if Session("FONTSIZE") = "LARGE" then %>
size = size-10;
<% end if %>
if (thestring.length > size)
{
thestring = thestring.substring(0,size) + "...";
}
return thestring;
}
function buildListForm(){
numrows=0;
for (var i=0; i < cachedList.length; i++) {
if (cachedList[i].outType !=""){
numrows=numrows + 1;
}
}
qstr="numrows="+numrows;
qstr=qstr+"&cols=HttpErrors";
parent.parent.hlist.location.href="iihdn.asp?"+qstr;
<% 'the list values will be grabbed by the hiddenlistform script... %>
}
function SetListVals(){
listForm = parent.parent.hlist.document.hiddenlistform;
j=0;
for (var i=0; i < cachedList.length; i++) {
if (cachedList[i].outType !=""){
if (cachedList[i].Subcode == 0){
sc = "*";
}
else{
sc = cachedList[i].Subcode;
}
listForm.elements[j++].value=cachedList[i].error+","+sc+","+cachedList[i].outType+","+cachedList[i].msgPath;
}
cachedList[i].updated=false;
}
}
function listFuncs(){
this.addItem=addItem;
this.delItem=delItem;
this.writeList=buildListForm;
this.SetListVals=SetListVals;
}
function listObj(i,e,s,o,p,d,t){
this.id = i;
this.error=e;
this.Subcode=s;
this.outType=o;
this.msgPath=p;
this.msgDefault=d;
this.types=t;
this.deleted=false;
this.newitem=false;
this.updated=false;
//lookup from Custom_Error_Desc
if (s !=0){
this.errcode=e +":" + s;
}
else{
this.errcode=e
}
this.displayPath = crop(this.msgPath,50);
}
cachedList=new Array()
<%
On Error Resume Next
Dim path, currentobj, infoobj, i, ErrItem, thisErr
Dim aErrs, aErrDescs
path=Session("dpath")
Session("path")=path
Session("SpecObj")=""
Session("SpecProps")=""
Set currentobj=GetObject(path)
Set infoobj=GetObject("IIS://localhost/w3svc/info")
aErrs=currentobj.GetEx("HttpErrors")
aErrDescs=infoobj.GetEx("CustomErrorDescriptions")
if err <> 0 then
%>cachedList[0]=new listObj("","","","","","");<%
else
i = 0
For Each ErrItem in aErrDescs
thisErr=getError(ErrItem,aErrs)
%>cachedList[<%= i %>]=new listObj(<%= i %>, "<%= thisErr(0) %>","<%= thisErr(1) %>","<%= thisErr(2) %>","<%= thisErr(3) %>","<%= thisErr(4) %>", <%= thisErr(5) %>);<%
i = i+1
Next
Response.write "loadList();"
end if
function getError(errstr,aErrs)
'bug bug
On Error Resume Next
Dim i, one, two, three, four, five, error
Dim Subcode, errtext, Subcodetext, default, path, otype, thistype
Dim CErr, aCErr
one=Instr(errstr,",")
two=Instr((one+1),errstr,",")
three=Instr((two+1),errstr,",")
four=Instr((three+1),errstr,",")
five=Instr((four+1),errstr,",")
otype=0
error=Mid(errstr,1,(one-1))
subcode=Mid(errstr,(one+1),((two-one)-1))
errtext=Mid(errstr,(two+1), (three-two)-1)
subcodetext=Mid(errstr,(three+1), (four-three)-1)
otype=Mid(errstr,(four+1))
path=errtext & " " & Subcodetext
default=path
thistype=""
if aErrs(0) <> "" then
For Each CErr in aErrs
aCErr=getCustomErr(CErr)
if ((error=aCErr(0)) and (subcode=replace(aCErr(1),"*","0"))) then
thistype=aCErr(2)
path=aCErr(3)
exit for
end if
i = i + 1
Next
end if
getError=Array(error, subcode, thistype,path,default,otype)
end function
function getCustomErr(errstr)
Dim one, two, three, code, Subcode, src, path
one=Instr(errstr,",")
two=Instr((one+1),errstr,",")
three=Instr((two+1),errstr,",")
code=Mid(errstr,1,(one-1))
Subcode=Mid(errstr,(one+1),((two-one)-1))
src=Mid(errstr,(two+1), (three-two)-1)
path=Mid(errstr,(three+1))
path=replace(path,"\","\\")
getCustomErr=Array(code, Subcode, src, path)
end function
%>
listFunc=new listFuncs();
</SCRIPT>
</HTML>