home *** CD-ROM | disk | FTP | other *** search
- <% Response.Expires = 0 %>
-
- <% a = Request("a") %>
- <% svr = Request("svr") %>
- <%
- rem BEGIN LOCALIZATION
-
- L_STARTED = 2
- L_ADD_EXPIRATION_TXT = "Add Expiration Policy"
- L_NO_SERVICE_TXT = "The NNTP Service is not started, You must start the service before you can add an Expiration Policy."
-
-
- REM END LOCALIZATION
- %>
- <!--#include file="_cnst.asp" -->
-
- <% if (cont = true) then %>
-
- <% REM Create Nntp admin object To check to see if the service is running%>
-
- <% On Error Resume Next %>
- <% Set Admin = Server.CreateObject("NntpAdm.Admin.1") %>
- <% if Err <> 0 then %>
- <script language="javascript>
- alert("<% = Err.description %> : Line #42");
- </script>
- <% end if %>
-
- <% On Error Resume Next %>
- <% set nntpService = Server.CreateObject("Nntpadm.VirtualServer.1") %>
- <% if (Err <> 0 ) then %>
- <script language="javascript">
- alert("<% = L_SERVICE_ERROR%><% = Err.description %>");
- </script>
- <% end if %>
-
- <% REM Set nntp Service Server %>
- <% On Error Resume Next %>
- <% nntpService.Server = svr %>
- <% if (Err <> 0 ) then %>
- <script language="javascript">
- alert("<% = L_SERVICE_ERROR%><% = Err.description %>");
- </script>
- <% end if %>
-
- <% REM Set nntp Service Service Instance %>
- <% On Error Resume Next %>
- <% nntpService.ServiceInstance = Session("ServiceInstance") %>
- <% if (Err <> 0 ) then %>
- <script language="javascript">
- alert("<% = L_SERVICE_ERROR%><% = Err.description %>");
- </script>
- <% end if %>
-
-
- <% nntpService.Get %>
- <% ServerState = nntpService.State %>
-
- <% if (ServerState <> L_STARTED) then %>
- <script language="javascript">
- alert("<% = L_NO_SERVICE_TXT %>");
- self.close();
- </script>
- <% else %>
-
- <% 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") %>
-
- <HTML>
- <HEAD>
-
- <script language="javascript">
-
- <!--#include file="nnisnum.htm"-->
-
- function helpBox()
- {
- window.open("help/nnexpplh.htm","Help","toolbar=no,scrollbars=yes,directories=no,menubar=no,width=300,height=425");
- }
-
- function checkPolicy()
- {
- ExpSizeHorizon = document.userform.ExpSizeHorizon;
- hExpSizeHorizon = document.userform.hExpSizeHorizon;
- ExpTime = document.userform.ExpTime;
- hExpTime = document.userform.hExpTime;
-
- if (document.userform.ExpPolicy[0].checked) {
- ExpTime.value = hExpTime.value;
- if (ExpSizeHorizon.value != "-1") {
- hExpSizeHorizon.value = ExpSizeHorizon.value;
- }
- ExpSizeHorizon.value = "";
- }
- else {
- if (document.userform.ExpPolicy[1].checked) {
- ExpSizeHorizon.value = hExpSizeHorizon.value;
- if (ExpTime.value != "-1") {
- hExpTime.value = ExpTime.value;
- }
- ExpTime.value = "";
- }
- else {
- if (ExpTime.value==""){
- ExpTime.value = hExpTime.value;
- }
- if (ExpSizeHorizon.value==""){
- ExpSizeHorizon.value = hExpSizeHorizon.value;
- }
- }
- }
- }
-
-
- function okAdd() {
- document.userform.submit();
- }
-
- function closeAdd(id) {
- self.close();
- opener.location = "nnexphd.asp?svr=<% = svr %>&a=add&id=" + id;
- }
-
- function checkMax(cntrl,hiddencntrl) {
- if (isNum(cntrl.value)) {
- hiddencntrl.value = cntrl.value;
- if ((document.userform.ExpTime.value != "") && (document.userform.ExpSizeHorizon.value != "")) {
- document.userform.ExpPolicy[2].checked = true;
- }
- checkPolicy();
- }
- else {
- cntrl.value = hiddencntrl.value;
- cntrl.focus();
- }
- }
-
- </SCRIPT>
- <TITLE><% = L_ADD_EXPIRATION_TXT %></TITLE>
-
- </HEAD>
-
- <% On Error Resume Next %>
- <% ExpireObj.Default %>
- <% if ( Err <> 0 ) then %>
- <script language="javascript">
- alert( "<% = Err.description %>" );
- </script>
- <% end if %>
-
- <% if (a = "add") then %>
-
- <% ExpPolicy = Request("ExpPolicy") %>
- <% ExpTime = ExpireObj.ExpireTime %>
- <% ExpTime = ExpTime * 24 %>
- <% ExpSizeHorizon = Request("ExpSizeHorizon") %>
-
- <% if (ExpPolicy = "date") then %>
- <% ExpireObj.ExpireTime = ExpTime %>
- <% ExpireObj.ExpireSize = -1 %>
- <% elseif (ExpPolicy = "size") then %>
- <% ExpireObj.ExpireSize = ExpSizeHorizon %>
- <% ExpireObj.ExpireTime = -1 %>
- <% else %>
- <% ExpireObj.ExpireTime = ExpTime %>
- <% ExpireObj.ExpireSize = ExpSizeHorizon %>
- <% end if %>
-
- <% ExpireObj.PolicyName = "a" %>
- <% dim x(0) %>
- <% x(0) = "*" %>
- <% expireobj.NewsgroupsVariant = x %>
-
- <% REM ExpireObj.Enumerate %>
- <% On Error Resume Next %>
- <% ExpireObj.Add %>
- <% if (Err <> 0) then %>
- <SCRIPT LANGUAGE="javascript">
- alert ( "<% = Err.description %>" );
- self.location = "nnexpad.asp?svr=<% = svr %>"
- </SCRIPT>
- <% else %>
- <% id = ExpireObj.ExpireId %>
- <BODY BGCOLOR="#000000" TOPMARGIN=15 LINK="#000000" VLINK="#000000" ALINK="#000000" onLoad="closeAdd('<% = id %>');">
- <% end if %>
- <% else %>
-
- <BODY BGCOLOR="#000000" TOPMARGIN=15 TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000">
- <% REM <BODY BGCOLOR="#000000" TOPMARGIN=15 TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000"> %>
-
- <FORM NAME="userform" METHOD="post" ACTION="nnexpad.asp">
-
- <INPUT NAME="a" TYPE="hidden" VALUE="add">
- <INPUT NAME="svr" TYPE="hidden" VALUE="<% = svr %>">
-
- <TABLE BORDER="1" BGCOLOR="#CCCCCC" WIDTH=100% HEIGHT=80% CELLPADDING=10>
-
- <TR>
- <TD>
-
- <P><IMG SRC="images/gnicttl.gif" ALIGN="textmiddle" HEIGHT=10 WIDTH=10>
- <FONT SIZE=2 FACE="Arial"><B>Add Expiration Policy on </B></FONT>
- <FONT SIZE=3 FACE="Times New Roman"><I><% = svr %></I></FONT>
-
- <FONT SIZE=2 FACE="Arial">
-
- <P>
- <TABLE WIDTH=400 BORDER="0" ALIGN="left">
-
- <TR>
- <TD WIDTH=200><INPUT NAME="ExpPolicy" TYPE="radio" VALUE="date" onClick="checkPolicy();"> <FONT SIZE=2 FACE="Arial">Newsgroups older than</FONT></TD>
- <TD WIDTH=200>
-
- <% ExpTime = ExpireObj.ExpireTime %>
- <% ExpTime = ExpTime / 24 %>
-
- <FONT SIZE=2 FACE="Arial">
- max <INPUT NAME="ExpTime" TYPE="text" SIZE=5 onChange="checkMax(document.userform.ExpTime,document.userform.hExpTime);" VALUE="<% = ExpTime %>"> days</FONT>
- <INPUT NAME="hExpTime" TYPE="hidden" VALUE="<% = ExpTime %>">
- </TD>
- </TR>
- <TR>
- <TD HEIGHT=4 BGCOLOR="#CCCCCC"></TD>
- </TR>
- <TR>
- <TD WIDTH=200><FONT SIZE=2 FACE="Arial"><INPUT NAME="ExpPolicy" TYPE="radio" VALUE="size" onClick="checkPolicy();"> Newsgroups bigger than</TD>
- <TD WIDTH=200>
-
- <% ExpSizeHorizon = ExpireObj.ExpireSize %>
-
- <FONT SIZE=2 FACE="Arial">
- max <INPUT NAME="ExpSizeHorizon" TYPE="text" SIZE=5 onChange="checkMax(document.userform.ExpSizeHorizon,document.userform.hExpSizeHorizon);" VALUE="<% = ExpSizeHorizon %>"> MB</FONT>
- <INPUT NAME="hExpSizeHorizon" TYPE="hidden" VALUE="<% = ExpSizeHorizon %>">
- </TD>
- </TR>
- <TR>
- <TD COLSPAN=2 HEIGHT=4 BGCOLOR="#CCCCCC"></TD>
- </TR>
- <TR>
- <TD COLSPAN=2>
- <FONT SIZE=2 FACE="Arial">
- <INPUT NAME="ExpPolicy" TYPE="radio" VALUE="both" onClick="checkPolicy();" CHECKED> Both
- </FONT>
- </TD>
- </TR>
-
- </TABLE>
-
- </TD>
- </TR>
-
- </TABLE>
-
- <P>
- <TABLE ALIGN="right" CELLPADDING=1 CELLSPACING=1>
- <TR>
- <TD><TABLE VALIGN="top" BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#FFCC00">
- <TR>
- <TD VALIGN="middle">
- <FONT FACE="Arial" SIZE=2>
- <A HREF="javascript:okAdd();">
- <IMG SRC="images/gnicok.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A>
- <B><A HREF="javascript:okAdd();">OK</A></B>
- </FONT>
- </TD>
- </TR>
- </TABLE>
- </TD>
- <TD><TABLE VALIGN="top" BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#FFCC00">
- <TR>
- <TD VALIGN="middle">
- <FONT FACE="Arial" SIZE=2>
- <A HREF="javascript:close();">
- <IMG SRC="images/gniccncl.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A>
- <B><A HREF="javascript:close();">Cancel</A></B>
- </FONT>
- </TD>
- </TR>
- </TABLE>
- </TD>
- <TD><TABLE VALIGN="top" BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#FFCC00">
- <TR>
- <TD VALIGN="middle">
- <FONT FACE="Arial" SIZE=2>
- <B><A HREF="javascript:helpBox();"><IMG HEIGHT=16 WIDTH=16 ALIGN="top" SRC="images/gnichelp.gif" BORDER=0 ALT="Help"></A>
- <A HREF="javascript:helpBox();">Help</A></B>
- </FONT>
- </TD>
- </TR>
- </TABLE></TD>
-
- <TD> </TD>
- </TR>
- </TABLE>
-
- <% end if %>
-
- </BODY>
- </HTML>
-
- <% end if %>
- <% end if %>
-