home *** CD-ROM | disk | FTP | other *** search
- <%
- #include </utility/security.fts>
- #include </utility/global.fts>
- #include </utility/theme.fts>
- #include </utility/ftgate.fts>
-
- var w = new server.web
-
- var id
-
- session.system.error=0
-
- if (form.config=="1")
- {
- id = form.id
-
- w.id = id
- w.scripttimeout = form.scripttimeout
-
- if (form.command=="1")
- w.script.add(form.scripturl, form.scriptscript)
- else if (form.command=="2")
- w.script.remove(form.scriptlist)
-
- if (form.redirect!="")
- output.redirect(form.redirect+"?id="+id)
- }
- else if (form.config=="2")
- {
- if (form.redirect!="")
- output.redirect(form.redirect+"?id="+form.id)
- }
- else
- {
- id = request.id
- w.id = id
- }
- %>
- <!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 -- Web Scripts</TITLE>
-
- <SCRIPT LANGUAGE="JavaScript1.2" TYPE="text/javascript">
- <!--
- var dir="<%=buttons%>";
- var pro=<%=build()==FTGATE_PRO%>;
-
- if (!document.images) {}
- else {
- create0 = new Image();
- create0.src = dir+"create.gif";
- create1 = new Image();
- create1.src = dir+"createon.gif";
- delete0 = new Image();
- delete0.src = dir+"delete.gif";
- delete1 = new Image();
- delete1.src = dir+"deleteon.gif";
- plus0 = new Image();
- plus0.src = dir+"open.gif";
- plus1 = new Image();
- plus1.src = dir+"openon.gif";
- minus0 = new Image();
- minus0.src = dir+"close.gif";
- minus1 = new Image();
- minus1.src = dir+"closeon.gif";
- }
-
- <%
- if (netscape)
- {
- %>
- document.captureEvents(Event.KEYPRESS);
- document.onkeypress = keypress;
-
- function keypress(event)
- {
- if (event.which==13)
- {
- onAdd(document.ftgate.scripturl, document.ftgate.scriptscript, document.ftgate.scriptlist, 'createA');
- return false;
- }
-
- return true;
- }
- <%
- }
- else
- {
- %>
- function keypress()
- {
- if (event.keyCode==13)
- {
- event.returnValue=null;
- onAdd(document.ftgate.scripturl, document.ftgate.scriptscript, document.ftgate.scriptlist, 'createA');
- }
- }
- <%
- }
- %>
-
- function onLoad()
- {
- setPage(5, "Web Service");
-
- onSelect(document.ftgate.scripturl, document.ftgate.scriptscript, document.ftgate.scriptlist)
- document.ftgate.scripttimeout.value = toNicePeriod(<%=w.scripttimeout%>);
-
- document.ftgate.scripturl.focus();
- }
-
- function isURL(url)
- {
- if (url!="")
- return true;
- else
- return false;
- }
-
- function onAdd(url, script, list, button)
- {
- var index=-1;
-
- change(button, 'create', 0);
-
- if (!isURL(url.value))
- {
- alert("Enter a URL of the form '\\folder1\\folder2'.");
- url.focus();
- return;
- }
-
- if (!isScript(script.value))
- {
- alert(errScript);
- script.focus();
- return;
- }
-
- if (list.length)
- {
- var found=false;
- for (i=0; i<list.length; i++)
- {
- if (list.options[i].value == url.value)
- {
- found=true;
- break;
- }
- }
-
- if (found)
- {
- alert("This address is already present.")
- return;
- }
- }
-
- if (!isOK(document.ftgate))
- return;
-
- document.ftgate.command.value=1;
- document.ftgate.submit();
- }
-
- function onDelete(list, button)
- {
- change(button, 'delete', 0);
-
- if (!isOK(document.ftgate))
- return;
-
- if (list.selectedIndex!=-1)
- {
- document.ftgate.command.value=2;
- document.ftgate.submit();
- }
- }
-
- function onSelect(part1, part2, list)
- {
- var index = list.selectedIndex;
-
- if (index!=-1)
- {
- var str = list.options[index].text;
- var start = str.indexOf("[");
- var end = str.indexOf("]");
-
- part1.value = str.slice(0, start);
- part2.value = str.slice(start+1,end);
- }
- }
-
- function isOK(form)
- {
- if (!isPeriod(form.scripttimeout.value))
- {
- alert(errPeriod);
- form.scripttimeout.focus();
- return false;
- }
-
- form.scripttimeout.value = fromNicePeriod(form.scripttimeout.value);
-
- return true;
- }
-
- function onUpEdit()
- {
- change('plusA', 'plus', 0);
- onUpPeriod(document.ftgate.scripttimeout);
- setModified(true);
- }
-
- function onDownEdit()
- {
- change('minusA', 'minus', 0);
- onDownPeriod(document.ftgate.scripttimeout, true);
- setModified(true);
- }
- //-->
- </SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/cookies.js" TYPE="text/javascript"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/core.js" TYPE="text/javascript"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/time.js" TYPE="text/javascript"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/spin.js" TYPE="text/javascript"></SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/dialog.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"><%=w.name%></SPAN>
-
- <FORM NAME="ftgate" METHOD="POST" onSubmit="return isOK(this)" ACTION="scripts.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="redirect" VALUE="">
-
- <!-- start of the tabs -->
- <TABLE BORDER="0" WIDTH="100%" CELLSPACING="0" CELLPADDING="0">
- <TR>
- <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('http.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('scripts.fts')" CLASS="navon">Scripts</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('virtuals.fts')" CLASS="navoff">Virtuals</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('addresshttp.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>
- </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>
- <TD ROWSPAN="2" WIDTH="1%" VALIGN="TOP">
- <A HREF="javascript:onDelete(document.ftgate.scriptlist, 'deleteA')"
- onMouseDown="change('deleteA', 'delete', 1)"
- onMouseOut="change('deleteA', 'delete', 0)"><IMG SRC="<%=buttons%>delete.gif" NAME="deleteA" BORDER="0" WIDTH="20" HEIGHT="20" ALT="Remove selected script"></A>
- </TD>
- <TD ROWSPAN="2">
- <SELECT NAME="scriptlist" CLASS="SEL100" SIZE="5"
- onChange="onSelect(document.ftgate.scripturl, document.ftgate.scriptscript, document.ftgate.scriptlist)">
- <%
- var first=true
-
- var ok=w.script.first()
- while (ok)
- {
- var str = w.script.url+"["+w.script.name+"]"
-
- output.write("<OPTION ")
- if (first)
- {
- first=false
- output.write("SELECTED ")
- }
- output.writeln("VALUE="+w.script.url+">"+str+"</OPTION>")
- ok=w.script.next()
- }
- %>
- </SELECT>
- </TD>
- <TD WIDTH="1%" NOWRAP VALIGN="TOP">URL</TD>
- <TD WIDTH="1%" NOWRAP VALIGN="TOP"><INPUT TYPE="TEXT" NAME="scripturl" VALUE="" onChange="setModified(true)"></TD>
- <TD WIDTH="1%" VALIGN="TOP" ROWSPAN="2">
- <A HREF="javascript:onAdd(document.ftgate.scripturl, document.ftgate.scriptscript, document.ftgate.scriptlist, 'createA')"
- onMouseDown="change('createA', 'create', 1)"
- onMouseOut="change('createA', 'create', 0)"><IMG SRC="<%=buttons%>create.gif" NAME="createA" BORDER="0" WIDTH="20" HEIGHT="20" ALT="Add script"></A>
- </TD>
- </TR>
- <TR>
- <TD WIDTH="1%" NOWRAP VALIGN="TOP">Script</TD>
- <TD WIDTH="1%" NOWRAP VALIGN="TOP"><INPUT TYPE="TEXT" NAME="scriptscript" VALUE="" onChange="setModified(true)"></TD>
- </TR>
- <TR>
- <TD COLSPAN="4">Script timeout
- <INPUT TYPE="TEXT" NAME="scripttimeout" VALUE="<%=w.scripttimeout%>" SIZE="6" onChange="setModified(true)">
- <A HREF="javascript:onUpEdit()"
- onMouseDown="change('plusA', 'plus', 1)"
- onMouseOut="change('plusA', 'plus', 0)"><IMG SRC="<%=buttons%>open.gif" NAME="plusA" BORDER="0" WIDTH="20" HEIGHT="20" ALT="Increment"></A>
- <A HREF="javascript:onDownEdit()"
- onMouseDown="change('minusA', 'minus', 1)"
- onMouseOut="change('minusA', 'minus', 0)"><IMG SRC="<%=buttons%>close.gif" NAME="minusA" BORDER="0" WIDTH="20" HEIGHT="20" ALT="Decrement"></A>
- </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="Apply changes and close" HSPACE="5"></A>
- <A HREF="javascript:onCancel()"
- onMouseDown="change('cancelA', 'cancel', 1)"
- onMouseOut="change('cancelA', 'cancel', 0)"><IMG SRC="<%=buttons%>cancel.gif" NAME="cancelA" BORDER="0" WIDTH="50" HEIGHT="20" ALT="Cancel"></A>
- <A HREF="javascript:onApply()"
- onMouseDown="change('applyA', 'apply', 1)"
- onMouseOut="change('applyA', 'apply', 0)"><IMG SRC="<%=buttons%>apply.gif" NAME="applyA" BORDER="0" WIDTH="50" HEIGHT="20" ALT="Apply changes" 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" TYPE="text/javascript">
- <!--
- var href="/services/scripts.fts?id=<%=id%>";
- var bodywidth=<%=bodywidth%>;
- //-->
- </SCRIPT>
- <SCRIPT LANGUAGE="JavaScript1.2" SRC="/utility/footer.js" TYPE="text/javascript"></SCRIPT>
- <!-- footer ends here -->
- </FORM>
- </TD><TD WIDTH="10"> </TD></TR></TABLE>
- </BODY>
- </HTML>
-