home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 February
/
CHIP_2_98.iso
/
software
/
pelne
/
optionp
/
ins.cab
/
nngrphd.asp
< prev
next >
Wrap
Text File
|
1997-10-23
|
11KB
|
374 lines
<% Response.Expires = 0 %>
<%
REM LOCALIZATION
L_PAGETITLE_TEXT = "Microsoft Internet Service Manager"
L_ERRORIS_TEXT = "Error is: "
L_ENTERNEWSGROUPNAME_TEXT = "Please enter a newsgroup name."
L_CONFIRMDELETE_TEXT = "Are you sure you want to remove this newsgroup?"
L_HEADTITLE_TEXT = "Newsgroups on"
L_NEWSGROUPNAME_TEXT = "Newsgroup name:"
L_FINDBUTTON_TEXT = "Find"
L_DISPLAYRESULTS_TEXT = "Displaying newsgroups "
L_MATCHINGNEWSGROUPS_TEXT = " matching newsgroups."
L_TITLEMATCHINGNEWSGROUP_TEXT = "Matching Newsgroup"
L_TITLEMATCHINGNEWSGROUPS_TEXT = "Matching Newsgroups"
L_NOMATCHINGROUPS_TEXT = "No matching groups"
L_RESULTS_TEXT = "Results: "
L_ACCESSDENIED_TEXT = "Error: Access is Denied."
L_OPEN_TEXT = "open" 'Internal String do NOT localize
L_REMOVE_TEXT = "remove" 'Internal String do NOT localize
REM END LOCALIZATION
%>
<SCRIPT LANGUAGE="javascript">
<% REM Get starting number for groups to show %>
<% startNum = Request("startNum") %>
<% REM if startNum has a value then use it, otherwise use start value of 1 %>
<% if (startNum = "") then %>
<% startNum = 1 %>
<% end if %>
<% startNumClean = startNum %>
<% REM Set number of groups to display per page %>
<% GroupsPerPage = 10 %>
<% REM GET ACTION VARIABLE %>
<% REM VALUE IS "remove" OR NOTHING %>
<% a = Request("a") %>
<% svr = Session("svr") %>
<% REM create nntp admin object %>
<% On Error Resume Next %>
<% Set GroupAdm = Server.CreateObject("nntpadm.groups") %>
<% if Err <> 0 then %>
<p>
<% = L_ACCESSDENIED_TEXT %>
alert(' <% = L_ERRORIS_TEXT %><% = Err.description %> ');
<% end if %>
<% REM get server name %>
<% GroupAdm.Server = svr %>
<% REM set service instance %>
<% GroupAdm.ServiceInstance = Session("ServiceInstance") %>
<% Session("find") = Request("find") %>
<% if (Session("find") <> "") then %>
<% FindNewsgroup = Session("Find") %>
<% else %>
<% FindNewsgroup = Request("find") %>
<% end if %>
<% if (FindNewsgroup = "") then %>
<% FindNewsgroup = "*" %>
<% end if %>
<% REM set Newsgroup to current value of "group" %>
<% Newsgroup = Request("group") %>
<% REM Remove Group if "a" == "remove" %>
<% if (a = L_REMOVE_TEXT) then %>
<% NewsgroupToDelete = Request("NewsgroupToDelete") %>
<% On Error Resume Next %>
<% GroupAdm.Remove(NewsgroupToDelete) %>
<% if Err <> 0 then %>
alert ( "<% = L_ERRORIS_TEXT %><% = Err.description %>" );
<% end if %>
<% end if %>
<!--#include file="_cnst.asp" -->
<% if (cont = true) then %>
</script>
<% REM START OF HTML %>
<HTML>
<HEAD>
<script language="javascript">
<% REM Determine browser to set pop-up window size %>
<% if Instr(Request.ServerVariables("HTTP_USER_AGENT"), "IE 4", 1) then %>
winstr = "width=430,height=380,directories=no,status=no,scrollbars=no,resize=no";
<% elseif Instr(Request.ServerVariables("HTTP_USER_AGENT"),"MSIE") then %>
winstr = "width=390,height=280,directories=no,status=no,scrollbars=no,resize=no";
<% else %>
winstr = "width=420,height=350,menubar=no,directories=no,status=no,scrollbars=no,resize=no";
<% end if %>
<% REM Create uForm object and methods %>
var uForm = new Object();
uForm.itemList = new Array();
uForm.startNum = "<% = startNum %>";
uForm.GroupsPerPage = <% = GroupsPerPage %>;
uForm.selectedItem = uForm.startNum - 1;
uForm.editItem = editItem;
uForm.selectItem = selectItem;
uForm.loadList = loadList;
uForm.removeItem = removeItem;
uForm.addItem = addItem;
uForm.next = next;
uForm.previous = previous;
uForm.refresh = refresh;
uForm.FindNewsgroup = top.menu.document.hiddenform.txtFindNewsgroup.value;
uForm.startNumClean = "<% = startNumClean %>";
<% maxReturn = 1000 %>
<% groupadm.server = svr %>
<% groupadm.serviceinstance = Session("ServiceInstance") %>
<% On Error Resume Next %>
<% GroupAdm.Find findnewsgroup, maxReturn %>
<% if Err <> 0 then %>
alert( "<% = Err.description %> ");
<% end if %>
<% numGroups = GroupAdm.Count %>
uForm.numGroups = "<% = numGroups %>";
top.menu.document.hiddenform.nNewsgroupListStart.value = "<% = startNum %>";
<% i = startNum - 1 %>
<% while( (i < numGroups) AND ( i < (startNum + GroupsPerPage - 1) ) ) %>
<% On Error Resume Next %>
<% x = GroupAdm.MatchingGroup( i ) %>
<% do while ( Err <> 0 ) %>
alert ( "<% = L_ERRORIS_TEXT %><% = Err.description %>" );
<% exit do %>
<% loop %>
<% On Error Resume Next %>
<% GroupAdm.Get(x) %>
<% if ( Err <> 0 ) then %>
alert ( "<% = L_ERRORIS_TEXT %><% = Err.description %>" );
<% end if %>
uForm.itemList[<% = i %>] = new Object();
uForm.itemList[<% = i %>].newsgroup = "<% = GroupAdm.Newsgroup %>";
uForm.itemList[<% = i %>].description = "<% = Server.URLEncode( GroupAdm.Description ) %>";
uForm.itemList[<% = i %>].readOnly = "<% = GroupAdm.ReadOnly %>";
uForm.itemList[<% = i %>].moderator = "<% = GroupAdm.Moderator %>";
if( uForm.itemList[<% = i %>].moderator != "" )
{
uForm.itemList[<% = i %>].moderated = "1";
}
else
{
uForm.itemList[<% = i %>].moderated = "0";
}
<% i = i + 1 %>
<% Wend %>
<% startNum = startNum + GroupsPerPage %>
top.menu.document.hiddenform.nNewsgroupListStart.value = "<% = startNum %>";
function next()
{
if( parseInt(top.menu.document.hiddenform.nNewsgroupListStart.value) <= parseInt(uForm.numGroups) )
{
parent.head.location = "nngrphd.asp?svr=<% = svr %>&startNum=" + top.menu.document.hiddenform.nNewsgroupListStart.value + "&find=" + top.menu.document.hiddenform.txtFindNewsgroup.value;
}
}
function previous()
{
sum = uForm.GroupsPerPage + 1;
if( sum != parseInt(top.menu.document.hiddenform.nNewsgroupListStart.value) )
{
parent.head.location = "nngrphd.asp?svr=<% = svr %>&startNum=" + (top.menu.document.hiddenform.nNewsgroupListStart.value - ( uForm.GroupsPerPage * 2 ) ) + "&find=" + top.menu.document.hiddenform.txtFindNewsgroup.value;
}
}
function refresh()
{
parent.head.location = "nngrphd.asp?svr=<% = svr %>&startNum=&find=" + top.menu.document.hiddenform.txtFindNewsgroup.value;
}
function onUpdateList(nDirection)
{
var oldvalue = parseInt ( top.menu.document.hiddenform.nNewsgroupListStart.value );
var newvalue = nDirection * 5 + oldvalue;
if ( nDirection == 0 )
{
newvalue = 0;
}
top.menu.document.hiddenform.nNewsgroupListStart.value = newvalue;
parent.head.location = "nngrphd.asp?svr=<% = svr %>&startNum=" + top.menu.document.hiddenform.nNewsgroupListStart.value + "&find=" + top.menu.document.hiddenform.txtFindNewsgroup.value;
}
function checkValue()
{
if (document.userform.txtFindNewsgroup.value==""){
alert("<% = L_ENTERNEWSGROUPNAME_TEXT %>");
document.userform.txtFindNewsgroup.focus();
return false;
}
else {
return true;
}
}
<% REM when the find href receives a mouseDown %>
function onFind()
{
if (checkValue())
{
top.menu.document.hiddenform.txtFindNewsgroup.value = document.userform.txtFindNewsgroup.value;
uForm.refresh();
}
}
<% REM Javascript function selectItem (if IE, reloads list at specified position -- broken in Netscape) %>
function selectItem(index)
{
uForm.selectedItem = index;
parent.list.location.href = "nngrpls.asp";
}
<% REM Javascript function addItem %>
function addItem()
{
win = window.open("nngrped.asp?svr=<% = svr %>&a=new","PropWindow",winstr);
if (win.opener == null)
{
win.opener = self;
}
}
<% REM Javascript function editItem %>
function editItem()
{
if(uForm.numGroups > 0)
{
index = uForm.selectedItem;
Newsgroup = uForm.itemList[index].newsgroup;
Description = uForm.itemList[index].description;
readOnly = uForm.itemList[index].readOnly;
Moderator = uForm.itemList[index].moderator;
Moderated = uForm.itemList[index].moderated;
win = window.open("nngrped.asp?svr=<% = svr %>&a=edit&Group=" + Newsgroup + "&txtDescription=" + Description + "&hdnReadOnly=" + readOnly + "&txtModerator=" + Moderator + "&hdnModerated=" + Moderated + "&index=" + index,"PropWindow",winstr);
if (win.opener == null)
{
win.opener = self;
}
}
}
<% REM Javascript function removeItem %>
function removeItem()
{
if (confirm("<% = L_CONFIRMDELETE_TEXT %>"))
{
index = uForm.selectedItem;
NewsgroupToDelete = uForm.itemList[index].newsgroup;
self.location = "nngrphd.asp?svr=<% = svr %>&a=remove&NewsgroupToDelete=" + NewsgroupToDelete;
}
}
function onLoad()
{
document.userform.txtFindNewsgroup.value = top.menu.document.hiddenform.txtFindNewsgroup.value;
}
<% REM Javascript function loadList loads list frame after header is completed %>
function loadList()
{
parent.list.location = "nngrpls.asp?svr=<% = svr %>";
}
</SCRIPT>
<TITLE><% = L_PAGETITLE_TEXT %></TITLE>
</HEAD>
<BODY TEXT="#000000" LINK="#FFFFFF" ALINK="#FFFFFF" BGCOLOR="#CCCCCC" TOPMARGIN=10 VLINK="#FFFFFF">
<FORM NAME="userform" ACTION="" onSubmit = "onFind(); return false;" METHOD="post">
<TABLE BORDER="0">
<TR>
<TD COLSPAN=2>
<P><IMG SRC="images/gnicttl.gif" ALIGN="textmiddle" HEIGHT=10 WIDTH=10> <FONT SIZE=2 FACE="Arial"><B><% = L_HEADTITLE_TEXT %> </B></FONT><FONT SIZE=3 FACE="Times New Roman"><I><% = svr %></I><BR> </FONT>
</TD>
</TR>
<TR>
<TD WIDTH=25> </TD>
<TD><FONT SIZE=2 FACE="Arial">
<% = L_NEWSGROUPNAME_TEXT %> <INPUT TYPE = "text" NAME = "txtFindNewsgroup">
</TD>
<TD>
<TABLE BORDER="0" CELLPADDING=5 CELLSPACING=2>
<TR>
<TD VALIGN="bottom" BGCOLOR="#555555">
<FONT FACE="Arial" SIZE=2>
<B><A HREF="javascript:onFind();">
<% = L_FINDBUTTON_TEXT %></A></B>
</FONT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD WIDTH=25> </TD>
<TD COLSPAN = 2>
<FONT SIZE=2 FACE="Arial">
<BR>
<% if (numGroups = 0) then %>
<% = L_NOMATCHINGROUPS_TEXT %><br>
<% else %>
<% = L_RESULTS_TEXT %><b><% = startNumClean %></b> - <b><% if( (startNumClean + GroupsPerPage - 1) < numGroups ) then %>
<% = startNumClean + GroupsPerPage - 1 %><% else %><% = numGroups %><% end if %></b> out of <b><% = numGroups %></b></br>
<% end if %>
</FONT>
</TD>
</TR>
<TR>
<TD COLSPAN=2 HEIGHT=4></TD>
</TR>
</TABLE>
</FORM>
<TABLE CELLPADDING=2 CELLSPACING=0 BORDER=0 WIDTH=400>
<TR>
<TD WIDTH=10>
</TD>
<TD WIDTH=390>
<B><FONT SIZE=2 FACE="Arial"><% = L_TITLEMATCHINGNEWSGROUPS_TEXT %></FONT></B>
</TD>
</TR>
</TABLE>
<% REM Load list page after head has completely loaded %>
<% if ( (a = L_OPEN_TEXT) OR (a = L_REMOVE_TEXT) ) then %>
<SCRIPT LANGUAGE="javascript">
parent.head.location = "nngrphd.asp?svr=<% = svr %>&find=" + top.menu.document.hiddenform.txtFindNewsgroup.value;
</SCRIPT>
<% else %>
<SCRIPT LANGUAGE="javascript">
timeList = setTimeout('loadList()',500);
onLoad();
</SCRIPT>
<% end if %>
</BODY>
</HTML>
<% end if %>