home *** CD-ROM | disk | FTP | other *** search
/ Your Business Pak / BusinessPak2.iso / Netscape / CD / as.z / asw.jar / connect1.js < prev    next >
Text File  |  1998-10-15  |  5KB  |  135 lines

  1. /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. <!--  to hide script contents from old browsers
  19.  
  20.  
  21.  
  22. function go(msg)
  23. {
  24.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  25.  
  26.     if (parent.parent.globals.document.vars.editMode.value != "yes")    {
  27.         // if RegServer specified in ACCTSET.INI, use it
  28.     
  29.         var theFile = parent.parent.globals.getAcctSetupFilename(self);
  30.         var intlFlag = parent.parent.globals.GetNameValuePair(theFile,"Mode Selection","IntlMode");
  31.         intlFlag = intlFlag.toLowerCase();
  32.     
  33.         var theRegFile = parent.parent.globals.GetNameValuePair(theFile,"New Acct Mode","RegServer");
  34.         
  35.         if (theRegFile != null && theRegFile != "")    {
  36.             parent.parent.globals.document.vars.regServer.value = theRegFile;
  37.             }
  38.         else    {
  39.             // otherwise, if multiple .IAS files exist, get list selection and determine appropriate .IAS file
  40.     
  41.             var pathName = parent.parent.globals.getConfigFolder(self);
  42.             var theList = parent.parent.globals.document.setupPlugin.GetFolderContents(pathName,".IAS");
  43.             if (theList != null)    {
  44.                 if (theList.length >1)    {
  45.                     if (document.forms[0].regServerList.selectedIndex<0)    {
  46.                         alert("Please select an Internet account server.");
  47.                         return(false);
  48.                         }
  49.                     for (var x=0; x<theList.length; x++)    {
  50.                         var file = parent.parent.globals.getConfigFolder(self) + theList[x];
  51.                         var name = parent.parent.globals.document.setupPlugin.GetNameValuePair(file,"Dial-In Configuration","SiteName");
  52.     
  53.                         if (name == document.forms[0].regServerList.options[document.forms[0].regServerList.selectedIndex].text)    {
  54.                             parent.parent.globals.document.vars.regServer.value = theList[x];
  55.                             break;
  56.                             }
  57.                         }
  58.                     if (parent.parent.globals.document.vars.regServer.value == "")    {
  59.                         alert("Internal problem locating appropriate registration server file.");
  60.                         return(false);
  61.                         }
  62.                     }
  63.                 else if (theList.length==1)    {
  64.                     parent.parent.globals.document.vars.regServer.value = theList[0];
  65.                     }
  66.                 else    {
  67.                     alert("Internal problem locating a registration server file.");
  68.                     return(false);
  69.                     }
  70.                 }
  71.             else    {
  72.                 alert("Internal problem locating appropriate registration server file.");
  73.                 return(false);
  74.                 }
  75.             }
  76.         return(true);
  77.         }
  78.     else    {
  79.         return(false);
  80.         }
  81. }
  82.  
  83.  
  84.  
  85. function checkData()
  86. {
  87.     return(true);
  88. }
  89.  
  90.  
  91.  
  92. function loadData()
  93. {
  94.     if (parent.controls.generateControls)    parent.controls.generateControls();
  95. }
  96.  
  97.  
  98.  
  99. function saveData()
  100. {
  101. }
  102.  
  103.  
  104.  
  105. function generateRegServerList()
  106. {
  107.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  108.  
  109.     // if RegServer is not specified in ACCTSET.INI and multiple .IAS files exist, build list
  110.  
  111.     var theFile = parent.parent.globals.getAcctSetupFilename(self);
  112.     var theRegFile = parent.parent.globals.GetNameValuePair(theFile,"New Acct Mode","RegServer");
  113.     
  114.     if (theRegFile == null || theRegFile == "")    {
  115.         var pathName = parent.parent.globals.getConfigFolder(self);
  116.         var theList = parent.parent.globals.document.setupPlugin.GetFolderContents(pathName,".IAS");
  117.         if (theList != null)    {
  118.             if (theList.length >1)    {
  119.                 document.writeln("<TABLE CELLPADDING=2 CELLSPACING=0 ID='minspace'><TR><TD ALIGN=LEFT VALIGN=TOP HEIGHT=25><spacer type=vertical size=2><B>Select an Internet account server:</B></TD><TD ALIGN=LEFT VALIGN=TOP><FORM><SELECT NAME='regServerList'>");
  120.                 for (var x=0; x<theList.length; x++)    {
  121.                     var file = parent.parent.globals.getConfigFolder(self) + theList[x];
  122.                     var name = parent.parent.globals.document.setupPlugin.GetNameValuePair(file,"Dial-In Configuration","SiteName");
  123.                     var selected=(x==0) ? " SELECTED":"";
  124.                     document.writeln("<OPTION VALUE='" + name + "'" + selected + ">" + name);
  125.                     }
  126.                 document.writeln("</SELECT></FORM></TD></TR></TABLE>");
  127.                 }
  128.             }
  129.         }
  130. }
  131.  
  132.  
  133.  
  134. // end hiding contents from old browsers  -->
  135.