home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / ins.cab / ~hs8.asp < prev    next >
Encoding:
Text File  |  1997-08-16  |  8.3 KB  |  322 lines

  1. <% Response.Expires = 0 %>
  2.  
  3. <%
  4. REM LOCALIZATION
  5.  
  6. L_MENU_TITLETXT = "MCIS-NS Administration"
  7. L_ERROR_ACCESS_DENIEDTXT = "Error: Access is Denied."
  8. L_ERRORTXT = "Error is: "
  9. L_ADD_TITLETXT = "Add Newsgroup"
  10. L_EDIT_TITLETXT = "Edit Newsgroup Properties"
  11. L_ENTER_NAMETXT = "Please enter a newsgroup name."
  12. L_ADD_LABELTXT = "Add Newsgroup on"
  13. L_EDIT_LABELTXT = "Edit Newsgroup on"
  14. L_NEWSGROUP_LABELTXT = "Newsgroup:"
  15. L_DESCRIPTION_LABELTXT = "Description:"
  16. L_READ_ONLY_LABELTXT = "Read only"
  17. L_MODERATED_LABELTXT = "Moderated"
  18. L_MODERATOR_LABELTXT = "Moderator:"
  19. L_OK_LABELTXT = "OK"
  20. L_CANCEL_LABELTXT = "Cancel"
  21. L_HELP_LABELTXT = "Help"
  22.  
  23. REM END LOCALIZATION
  24. %>
  25.  
  26. <% svr = Request ("svr") %>
  27. <% a = Request ("a") %>
  28. <% svcInstance = 1 %>
  29. <% Description = Request ("txtDescription") %>
  30. <% Moderated = Request ("hdnModerated") %>
  31. <% Moderator = Request ("txtModerator") %>
  32. <% ReadOnly = Request ("hdnReadOnly") %>
  33.  
  34. <% Group = Request ("Group") %>
  35. <!--#include file="_cnst.asp" -->
  36.  
  37. <% if (cont = true) then %>
  38.  
  39. <% On Error Resume Next %>
  40. <% Set GroupAdm = Server.CreateObject("nntpadm.groups") %>
  41. <% if Err <> 0 then %>
  42.     <script language="javascript>
  43.         <p>
  44.         <% = L_ERROR_ACCESS_DENIEDTXT %>
  45.         alert('<% = L_ERRORTXT %><% = Err.description %> ');
  46.     </script>
  47. <% end if %>
  48.  
  49. <% REM get server name %>
  50. <% GroupAdm.Server = svr %>
  51.  
  52. <% REM set service instance %>
  53. <% GroupAdm.ServiceInstance = svcInstance %>
  54.  
  55. <HTML>
  56. <HEAD>
  57.  
  58. <% if (a = "new") then %>
  59.     <TITLE><% = L_ADD_TITLETXT %></TITLE>
  60. <% else %>
  61.     <TITLE><% = L_EDIT_TITLETXT %></TITLE>
  62. <% end if %>
  63.  
  64. <SCRIPT LANGUAGE="javascript">
  65.  
  66.     <!--#include file="nnisfull.htm" -->
  67.  
  68.     function maintainCheck () {
  69.         if (document.userform.chkModerated.checked == true) {
  70.             document.userform.txtModerator.value = document.userform.hdnModerator.value;
  71.             document.userform.txtModerator.focus();
  72.         }
  73.         else {
  74.             document.userform.hdnModerator.value = document.userform.txtModerator.value;
  75.             document.userform.txtModerator.value = "";
  76.         }
  77.     }
  78.  
  79.     function convertChktoHdn(chkControl, hdnControl) {
  80.         if (chkControl.checked == true) {
  81.             hdnControl.value = true;
  82.         }
  83.         else {
  84.             hdnControl.value = false;
  85.         }
  86.     }
  87.  
  88.     function maintainText () {
  89.         if (document.userform.txtModerator.value != "") {
  90.             document.userform.chkModerated.checked = true;
  91.             document.userform.hdnModerator.value = document.userform.txtModerator.value;
  92.         }
  93.     }
  94.  
  95.     function checkModerator() {
  96.         if ((document.userform.chkModerated.checked == true) && (document.userform.txtModerator.value == "")) {
  97.             alert("Moderated newsgroups must have a moderator. Please enter a moderator name.");
  98.             return false;
  99.         }
  100.         else {
  101.             return true;
  102.         }
  103.     }
  104.  
  105.     function checkNgrp() {
  106.         if (document.userform.Group.value!="") {
  107.             return true;
  108.         }
  109.         else {
  110.             alert("<% = L_ENTER_NAMETXT %>")
  111.             return false;
  112.         }
  113.     }
  114.  
  115.         function onOk() {
  116.         if ((checkNgrp())&&(checkModerator())) {
  117.             convertChktoHdn(document.userform.chkReadOnly, document.userform.hdnReadOnly);
  118.             convertChktoHdn(document.userform.chkModerated, document.userform.hdnModerated);
  119.         <% if (a = "new") then %>
  120.             document.userform.a.value = "add";
  121.         <% else %>
  122.             document.userform.a.value = "save";
  123.         <% end if %>
  124.                  document.userform.submit();
  125.         }
  126.     }
  127.  
  128.     function helpBox() {
  129.         window.open("help/nngrpedh.htm","Help","toolbar=no,scrollbars=yes,directories=no,menubar=no,width=300,height=425");
  130.     }
  131.  
  132.     function closeWin()
  133.     {
  134.             <% if (a = "add") then %>
  135.                 window.opener.document.uForm.refresh();
  136.             <% else %>
  137.                 index = window.opener.document.uForm.selectedItem;
  138.                 window.opener.document.uForm.loadList();
  139.             <% end if %>
  140.         self.close();
  141.     }
  142.  
  143. </SCRIPT>
  144.  
  145. </HEAD>
  146.  
  147. <% if ((a = "add") OR (a = "save")) then %>
  148.  
  149.     <% if (a = "add") then %>
  150.  
  151.         <% GroupAdm.Newsgroup = Group %>
  152.         <% GroupAdm.Description = Description %>
  153.         <% GroupAdm.Moderator = Moderator %>
  154.         <% GroupAdm.ReadOnly = ReadOnly %>
  155.  
  156.         <% On Error Resume Next %>
  157.         <% GroupAdm.Add %>
  158.         <% if (Err <> 0) then %>
  159.             <script language = "javascript">
  160.                 alert ( '<% = L_ERRORTXT %><% = Err.Description %> ' );
  161.             </script>
  162.         <% end if %>
  163.         
  164.         <BODY BGCOLOR="#000000" TOPMARGIN=15 LINK="#000000" VLINK="#000000" ALINK="#000000" onLoad="closeWin();">
  165.  
  166.     <% elseif (a = "save" ) then %>
  167.         <% GroupAdm.Newsgroup = Group %>
  168.         <% GroupAdm.Description = Description %>
  169.         <% GroupAdm.Moderator = Moderator %>
  170.         <% GroupAdm.ReadOnly = ReadOnly %>
  171.  
  172.         <% On Error Resume Next %>
  173.         <% GroupAdm.Set %>
  174.         <% if ( Err <> 0 ) then %>
  175.             <SCRIPT language="JavaScript">
  176.                 alert ( '<% = L_ERRORTXT %><% = Err.description %>' );
  177.             </SCRIPT>
  178.         <% end if %>
  179.  
  180.         <BODY BGCOLOR="#000000" TEXT="#000000" TOPMARGIN=15 LINK="#000000" VLINK="#000000" ALINK="#000000" onLoad="closeWin();">
  181.  
  182.     <% end if %>
  183.  
  184. <% else %>
  185.  
  186.     <% if (a = "edit") then %>
  187.         <% On Error Resume Next %>
  188.         <% GroupAdm.Get(Group) %>
  189.             <% if ( Err <> 0 ) then %>
  190.                     <SCRIPT LANGUAGE = "JavaScript">
  191.                             alert ('<% = L_ERRORTXT %><% = Err.Description %>' );
  192.                     </SCRIPT>
  193.             <% end if %>
  194.     <% end if %>
  195.  
  196. <BODY BGCOLOR="#000000" TEXT="#000000" TOPMARGIN=15 LINK="#000000" VLINK="#000000" ALINK="#000000">
  197.  
  198. <FORM NAME="userform" ACTION="nngrped.asp" onSubmit="return false" METHOD="post">
  199.  
  200. <TABLE BORDER=1 BGCOLOR="#CCCCCC" WIDTH=100% CELLPADDING=10>
  201.  
  202. <TR><TD>
  203.  
  204.     <FONT SIZE=2 FACE="Arial">
  205.  
  206.     <P><IMG SRC="images/gnicttl.gif" ALIGN="textmiddle" HEIGHT=10 WIDTH=10> <FONT SIZE=2 FACE="Arial"><B>
  207.  
  208.     <% if (a = "new") then %>
  209.         <% = L_ADD_LABELTXT %> 
  210.     <% else %>
  211.         <% = L_EDIT_LABELTXT %> 
  212.     <% end if %>
  213.  
  214.     </B></FONT><FONT FACE="Times New Roman" SIZE=3><I> <% = svr %></I></FONT>
  215.  
  216.     <P>
  217.  
  218.     <INPUT TYPE="hidden" NAME="svr" VALUE="<% = svr %>">
  219.     <INPUT TYPE="hidden" NAME="a" VALUE="<% = a %>">
  220.  
  221.     <% = L_NEWSGROUP_LABELTXT %>  
  222.  
  223.     <% if (a = "new") then %>
  224.         <INPUT NAME="Group" TYPE = "text" VALUE = "<% = Group %>" SIZE=25>
  225.     <% else %>
  226.         <% = Group %>
  227.         <INPUT NAME="Group" TYPE = "hidden" VALUE = "<% = Group %>" SIZE=25>
  228.     <% end if %>
  229.  
  230.     <P><% = L_DESCRIPTION_LABELTXT %>  
  231.  
  232.     <INPUT NAME="txtDescription" TYPE = "text" VALUE="<% = GroupAdm.Description %>" SIZE = 25>
  233.     <INPUT NAME ="hdnDescription" TYPE = "hidden" VALUE = "<% = GroupAdm.Description %>" >
  234.  
  235.     <P>
  236.     <INPUT NAME="chkReadOnly" TYPE = "checkbox"
  237.     <% if ( GroupAdm.ReadOnly = 1 ) then %> CHECKED <% end if %> >
  238.     
  239.           <% = L_READ_ONLY_LABELTXT %>
  240.     <INPUT NAME="hdnReadOnly" TYPE = "hidden">
  241.  
  242.     <P>
  243.     <INPUT NAME="chkModerated" TYPE = "checkbox"
  244.     <% if ( GroupAdm.Moderator <> "" ) then %> CHECKED <% end if %>onClick = "maintainCheck();" >
  245.     
  246.           <% = L_MODERATED_LABELTXT %>
  247.     <INPUT NAME="hdnModerated" TYPE = "hidden">
  248.  
  249.     <BLOCKQUOTE>
  250.         <% = L_MODERATOR_LABELTXT %>  
  251.         <INPUT NAME="txtModerator" TYPE="text" onChange = "maintainText();" VALUE = "<% = GroupAdm.Moderator %>" SIZE=25>
  252.         <INPUT NAME="hdnModerator" TYPE="hidden" VALUE = "<% = GroupAdm.Moderator %>">
  253.     </BLOCKQUOTE>
  254.  
  255. </TD></TR>
  256.  
  257. </TABLE>
  258.  
  259. </FORM>
  260.  
  261. <P>
  262. <TABLE ALIGN="right" CELLPADDING=1 CELLSPACING=1>
  263.  
  264. <TR>
  265.  
  266.     <TD><TABLE VALIGN="top" BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#FFCC00">
  267.  
  268.         <TR>
  269.                 
  270.             <TD VALIGN="middle">
  271.                 <FONT FACE="Arial" SIZE=2>
  272.                 <B><A HREF="javascript:onOk();">
  273.                 <IMG SRC="images/gnicok.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A>
  274.                 <A HREF="javascript:onOk();"><% = L_OK_LABELTXT %></A></B>
  275.                 </FONT>
  276.             </TD>    
  277.  
  278.         </TR>
  279.         
  280.     </TABLE></TD>
  281.  
  282.     <TD><TABLE VALIGN="top" BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#FFCC00">
  283.  
  284.         <TR>
  285.                 
  286.             <TD VALIGN="middle">
  287.                 <FONT FACE="Arial" SIZE=2>
  288.                 <B><A HREF="javascript:close();">
  289.                 <IMG SRC="images/gniccncl.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A>
  290.                 <A HREF="javascript:close();"><% = L_CANCEL_LABELTXT %></A></B>
  291.                 </FONT>
  292.             </TD>    
  293.  
  294.         </TR>
  295.         
  296.     </TABLE></TD>
  297.  
  298.     <TD><TABLE VALIGN="top" BORDER=0 CELLPADDING=5 CELLSPACING=0 BGCOLOR="#FFCC00">
  299.         <TR>
  300.             <TD VALIGN="middle">
  301.                 <FONT FACE="Arial" SIZE=2>
  302.                 <B><A HREF="javascript:helpBox();"><IMG HEIGHT=16 WIDTH=16 ALIGN="top" SRC="images/gnichelp.gif" BORDER=0 ALT="Help"></A>
  303.                 <A HREF="javascript:helpBox();"><% = L_HELP_LABELTXT %></A></B>
  304.                 </FONT>
  305.             </TD>
  306.         </TR>
  307.  
  308.     </TABLE></TD>
  309.  
  310.  
  311.     <TD> </TD>
  312.  
  313. </TR>
  314.  
  315. </TABLE>
  316.  
  317. <% end if %>
  318.  
  319. </BODY>
  320. </HTML>
  321.  
  322. <% end if %>