home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 February
/
CHIP_2_98.iso
/
software
/
pelne
/
optionp
/
ins.cab
/
nnexphd.asp
< prev
next >
Wrap
Text File
|
1997-10-12
|
6KB
|
229 lines
<% Response.Expires = 0 %>
<% svr = Request("svr") %>
<% a = Request("a") %>
<% id = Request("id") %>
<% NewsName = Request("Name") %>
<%
L_PAGETITLE_TEXT = "Microsoft Internet Service Manager"
L_UNLIMITED_TEXT = "Unlimited"
L_EXPIRATIONREMOVE_TEXT = "Are you sure you want to remove this expiration policy?"
L_NAME_TEXT = "Name"
l_NEWSGROUPS_TEXT = "Newsgroups"
L_SIZE_TEXT = "Size (MB)"
L_TIME_TEXT = "Time (Days)"
L_MYID_TEXT = "ID"
L_ID_TEXT = "ID"
L_EXPIRATIONPOLICIESON_TEXT = "Expiration Policies on"
L_REMOVE_TEXT = "remove" 'Internal string do NOT localize
L_ADD_TEXT = "add" 'Internal string do NOT localize
%>
<!--#include file="_cnst.asp" -->
<% if (cont = true) then %>
<% On Error Resume Next %>
<% Set AdminObj = Server.CreateObject("NntpAdm.Admin.1") %>
<% if Err <> 0 then %>
<script language="javascript">
alert('<% = Err.description %> ');
</script>
<% end if %>
<% On Error Resume Next %>
<% Set ExpireObj = Server.CreateObject("NntpAdm.Expiration") %>
<% if Err <> 0 then %>
<script language="javascript">
alert('<% = Err.description %> ');
</script>
<% end if %>
<% REM get server name %>
<% ExpireObj.Server = svr %>
<% REM set service instance %>
<% ExpireObj.ServiceInstance = Session("ServiceInstance") %>
<% if (a = L_REMOVE_TEXT) then %>
<% ExpireObj.Enumerate %>
<% On Error Resume Next %>
<% ExpireObj.Remove(id) %>
<% if (Err <> 0) then %>
<script language="javascript">
alert ('<% = Err.description %> ' );
</script>
<% else %>
<SCRIPT LANGUAGE="javascript">
self.location = "nnexphd.asp?svr=<% = svr %>";
</SCRIPT>
<% end if %>
<% elseif (a = L_ADD_TEXT) then %>
<SCRIPT LANGUAGE="javascript">
top.toolbar.location = "nntl.asp?svr=<% = svr %>&pg=nnexpg";
top.menu.location = "nnemnu.asp?svr=<% = svr %>&pg=nnexpg&id=<% = id %>";
parent.location = "nnredir.asp";
</SCRIPT>
<% end if %>
<HTML>
<HEAD>
<SCRIPT LANGUAGE="javascript">
<% REM Determine browser to set pop-up window size %>
<% if Instr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") then %>
winstr = "toolbar=no,width=460,height=275,directories=no,status=no,scrollbars=auto,resize=no,menubar=no";
<% else %>
winstr = "toolbar=no,width=460,height=275,directories=no,status=no,scrollbars=auto,resize=no,menubar=no";
<% end if %>
<% REM Create uForm object and methods %>
var uForm = new Object();
uForm.itemList = new Array();
uForm.selectedItem = 0;
uForm.selectItem = selectItem;
uForm.loadList = loadList;
uForm.editItem = editItem;
uForm.removeItem = removeItem;
uForm.addItem = addItem;
<% On Error Resume Next %>
<% ExpireObj.Enumerate %>
<% if (Err <> 0) then %>
alert('<% = Err.description %> ' );
<% end if %>
var i = 0;
<% count = ExpireObj.count %>
<% For i = 0 To count - 1 %>
<% ExpireObj.GetNth (i) %>
<% Dim x %>
<% x = ExpireObj.NewsgroupsVariant %>
<% low = LBound(x) %>
<% high = UBound(x) %>
<% result = "" %>
<% For j = low To high %>
<% if (high < 1) then %>
<% result = result & x(j) %>
<% else %>
<% result = result & x(j) & ";" %>
<% end if %>
<% Next %>
<% result = AdminObj.Truncate (result, 23) %>
<% strNewsgroups = result %>
uForm.itemList[i] = new Object();
uForm.itemList[i].id = "<% = ExpireObj.ExpireId %>";
uForm.itemList[i].expString = "<% = strNewsgroups %>";
uForm.itemList[i].name = "<% = ExpireObj.PolicyName %>"
<% If ( ExpireObj.ExpireSize <> -1 ) Then %>
uForm.itemList[i].expSizeHorizon = "<% = ExpireObj.ExpireSize %>";
<% else %>
uForm.itemList[i].expSizeHorizon = "<% = L_UNLIMITED_TEXT %>";
<% end if %>
<% if ( ExpireObj.ExpireTime > 0 ) then %>
uForm.itemList[i].expTime = "<% = ExpireObj.ExpireTime %>";
<% else %>
uForm.itemList[i].expTime = "<% = L_UNLIMITED_TEXT %>";
<% end if %>
i++;
<% Next %>
<% REM Javascript function selectItem (if IE, reloads list at specified position -- broken in Netscape) %>
function selectItem(index)
{
uForm.selectedItem = index;
<% if Instr(Request.ServerVariables("HTTP_USER_AGENT"),"IE") then %>
if (index == 0)
{
parent.list.location = "nnexpls.asp"
}
else
{
parent.list.location = "nnexpls.asp#" + (index-1);
}
<% else %>
parent.list.location = "nnexpls.asp"
<% end if %>
}
function addItem()
{
win = window.open("nnexpad.asp?svr=<% = svr %>", "PropWindow",winstr);
if (win.opener == null)
{
win.opener = self;
}
}
function removeItem()
{
if(uForm.itemList.length > 0)
{
if (confirm("<% = L_EXPIRATIONREMOVE_TEXT %>"))
{
var id = uForm.itemList[uForm.selectedItem].id;
self.location = "nnexphd.asp?svr=<% = svr %>&a=remove&id=" + id;
}
}
}
function editItem()
{
if (uForm.itemList.length > 0)
{
top.toolbar.location = "nntl.asp?svr=<% = svr %>&pg=nnexppl";
top.menu.location="nnemnu.asp?svr=<% = svr %>&id="+ uForm.itemList[uForm.selectedItem].id;
}
}
<% REM Javascript function loadList loads list frame after header is completed %>
function loadList()
{
parent.list.location = "nnexpls.asp?svr=<% = svr %>";
}
</SCRIPT>
<TITLE><% = L_PAGETITLE_TEXT %></TITLE>
</HEAD>
<BODY BGCOLOR="#CCCCCC" TEXT="#000000" TOPMARGIN=10>
<TABLE CELLPADDING=2 CELLSPACING=0 BORDER=0 WIDTH=500>
<TR>
<TD COLSPAN=6>
<IMG SRC="images/gnicttl.gif" ALIGN="textmiddle" HEIGHT=10 WIDTH=10> <FONT SIZE=2 FACE="Arial"><B><% = L_EXPIRATIONPOLICIESON_TEXT %> </B></FONT><FONT SIZE=3 FACE="Times New Roman"><I><% = svr %></I><BR> </FONT>
</TD>
</TR>
<TR>
<TD WIDTH=30> </TD>
<TD ALIGN="left" WIDTH=150><FONT SIZE=2 FACE="Arial"><B><% = L_NAME_TEXT %></B></FONT></TD>
<TD ALIGN="left" WIDTH=150><FONT SIZE=2 FACE="Arial"><B><% = L_NEWSGROUPS_TEXT %></B></FONT></TD>
<TD ALIGN=left WIDTH=100><FONT SIZE=2 FACE="Arial"><B><% = L_SIZE_TEXT %></B></FONT></TD>
<TD ALIGN=left WIDTH=100><FONT SIZE=2 FACE="Arial"><B><% = L_TIME_TEXT %></B></FONT></TD>
<TD ALIGN=left WIDTH=100><FONT SIZE=2 FACE="Arial"><B><% = L_MYID_TEXT %></FONT></TD>
</TR>
</TABLE>
<SCRIPT LANGUAGE="javascript">
timeList = setTimeout('loadList()',500);
</SCRIPT>
</BODY>
</HTML>
<% end if %>