home *** CD-ROM | disk | FTP | other *** search
- <%
- #include </utility/security.fts>
- #include </utility/global.fts>
- #include </utility/theme.fts>
- #include </utility/ftgate.fts>
- #include </utility/asperrors.fts>
-
- var s
- var id
-
- var type
- var ok
-
- session.system.error=0
-
- if (form.config=="1")
- {
- type=form.type
-
- if (type=="smtp")
- s = new server.smtp
- else
- s = new server.pop
-
- id = form.id
- s.id=id
-
- type=form.type
-
- if (form.command=="1")
- {
- var names=string(form.names)
- var start=0
- var pos=names.indexof(",",0)
- while (pos!=-1)
- {
- s.domain.add(names.slice(start, pos))
- start=pos+1
- pos=names.indexof(",",start)
- }
- }
- else if (form.command=="2")
- {
- var names=string(form.names)
- var start=0
- var pos=names.indexof(",",0)
- while (pos!=-1)
- {
- s.domain.remove(names.slice(start, pos))
- start=pos+1
- pos=names.indexof(",",start)
- }
- }
-
- if (form.redirect!="")
- output.redirect(form.redirect+"?id="+id+"&type="+type)
- }
- else if (form.config=="2")
- {
- if (form.redirect!="")
- output.redirect(form.redirect+"?id="+form.id+"&type="+form.type)
- }
- else
- {
- type = request.type
-
- if (type=="smtp")
- s = new server.smtp
- else
- s = new server.pop
-
- s.id = request.id
- id = request.id
- }
-
- var pagetitle
-
- if (type=="smtp")
- pagetitle = "SMTP Service"
- else
- pagetitle = "POP3 Service"
- %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
- <HTML>
- <HEAD>
- <LINK REL=STYLESHEET HREF="/utility/main<%=nn4%>.css" TYPE="text/css">
- <META name="GENERATOR" content="Microsoft Developer Studio">
- <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <TITLE>Services -- <%
- if (type=="smtp")
- output.write("SMTP")
- if (type=="pop3")
- output.write("POP3")
- %> Attached Domains</TITLE>
-
- <SCRIPT LANGUAGE="JavaScript1.2">
- <!--
- var dir="<%=buttons%>";
- var pro=<%=build()==FTGATE_PRO%>;
-
- if (!document.images) {}
- else {
- create0 = new Image();
- create0.src = dir+"next.gif";
- create1 = new Image();
- create1.src = dir+"nexton.gif";
- delete0 = new Image();
- delete0.src = dir+"prev.gif";
- delete1 = new Image();
- delete1.src = dir+"prevon.gif";
- clear0 = new Image();
- clear0.src = dir+"deleteall.gif";
- clear1 = new Image();
- clear1.src = dir+"deleteallon.gif";
- }
- <%
- if (netscape)
- {
- %>
- document.captureEvents(Event.KEYPRESS);
- document.onkeypress = keypress;
-
- function keypress(event)
- {
- if (event.which==13)
- {
- if (document.activeElement==document.ftgate.available)
- onAttach();
- else if (document.activeElement==document.ftgate.domains)
- onDetach();
-
- return false;
- }
-
- return true;
- }
- <%
- }
- else
- {
- %>
- function keypress()
- {
- if (event.keyCode==13)
- {
- if (document.activeElement==document.ftgate.available)
- onAttach();
- else if (document.activeElement==document.ftgate.domains)
- onDetach();
-
- event.returnValue=null;
- }
- }
- <%
- }
- %>
-
- function onSubmit()
- {
- onAttach();
- return false;
- }
-
- function onLoad()
- {
- setPage(5, "<%=pagetitle%>");
-
- var list = document.ftgate.available
- if (document.ftgate.available.length)
- document.ftgate.available.focus();
- else
- document.ftgate.domains.focus();
-
- <%
- if (session.system.error!=0)
- {
- %>
- window.alert(aspError(<%=session.system.error%>));
- <%
- }
- %>
- }
-
- function onAttach()
- {
- change('addA', 'create', 0);
-
- var list = document.ftgate.available;
- var names = "";
-
- if (list.selectedIndex!=-1)
- {
- var i;
-
- for (i=0; i<list.length; i++)
- {
- if (list.options[i].selected)
- {
- names+=list.options[i].text;
- names+=",";
- }
- }
-
- document.ftgate.names.value=names;
- document.ftgate.command.value="1"
- document.ftgate.submit();
- }
- }
-
- function onDetach()
- {
- change('deleteA', 'delete', 0);
-
- var list = document.ftgate.domains;
- var names = "";
-
- if (list.selectedIndex!=-1)
- {
- var i;
-
- for (i=0; i<list.length; i++)
- {
- if (list.options[i].selected)
- {
- names+=list.options[i].text;
- names+=",";
- }
- }
-
- document.ftgate.names.value=names;
- document.ftgate.command.value="2"
- document.ftgate.submit();
- }
- }
-
- function isOK(form)
- {
- return true;
- }
- //-->
- </SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/cookies.js"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/core.js"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/time.js"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/spin.js"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/dialog.js"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/asperrors.js" TYPE="text/javascript"></SCRIPT>
- </HEAD>
-
- <BODY BGCOLOR="white" onLoad="onLoad()" MARGINHEIGHT="0" MARGINWIDTH="0" onkeypress="keypress()">
-
- <TABLE BORDER="0" BGCOLOR="<%=border%>" WIDTH="<%=bodywidth%>" HEIGHT="<%=bodyheight%>" CELLPADDING="0" CELLSPACING="0"><TR><TD> </TD><TD VALIGN="TOP">
-
- <A HREF="index.fts"><SPAN ID="top">Services</SPAN></A><SPAN ID="top"> /</SPAN>
- <SPAN ID="topsel"><%=s.name%></SPAN>
-
- <FORM NAME="ftgate" METHOD="POST" onSubmit="return onSubmit()" ACTION="attached.fts">
- <!-- hidden variables -->
- <INPUT TYPE="HIDDEN" NAME="config" VALUE="1">
- <INPUT TYPE="HIDDEN" NAME="command" VALUE="0">
- <INPUT TYPE="HIDDEN" NAME="id" VALUE="<%=id%>">
- <INPUT TYPE="HIDDEN" NAME="type" VALUE="<%=type%>">
- <INPUT TYPE="HIDDEN" NAME="names" VALUE="">
- <INPUT TYPE="HIDDEN" NAME="redirect" VALUE="">
-
- <!--- start of the tabs ---->
- <TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0">
- <TR>
- <%
- if (type=="smtp")
- {
- %>
- <TD WIDTH="5" HEIGHT="18"><IMG SRC="/images/left.gif" VSPACE="0" BORDER="0" WIDTH="5" HEIGHT="18"></TD>
- <TD CLASS="navoff" WIDTH="50" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('smtp.fts')" CLASS="navoff">General</A></TD>
- <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
- <TD CLASS="navon" WIDTH="55" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('attached.fts')" CLASS="navon">Domains</A></TD>
- <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
- <TD CLASS="navoff" WIDTH="55" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('securitysmtp.fts')" CLASS="navoff">Security</A></TD>
- <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
- <TD CLASS="navoff" WIDTH="50" HEIGHT="18"ALIGN="CENTER"><A HREF="javascript:onLaunch('addresssmtp.fts')" CLASS="navoff">Addresses</A></TD>
- <TD WIDTH="5" HEIGHT="18"><IMG SRC="/images/right.gif" VSPACE="0" BORDER="0" WIDTH="5" HEIGHT="18"></TD>
- <TD WIDTH="<%=bodywidth-223%>" HEIGHT="18"> </TD>
- <%
- }
- else
- {
- %>
- <TD WIDTH="5" HEIGHT="18"><IMG SRC="/images/left.gif" VSPACE="0" BORDER="0" WIDTH="5" HEIGHT="18"></TD>
- <TD CLASS="navoff" WIDTH="50" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('pop3.fts')" CLASS="navoff">General</A></TD>
- <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
- <TD CLASS="navon" WIDTH="55" HEIGHT="18" ALIGN="CENTER"><A HREF="javascript:onLaunch('attached.fts')" CLASS="navon">Domains</A></TD>
- <TD BGCOLOR="black" WIDTH="1" HEIGHT="18" ALIGN="CENTER"><IMG SRC="/images/1pixel.gif" WIDTH="1" HEIGHT="18"></TD>
- <TD CLASS="navoff" WIDTH="50" HEIGHT="18"ALIGN="CENTER"><A HREF="javascript:onLaunch('addresspop3.fts')" CLASS="navoff">Addresses</A></TD>
- <TD WIDTH="5" HEIGHT="18"><IMG SRC="/images/right.gif" VSPACE="0" BORDER="0" WIDTH="5" HEIGHT="18"></TD>
- <TD WIDTH="<%=bodywidth-167%>" HEIGHT="18"> </TD>
- <%
- }
- %>
- </TR>
- </TABLE>
- <!--- end of the tabs ----->
-
- <!--- start of the tab body --->
- <TABLE BORDER="0" BGCOLOR="<%=border%>" WIDTH="100%" CELLPADDING="0" CELLSPACING="0"><TR><TD>
- <TABLE <%=table%> CELLPADDING="0" CELLSPACING="0">
- <!----- start of block --->
- <TR>
- <TD VALIGN="TOP">
- <TABLE BORDER="0" WIDTH="100%">
- <!----- sub table goes here --->
- <TR>
- <TD>
- <TABLE CLASS="box" WIDTH="100%">
- <TR>
- <TD>
- <TABLE BORDER="0" WIDTH="100%">
- <TR>
- <TH>Available domains</TH>
- <TD> </TD>
- <%
- if (type=="smtp")
- output.writeln("<TH>Only accept mail for the following domains</TH>")
- else
- output.writeln("<TH>Only handle mail for the following domains</TH>")
- %>
- </TR>
- <TR>
- <TD NOWRAP VALIGN="TOP">
- <SELECT SIZE="10" NAME="available" MULTIPLE CLASS="SEL100">
- <%
- var avail = false
- var d = new server.domain
- var domOK = d.findfirst("*")
- var first=true
-
- while (domOK)
- {
- if ((d.description=="Local")||(d.description=="Remote"))
- {
- var found = false
- ok=s.domain.first()
- if (d.domainname!="internet")
- {
- while (ok)
- {
- if ((d.domainname==s.domain.name)||)
- {
- found = true
- break
- }
-
- ok=s.domain.next()
- }
-
- if (!found)
- {
- avail=true
- output.write("<OPTION VALUE=\""+d.domainname+"\"")
- if (first)
- {
- output.write(" SELECTED>")
- first=false
- }
- else
- output.write(">")
-
- output.writeln(d.domainname+"</OPTION>")
- }
- }
- }
-
- domOK=d.findnext()
- }
-
- if (first)
- output.writeln("<OPTION VALUE=\"\">Empty List</OPTION>")
- %>
- </SELECT>
- </TD>
- <TD VALIGN="TOP" ALIGN="CENTER">
- <%
- if (avail)
- {
- %>
- <A onMouseDown="change('addA','create',1)" onMouseOut="change('addA','create',0)" HREF="javascript:onAttach()">
- <IMG SRC="<%=buttons%>next.gif" WIDTH="40" HEIGHT="20" BORDER="0" NAME="addA" ALT="Assign Domain"></A><P>
- <%
- }
- else
- {
- %>
- <IMG SRC="<%=buttons%>nextoff.gif" WIDTH="40" HEIGHT="20" BORDER="0" NAME="addA" ALT="Assign Domain"><P>
- <%
- }
- if (s.domain.first())
- {
- %>
- <A onMouseDown="change('deleteA','delete',1)" onMouseOut="change('deleteA','delete',0)"
- HREF="javascript:onDetach()"><IMG SRC="<%=buttons%>prev.gif" WIDTH="40" HEIGHT="20" BORDER="0" NAME="deleteA" ALT="Remove Domain"></A>
- <%
- }
- else
- {
- %>
- <IMG SRC="<%=buttons%>prevoff.gif" WIDTH="40" HEIGHT="20" BORDER="0" NAME="deleteA" ALT="Remove Domain"></A>
- <%
- }
- %>
- </TD>
- <TD>
- <SELECT NAME="domains" SIZE="10" MULTIPLE CLASS="SEL100">
- <%
- first=true
- ok=s.domain.first()
- while (ok)
- {
- output.writeln("<OPTION VALUE=\""+s.domain.name+"\"")
-
- if (first)
- {
- output.write(" SELECTED>")
- first=false
- }
- else
- output.write(">")
-
- output.writeln(s.domain.name+"</OPTION>")
-
- ok=s.domain.next()
- }
-
- if (first)
- output.writeln("<OPTION VALUE=\"\">All Hosted Domains</OPTION>")
- %>
- </SELECT>
- </TD>
- </TR>
- </TABLE>
- </TD>
- </TR>
- </TABLE>
- </TD>
- </TR>
- <!----- sub table ends here --->
- <!----- table footer goes here --->
- <TR>
- <TD ALIGN="RIGHT">
- <A HREF="javascript:onClose()"
- onMouseDown="change('closeA', 'ok', 1)"
- onMouseOut="change('closeA', 'ok', 0)"><IMG SRC="<%=buttons%>ok.gif" NAME="closeA" BORDER="0" WIDTH="50" HEIGHT="20" ALT="Save and Close" HSPACE="5"></A>
- </TD>
- </TR>
- <!----- table footer ends here --->
- </TABLE>
- </TD>
- </TR>
- <!------ end of block ----->
- </TABLE>
- <!--- end of the tab body --->
- </TD></TR></TABLE>
-
- <!--- footer starts here --->
- <SCRIPT LANGUAGE="JavaScript1.2">
- <!--
- var href="/services/attached.fts?id=<%=id%>&type=<%=type%>";
- var bodywidth=<%=bodywidth%>;
- //-->
- </SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/footer.js"></SCRIPT>
- <!--- footer ends here --->
- </FORM>
- </TD><TD WIDTH="10"> </TD></TD></TR></TABLE>
- </BODY>
- </HTML>
-