home *** CD-ROM | disk | FTP | other *** search
- <% Response.Expires = 0 %>
-
- <%
- REM LOCALIZATION
-
- L_MENU_TITLETXT = "MCIS-NS Administration"
- L_ERRORTXT = "Error is: "
- L_ALERT_ENTER_VALUETXT = "Please enter a newsgroup name."
- L_CONFIRM_DELETETXT = "Are you sure you want to remove this newsgroup?"
- L_HEAD_TITLETXT = "Newsgroups on"
- L_NEWSGROUP_NAMETXT = "Newsgroup name:"
- L_FIND_BUTTONTXT = "Find"
- L_DISPLAY_RESULTSTXT = "Displaying newsgroups "
- L_MATCHING_NEWSGROUPSTXT = " matching newsgroups."
- L_TITLE_MATCHING_NEWSGROUPTXT = "Matching Newsgroup"
- L_TITLE_MATCHING_NEWSGROUPSTXT = "Matching Newsgroups"
-
- 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>
- Error: Access is Denied.
- alert(' <% = L_ERRORTXT %><% = 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 = "remove") then %>
-
- <% NewsgroupToDelete = Request("NewsgroupToDelete") %>
-
- <% On Error Resume Next %>
- <% GroupAdm.Remove(NewsgroupToDelete) %>
- <% if Err <> 0 then %>
- alert ( "<% = L_ERRORTXT %><% = 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( "GroupAdm.Find error is: <% = Err.description %> ");
- <% end if %>
-
- <% numGroups = GroupAdm.Count %>
-
- uForm.numGroups = "<% = numGroups %>";
-
- //alert( 'numGroups: <% = numGroups %>\nstartNum is: <% = startNum %>\nGroupsPerPage is: <% = GroupsPerPage %>');
-
- 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_ERRORTXT %><% = Err.description %>" );
- <% exit do %>
- <% loop %>
-
- <% On Error Resume Next %>
- <% GroupAdm.Get(x) %>
- <% if ( Err <> 0 ) then %>
- alert ( "<% = L_ERRORTXT %><% = 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_ALERT_ENTER_VALUETXT %>");
- 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;
- <% if Instr(Request.ServerVariables("HTTP_USER_AGENT"),"IE") then %>
- if (index == 0)
- {
- parent.list.location = "nngrpls.asp"
- }
- else
- {
- parent.list.location = "nngrpls.asp#" + (index-1);
- }
- <% else %>
- parent.list.location = "nngrpls.asp"
- <% end if %>
- }
-
- <% 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_CONFIRM_DELETETXT %>"))
- {
- 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_MENU_TITLETXT %></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_HEAD_TITLETXT %> </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_NEWSGROUP_NAMETXT %> <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_FIND_BUTTONTXT %></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 %>
- No matching groups<br>
- <% else %>
- Results: <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_TITLE_MATCHING_NEWSGROUPSTXT %></FONT></B>
- </TD>
- </TR>
- </TABLE>
- <% REM Load list page after head has completely loaded %>
- <% if ( (a = "open") OR (a = "remove") ) 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 %>
-