home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 February
/
CHIP_2_98.iso
/
software
/
pelne
/
optionp
/
iis4_03.cab
/
iifilthd.asp
< prev
next >
Wrap
Text File
|
1997-11-14
|
8KB
|
333 lines
<%@ LANGUAGE=VBScript %>
<% Option Explicit %>
<% Response.Expires = 0 %>
<% if Session("FONTSIZE") = "" then %>
<!--#include file="iito.inc"-->
<% else %>
<%
Const L_ENTERINTEGER_ERRORMESSAGE = "Please enter an integer"
Const L_FILTERS_TEXT = "ISAPI Filters"
Const L_FILTERORDER_TEXT = "Filters installed here are active for this Web site only. Filters are executed In the order listed below."
Const L_FILTER_TEXT = "Filter"
Const L_STATUS_TEXT = "Status"
Const L_EXE_TEXT = "Executable"
Const L_PRIORITY_TEXT = "Priority"
Const L_ACCESSDENIED_TEXT = "Access Denied"
Const L_HIGH_TEXT = "High"
Const L_MEDIUM_TEXT = "Medium"
Const L_LOW_TEXT = "Low"
Const L_SELECTITEM_TEXT = "Please select a filter to delete."
Const L_LOADED_TEXT = "Loaded"
Const L_LOADING_TEXT = "Loading"
Const L_UNLOADED_TEXT = "Unloaded"
Const L_UNLOADING_TEXT = "Unloading"
On Error Resume Next
Dim path, currentobj
path = Session("spath")
Session("path") = Session("spath")
Set currentobj = GetObject(path)
Session("SpecObj")=path & "/Filters"
Session("SpecProps")=""
function heading(width,thestring)
Dim i
width = width - len(thestring)
for i = width to 0 step -1
thestring = thestring & " "
Next
heading = thestring
end function
%>
<!--#include file="iiset.inc"-->
<HTML>
<HEAD>
<TITLE></TITLE>
<FONT SIZE=1 FACE="Helv,ARIAL">
<SCRIPT LANGUAGE="JavaScript">
top.title.Global.helpFileName="iipy_31";
top.title.Global.siteProperties = true;
function SetList(){
self.location.href = "iiapphd.asp"
}
function isNum(txtcntrl) {
str = txtcntrl.value;
for (var i = 0; i < str.length; i++) {
var ch = str.substring(i, i + 1);
if ((ch < "0" || "9" < ch) && ch != ',') {
alert("Please enter an integer.");
txtcntrl.focus()
return false;
}
}
return true;
}
function disableDefault(dir,fromCntrl, toCntrl){
if (!dir){
if (fromCntrl.value != ""){
toCntrl.value = fromCntrl.value;
fromCntrl.value = "";
}
}
else{
if (toCntrl.value != ""){
fromCntrl.value = toCntrl.value;
toCntrl.value = "";
}
}
}
function enableDefault(chkCntrl){
chkCntrl.checked = true;
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#CCCCCC" TOPMARGIN=5 TEXT="#000000" onLoad="loadList();" LINK="#000000" VLINK="#000000" STYLE="font-face: Helv,Arial; font-size:10pt;">
<FORM NAME="userform" onSubmit="return false"><FONT SIZE=1 FACE="Helv,ARIAL">
<B><%= L_FILTERS_TEXT %></B><P>
<%= L_FILTERORDER_TEXT %><P>
<TABLE BORDER = 1 BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#CCCCCC" BORDERCOLORLIGHT="#CCCCCC" CELLPADDING = 2 CELLSPACING = 0>
<TR>
<TD WIDTH = 50 BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000"><FONT SIZE=1 FACE='HELV,ARIAL'>
<%= heading(9,L_STATUS_TEXT) %>
</TD>
<TD WIDTH = 50 BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000"><FONT SIZE=1 FACE='HELV,ARIAL'>
<%= heading(9,L_PRIORITY_TEXT) %>
</TD>
<TD WIDTH = 100 BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000" ><FONT SIZE=1 FACE='HELV,ARIAL'>
<%= heading(25,L_FILTER_TEXT) %>
</TD>
<TD WIDTH = 250 BORDERCOLOR="#CCCCCC" BORDERCOLORDARK="#FFFFFF" BORDERCOLORLIGHT="#000000"><FONT SIZE=1 FACE='HELV,ARIAL'>
<%= heading(65,L_EXE_TEXT) %>
</TD>
</TR>
</TABLE>
<SCRIPT LANGUAGE="JavaScript">
function loadList(){
parent.list.location.href = "iifiltls.asp";
}
function moveItem(dir){
sel = eval(listFunc.sel);
if (sel > -1){
if (!cachedList[sel].deleted){
if ((sel + dir >= 0) && (sel + dir < (cachedList.length))){
cachedList[sel].id += dir;
cachedList[sel].updated = true;
sel += dir;
cachedList[sel].id -= dir;
listFunc.sel = sel;
cachedList.sort(sortOrder);
loadList();
}
}
}
}
function sortOrder(a,b){
x=a.id - b.id
return x
}
function addItem(){
i = cachedList.length
cachedList[i] = new listObj(i,"New Filter", 4, "", "","");
cachedList[i].newitem = true;
cachedList[i].updated = true;
listFunc.sel = i;
loadList();
}
function delItem(){
sel = eval(listFunc.sel);
if (sel < 0){
alert("<%= L_SELECTITEM_TEXT %>");
}
else{
cachedList[sel].deleted = true;
cachedList[sel].updated = true;
sel = sel-1;
<% 'run through the list to find the Next non-deleted item %>
for (var j = sel; j >= 0; j--) {
if (cachedList[j].deleted){
}
else{
break
}
}
listFunc.sel = j;
loadList();
}
}
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].deleted){
numrows = numrows + 1;
}
}
qstr = "numrows="+numrows;
qstr = qstr+"&cols=FilterName&cols=FilterPath";
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].deleted){
listForm.elements[j++].value = cachedList[i].filter;
listForm.elements[j++].value = cachedList[i].filterpath;
cachedList[i].updated = false;
}
}
}
function listFuncs(){
this.sel = -1;
this.addItem = addItem;
this.delItem = delItem;
this.writeList = buildListForm;
this.SetListVals = SetListVals;
}
function statMsg(num){
if (num == 0){
return "<%= L_LOADED_TEXT %>"
}
if (num == 3){
return "<%= L_LOADING_TEXT %>"
}
if (num == 4){
return "<%= L_UNLOADED_TEXT %>"
}
if (num == 2){
return "<%= L_UNLOADING_TEXT %>"
}
}
function listObj(id,f,s,e,en,p){
this.id = id;
this.filter = f;
this.status=s;
this.displaystatus = statMsg(s);
this.filterpath=e;
this.displayexe = crop(e,35);
this.enabled = en;
this.priority = p;
this.order = id;
this.deleted = false;
this.newitem = false;
this.updated = false;
this.crop = crop;
}
cachedList = new Array();
<%
Dim filterspath, filtersCollection, loadOrder, i, filtername, fltr, priority
filterspath = path & "/Filters"
Set filtersCollection = GetObject(filterspath)
if err = 0 then
'bugbug... hack to get around MMC not setting Filters key type...
filtersCollection.KeyType = "IIsFilters"
filtersCollection.SetInfo
filtersCollection.GetInfo
loadOrder = filtersCollection.FilterLoadOrder
i = 0
do while len(loadOrder) > 0
if InStr(loadOrder,",") then
filtername = Trim(Left(loadOrder,InStr(loadOrder,",")-1))
loadOrder = Trim(Mid(loadOrder,InStr(loadOrder,",")+1))
else
filtername = Trim(loadOrder)
loadOrder = ""
end if
if filtername <> "" then
Set fltr = GetObject(filterspath & "/" & filtername)
if err = 0 then
if fltr.NotifyOrderHigh then
priority = L_HIGH_TEXT
elseif fltr.NotifyOrderMedium then
priority = L_MEDIUM_TEXT
elseif fltr.NotifyOrderLow then
priority = L_LOW_TEXT
else
priority = L_LOW_TEXT
end if
%>cachedList[<%= i %>] = new listObj(<%= i %>,"<%= filtername %>","<%= fltr.FilterState %>","<%= replace(fltr.FilterPath,"\","\\") %>","<%= fltr.FilterEnabled %>","<%= priority %>");<%
i = i+1
end if
end if
loop
end if
%>
listFunc = new listFuncs();
</SCRIPT>
</BODY>
</HTML>
<% end if %>