home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1998 February
/
CHIP_2_98.iso
/
software
/
pelne
/
optionp
/
ins.cab
/
nndired.asp
< prev
next >
Wrap
Text File
|
1997-10-12
|
19KB
|
703 lines
<% Response.Expires = 0 %>
<% REM Directories Page add/edit pop-up %>
<%
L_EDITDIRECTORYPROP_TEXT = "Edit Directory Properties"
L_ADDDIRECTORY_TEXT = "Add Directory"
L_NEWSGROUPSUBTREE_TEXT = "Newsgroup subtree:"
L_EDITDIRECTORYON_TEXT = "Edit Directory on"
L_ADDDIRECTORYON_TEXT = "Add Directory on"
L_PATH_TEXT = "Path:"
L_ACCOUNTINFORMATION_TEXT = "Account Information"
L_USERNAME_TEXT = "User name:"
L_PASSWORD_TEXT = "Password:"
L_ACCESS_TEXT = "Access"
L_ALLOWPOSTING_TEXT = "Allow posting"
L_REQUIRESECURE_TEXT = "Require secure channel"
L_REQUIRE128_TEXT = "Require 128 Bit Encryption"
L_RESTRICTGROUP_TEXT = "Restrict Group Visibility"
L_OK_TEXT = "OK"
L_CANCEL_TEXT = "Cancel"
L_HELP_TEXT = "Help"
L_ENTERDIRECTORYNAME_TEXT = "Please enter a directory name."
L_ENTERSUBTREENAME_TEXT = "Please enter a subtree root."
L_HOMEDIRECTORY_TEXT = "A home directory already exists for this service. Do you want to replace it?"
L_ENTERDIRNAME_TEXT = "Please enter a directory name."
L_SUBTREEROOT_TEXT = "Please enter a subtree root."
L_SUBTREEROOT_ERRORMESSAGE = "The subtree root syntax is incorrect."
L_REQUIRESECURECHANNEL_TEXT = "Require Secure Channel must be enabled to Require 128-bit Encryption\nDo you want to enable Require Secure Channel?"
L_UNCPATHACCOUNT_TEXT = "Account user name and password are only valid for UNC paths."
L_EDIT_TEXT = "edit" ' Internal String Do NOT localize
L_SAVE_TEXT = "save" ' Internal String Do NOT localize
L_NEW_TEXT = "new" ' Internal String Do NOT localize
L_ADD_TEXT = "add" ' Internal String Do NOT localize
L_ON_TEXT = "on" ' Internal String Do NOT localize
%>
<% REM Get variables %>
<% REM svr = Server name %>
<% REM a = Action to be performed by server-side code (new/add,edit/save) %>
<% REM DirRoot = Directory root being edited %>
<% REM DirHome = Whether a home directory already exists for service %>
<% svr = Session("svr") %>
<% a = Request("a") %>
<% DirRoot = Request("DirRoot") %>
<% DirHome = Request("DirHome") %>
<% VRootIndex = Request("index") %>
<% REM Include _cnst file to force logon by anonymous users (if access denied, body of file ignored) %>
<!--#include file="_cnst.asp" -->
<% if (cont = true) then %>
<% On Error Resume Next %>
<% Set admin = Server.CreateObject("Nntpadm.Admin.1") %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% On Error Resume Next %>
<% Set VServer = CreateObject("NntpAdm.VirtualServer") %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% REM Set Server %>
<% On Error Resume Next %>
<% VServer.Server = svr %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% REM Set Service Instance %>
<% On Error Resume Next %>
<% VServer.ServiceInstance = Session("ServiceInstance") %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% On Error Resume Next %>
<% set Vroots = VServer.VirtualRoots %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% REM Set Server %>
<% On Error Resume Next %>
<% Vroots.Server = svr %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% REM Set Service Instance %>
<% On Error Resume Next %>
<% Vroots.ServiceInstance = Session("ServiceInstance") %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% REM Enumerate Virtual Roots %>
<% On Error Resume Next %>
<% Vroots.Enumerate %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<HTML>
<HEAD>
<% REM Generic Javascript function nnisFull returns alert if field is empty %>
<!--#include file="nnisfull.htm" -->
<SCRIPT LANGUAGE="javascript">
<% REM Javascript function onOK submits form upon clicking "OK" button if directory information is valid per chkDir function %>
function onOK()
{
if (chkDir() == true)
{
document.userform.newDirectory.value = escape(document.userform.txtDirDirectory.value);
document.userform.submit();
}
else
{
return;
}
}
<% REM Javascript function chkDir %>
function chkDir()
{
<% if (a = L_EDIT_TEXT) then %>
document.userform.a.value = "save";
<% elseif (a = L_NEW_TEXT) then %>
document.userform.a.value = "add";
<% end if %>
if (document.userform.txtDirDirectory.value == "")
{
alert("<% = L_ENTERDIRNAME_TEXT %>")
document.userform.txtDirDirectory.focus();
return false;
}
else
{
if (document.userform.txtDirRoot.value == "")
{
alert("<% = L_SUBTREEROOT_TEXT %>");
return false;
}
if (chkChar(document.userform.txtDirRoot))
{
if ((document.userform.DirHome.value == "true") && (document.userform.hdnDirRoot.value != ""))
{
if (confirm("<% = L_HOMEDIRECTORY_TEXT %>"))
{
if (document.userform.txtDirDirectory.value == "")
{
alert("<% = L_ENTERDIRNAME_TEXT %>")
document.userform.txtDirDirectory.focus();
return false;
}
else
{
return true;
}
}
else
{
self.location = "nndired.asp?svr=<% = svr %>&a=<% = a %>&DirRoot=<% = DirRoot %>&DirHome=<% = DirHome %>";
return false;
}
}
else
{
return true;
}
}
else
{
return false;
}
}
}
<% REM Javascript function chkChar %>
function chkChar(txtfield)
{
txtvalue = txtfield.value
i = (txtvalue.indexOf("'") + txtvalue.indexOf('"'));
i = (i + txtvalue.indexOf("<") + txtvalue.indexOf('>') + txtvalue.indexOf('%'));
i = (i + txtvalue.indexOf("&") + txtvalue.indexOf("#") + txtvalue.indexOf("("));
i = (i + txtvalue.indexOf("+") + txtvalue.indexOf(")") + txtvalue.indexOf("@"));
i = (i + txtvalue.indexOf("~") + txtvalue.indexOf("`") + txtvalue.indexOf("!"));
i = (i + txtvalue.indexOf("^") + txtvalue.indexOf("*") + txtvalue.indexOf("="));
i = (i + txtvalue.indexOf("|") + txtvalue.indexOf(";"));
i = (i + txtvalue.indexOf(",") + txtvalue.indexOf("?"));
if (i != -21)
{
alert("<% = L_SUBTREEROOT_ERRORMESSAGE %>");
document.userform.txtDirRoot.value = "";
document.userform.txtDirRoot.focus();
return false;
}
else
{
return true;
}
}
function chkToTxt(chkControl)
{
if (chkControl.checked)
{
return "1";
}
else
{
return "0";
}
}
<% REM Javascript function maintainChk %>
function maintainChk()
{
uform = document.userform;
if (uform.chkDirAccessSsl.checked)
{
uform.chkDir128BitSsl.checked = (uform.hdnDir128BitSsl.value == "1");
}
else
{
uform.hdnDir128BitSsl.value = chkToTxt(uform.chkDir128BitSsl);
uform.chkDir128BitSsl.checked = false;
}
}
function chkSsl()
{
uform = document.userform;
if (!uform.chkDirAccessSsl.checked)
{
if(confirm("<% = L_REQUIRESECURECHANNEL_TEXT %>"))
{
uform.chkDirAccessSsl.checked = true;
uform.chkDir128BitSsl.checked = true;
return true;
}
else
{
uform.chkDir128BitSsl.checked = false;
return false;
}
}
}
<% REM Javascript function maintainTxt %>
function maintainTxt()
{
if (isFull(document.userform.txtDirRoot.value))
{
document.userform.hdnDirRoot.value = document.userform.txtDirRoot.value;
}
}
<% REM Javascript function setPassword %>
function setPassword()
{
if (document.userform.txtDirAccountPassword.value != "")
{
document.userform.hdnDirAccountPassword.value = document.userform.txtDirAccountPassword.value;
document.userform.txtDirAccountPassword.value = "**************";
}
}
<% REM Javascript function chkUNC %>
function chkUNC(thisControl)
{
dirstr = document.userform.txtDirDirectory.value;
if (dirstr.substring(1,2) != "\\")
{
alert("<% = L_UNCPATHACCOUNT_TEXT %>");
thisControl.value = "";
}
else
{
setPassword();
}
}
<% REM Javascript function setUNCAccount %>
function setUNCAccount(dirString)
{
if (dirString.substring(1,2)!= "\\")
{
document.userform.txtDirAccountName.value = "";
document.userform.txtDirAccountPassword.value = "";
}
}
<% REM Javascript function helpBox %>
function helpBox()
{
window.open("help/nndiredh.htm","<% = L_HELP_TEXT %>","toolbar=no,scrollbars=yes,directories=no,menubar=no,width=300,height=425");
}
</SCRIPT>
<TITLE>
<% if (a = L_EDIT_TEXT) then %>
<% = L_EDITDIRECTORYPROP_TEXT %>
<% elseif (a = L_NEW_TEXT) then %>
<% = L_ADDDIRECTORY_TEXT %>
<% end if %>
</TITLE>
</HEAD>
<BODY BGCOLOR="#000000" TEXT="#000000" TOPMARGIN=15 LINK="#000000" VLINK="#000000" ALINK="#000000">
<% if ((a = L_ADD_TEXT) OR (a = L_SAVE_TEXT)) then %>
<% DirDirectory = Cstr(Request("newDirectory")) %>
<% DirDirectory = Replace(DirDirectory,"%5C","\") %>
<% DirDirectory = Replace(DirDirectory,"%3A",":") %>
<% DirRoot = Request("txtDirRoot") %>
<% originalDirRoot = Request("txtOriginalDirRoot") %>
<% DirAccountName = Request("txtDirAccountName") %>
<% DirAccountPassword = Request("hdnDirAccountPassword") %>
<% if (Request("chkDirAccessPosting") = L_ON_TEXT) then %>
<% DirAccessPosting = 1 %>
<% else %>
<% DirAccessPosting = 0 %>
<% end if %>
<% if (Request("chkDirAccessSsl") = L_ON_TEXT) then %>
<% DirAccessSsl = 1 %>
<% else %>
<% DirAccessSsl = 0 %>
<% end if %>
<% if (Request("chkDir128BitSsl") = L_ON_TEXT) then %>
<% Require128BitSsl = 1 %>
<% else %>
<% Require128BitSsl = 0 %>
<% end if %>
<% if (Request("DirAccessRestrictVisibility") = L_ON_TEXT) then %>
<% DirAccessRestrictVisibility = 1 %>
<% else %>
<% DirAccessRestrictVisibility = 0 %>
<% end if %>
<% if (a = L_ADD_TEXT) then %>
<% On Error Resume Next %>
<% set thisVroot = Server.CreateObject("nntpadm.VirtualRoot") %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% thisVroot.NewsgroupSubtree = DirRoot %>
<% thisVroot.Directory = DirDirectory %>
<% thisVroot.UNCUserName = DirAccountName %>
<% thisVroot.UNCPassword = DirAccountPassword %>
<% thisVroot.AllowPosting = DirAccessPosting %>
<% thisVroot.RequireSsl = DirAccessSsl %>
<% thisVroot.Require128BitSsl = Require128BitSsl %>
<% thisVroot.RestrictGroupVisibility = DirAccessRestrictVisibility %>
<% On Error Resume Next %>
<% Vroots.AddDispatch(thisVroot) %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% elseif (a = L_SAVE_TEXT) then %>
<% if (originalDirRoot <> DirRoot) then %>
<% REM Create a new virtual root to copy new values into %>
<% On Error Resume Next %>
<% set thisVroot = Server.CreateObject("nntpadm.VirtualRoot") %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% else %>
<% REM Get pointer to existing virtual root directory %>
<% On Error Resume Next %>
<% set thisVroot = Vroots.Item(Cint(VRootIndex)) %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% end if %>
<% thisVroot.NewsgroupSubtree = DirRoot %>
<% thisVroot.Directory = DirDirectory %>
<% thisVroot.UNCUserName = DirAccountName %>
<% thisVroot.UNCPassword = DirAccountPassword %>
<% thisVroot.AllowPosting = DirAccessPosting %>
<% thisVroot.RequireSsl = DirAccessSsl %>
<% thisVroot.Require128BitSsl = Require128BitSsl %>
<% thisVroot.RestrictGroupVisibility = DirAccessRestrictVisibility %>
<% if (originalDirRoot <> DirRoot) then %>
<% On Error Resume Next %>
<% Vroots.AddDispatch(thisVroot) %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% else %>
<% Vroots.Remove(Cint(vRootIndex)) %>
<% end if %>
<% else %>
<% On Error Resume Next %>
<% Vroots.SetDispatch VRootIndex, thisVroot %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% end if %>
<% end if %>
<SCRIPT LANGUAGE="javascript">
opener.location = "nndirhd.asp?svr=<% = svr %>&SelectedRoot=<% = admin.Tokenize(DirRoot) %>";
self.close();
</SCRIPT>
<% end if %>
<% if (a = L_NEW_TEXT) then %>
<% On Error Resume Next %>
<% set thisVroot = Server.CreateObject("nntpadm.VirtualRoot") %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% thisVroot.Directory = "" %>
<% thisVroot.NewsgroupSubtree = L_NEW_TEXT %>
<% thisVroot.UNCUserName = "" %>
<% thisVroot.UNCPassword = "" %>
<% thisVroot.AllowPosting = 1 %>
<% thisVroot.RestrictGroupVisibility = 0 %>
<% thisVroot.RequireSsl = 0 %>
<% thisVroot.Require128BitSsl = 0 %>
<% elseif (a = L_EDIT_TEXT) then %>
<% REM Get a pointer to the Virtual Root we are editing %>
<% On Error Resume Next %>
<% set thisVroot = Vroots.ItemDispatch(VRootIndex) %>
<% if (Err <> 0) then %>
<script language="javascript">
alert("<% = Err.description %>");
</script>
<% end if %>
<% end if %>
<FORM NAME="userform" ACTION="nndired.asp" METHOD="post" onSubmit="return chkDir();">
<INPUT TYPE="hidden" NAME="svr" VALUE="<% = svr %>">
<INPUT TYPE="hidden" NAME="a" VALUE="">
<INPUT TYPE="hidden" NAME="hdnDirRoot" VALUE="<% = DirRoot %>">
<INPUT TYPE="hidden" NAME="DirHome" VALUE="<% = DirHome %>">
<INPUT TYPE="hidden" NAME="index" VALUE="<% = VRootIndex %>">
<INPUT TYPE="hidden" NAME="newDirectory" VALUE="">
<INPUT TYPE="hidden" NAME="txtOriginalDirRoot" VALUE="<% = DirRoot %>">
<TABLE BORDER=1 BGCOLOR="#CCCCCC" WIDTH=100% CELLPADDING=10>
<TR><TD>
<P><IMG SRC="images/gnicttl.gif" ALIGN="textmiddle" HEIGHT=10 WIDTH=10> <FONT SIZE=2 FACE="Arial"><B>
<% if (a = L_EDIT_TEXT) then %>
<% = L_EDITDIRECTORYON_TEXT %>
<% elseif (a = L_NEW_TEXT) then %>
<% = L_ADDDIRECTORYON_TEXT %>
<% end if %>
</B></FONT><FONT FACE="Times New Roman" SIZE=3><I><% = svr %></I></FONT>
<TABLE BORDER="0" WIDTH=100%>
<TR>
<TD>
<FONT FACE="Arial" SIZE=2>
<B><% = L_NEWSGROUPSUBTREE_TEXT %></B>
</FONT>
</TD>
<TD>
<INPUT NAME="txtDirRoot" TYPE="text" SIZE=25 onChange="maintainTxt();" VALUE="<% = thisVroot.NewsgroupSubtree %>">
</TD>
</TR>
<TR>
<TD>
<FONT FACE="Arial" SIZE=2>
<B><% = L_PATH_TEXT %></B>
</FONT>
</TD>
<TD>
<INPUT NAME="txtDirDirectory" TYPE="text" VALUE="<% = thisVroot.Directory %>" SIZE = 25 onChange="setUNCAccount(this.value);">
</TD>
</TR>
<TR>
<TD COLSPAN=2>
<FONT FACE="Arial" SIZE=2>
<B><% = L_ACCOUNTINFORMATION_TEXT %></B>
</FONT>
</TD>
</TR>
<TR>
<TD COLSPAN=2>
<BLOCKQUOTE>
<TABLE>
<TR>
<TD><FONT SIZE=2 FACE="Arial"><% = L_USERNAME_TEXT %> </TD>
<TD><INPUT TYPE="text" NAME="txtDirAccountName" SIZE = 25 VALUE="<% = thisVroot.UNCUserName %>" onChange="chkUNC(this);"></TD></TR>
<TR>
<TD COLSPAN=2 HEIGHT=4></TD>
</TR>
<TR>
<TD>
<FONT SIZE=2 FACE="Arial"><% = L_PASSWORD_TEXT %>
</TD>
<TD>
<% if (thisVroot.UNCPassword <> "") then %>
<INPUT TYPE="text" NAME="txtDirAccountPassword" SIZE=25 VALUE="**************" onChange="chkUNC(this);">
<% else %>
<INPUT TYPE="text" NAME="txtDirAccountPassword" SIZE=25 VALUE="" onChange="chkUNC(this);">
<% end if %>
<INPUT TYPE="hidden" NAME="hdnDirAccountPassword" VALUE="<% = thisVroot.UNCPassword %>"></TD>
</TR>
</TABLE>
</BLOCKQUOTE>
</TD>
</TR>
<TR>
<TD COLSPAN=2>
<FONT FACE="Arial" SIZE="2">
<B><% = L_ACCESS_TEXT %></B>
</FONT>
</TD>
</TR>
<TR>
<TD COLSPAN=2>
<FONT FACE="Arial" SIZE="2">
<BLOCKQUOTE>
<% if (thisVroot.AllowPosting = 1) then %>
<INPUT NAME="chkDirAccessPosting" TYPE="checkbox" CHECKED>
<% else %>
<INPUT NAME="chkDirAccessPosting" TYPE="checkbox">
<% end if %>
<% = L_ALLOWPOSTING_TEXT %>
<P>
<% if (thisVroot.RequireSSL = 1) then %>
<INPUT NAME="chkDirAccessSsl" TYPE="checkbox" CHECKED onClick="maintainChk();">
<% else %>
<INPUT NAME="chkDirAccessSsl" TYPE="checkbox" onClick="maintainChk();">
<% end if %>
<% = L_REQUIRESECURE_TEXT %>
<P>
<% if (thisVroot.Require128BitSsl = 1) then %>
<INPUT NAME="chkDir128BitSsl" TYPE="checkbox" CHECKED onClick="chkSsl();">
<INPUT NAME="hdnDir128BitSsl" TYPE="hidden" VALUE="1">
<% else %>
<INPUT NAME="chkDir128BitSsl" TYPE="checkbox" onClick="chkSsl();">
<INPUT NAME="hdnDir128BitSsl" TYPE="hidden" VALUE="0">
<% end if %>
<% = L_REQUIRE128_TEXT %>
<P>
<% if (thisVroot.RestrictGroupVisibility = 1) then %>
<INPUT NAME="DirAccessRestrictVisibility" TYPE="checkbox" CHECKED>
<% else %>
<INPUT NAME="DirAccessRestrictVisibility" TYPE="checkbox">
<% end if %>
<% = L_RESTRICTGROUP_TEXT %>
</BLOCKQUOTE>
</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>
<B><A HREF="javascript:onOk();">
<IMG SRC="images/gnicok.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A>
<A HREF="javascript:onOK();"><% = L_OK_TEXT %></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:close();">
<IMG SRC="images/gniccncl.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A>
<A HREF="javascript:close();"><% = L_CANCEL_TEXT %></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:helpBox();">
<IMG SRC="images/gnichelp.gif" BORDER=0 ALIGN="top" HEIGHT=16 WIDTH=16></A>
<B><A HREF="javascript:helpBox();"><% = L_HELP_TEXT %></A></B>
</FONT>
</TD>
</TR>
</TABLE></TD>
<TD> </TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>
<% end if %>