home *** CD-ROM | disk | FTP | other *** search
/ Online Praxis 1998 March / Image.iso / CD-ROM / NETSCAPE / CCK / ASE.Z / settings.js < prev    next >
Encoding:
Text File  |  1997-08-21  |  24.3 KB  |  609 lines

  1. <!--  to hide script contents from old browsers
  2.  
  3.  
  4. //    THIS IS THE API for functions you will want to access from outside of this javascript file:
  5. //    you probably want to use these functions in the OnLoad and OnUnload event handlers of your htmls files,
  6. //    in order     (1) Get all the appropriate information from the config files and set the appropriate form fields on load
  7. //    and            (2)    To write the data from your form fields back out to the config files on unload    
  8.  
  9. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  10. //    these functions interface with the config files (e.g., ACCTSET.INI)
  11. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  12.  
  13. //    function GetNameValuePair(fileName, sectionName, flagName)            //    looks in the file fileName for a line that looks like "flagName=value"
  14.                                                                         //    under the section called "[sectionName]".  If it finds one, returns value.
  15.                                                                         
  16. //    function SetNameValuePair(fileName, sectionName, flagName, data)    //    in the file fileName, writes a line that looks like "flagname=data" under
  17.                                                                         //    the section called "[sectionName]" -will create the file and/or section name
  18.                                                                         //    if necessary    
  19.  
  20. //    function getFileListFromConfigFolder(fileSuffix)                    //    returns a list of files with the specified suffix that live
  21.                                                                         //    in the Config Folder
  22.                                                                         
  23.                                                                         
  24. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  25. //    these functions set the elements of your form    (all return nothing)
  26. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  27. //    function setCheckBox(formName, boxName, inValue)    //    if inValue = 0 sets checkbox to off, else to on
  28. //    function setRadio(formName, radioName, inValue)        //    inValue is yes or no - yes is first, no is second radio.  If inValue is a number, sets
  29.                                                         //    the inValueth radio with that name to on.  (0 < inValue < 33, jsut for sanity checking0
  30. //    function setText(formName, textFieldName, inValue)    //    sets the specified textField to the input value
  31.  
  32. //    function setCardTypes(formName, cardTypesString)        // cardTypesString is a string of the form "AX,MC,DC,VI" as per ACCTSET.INI requirements, this sets
  33.                                                 // four checkboxes whose names MUST be: "AX", "MC", "DC", and "VI"
  34. //    function fillSelectListWithConfigFiles(formName, selectListName, fileSuffix, offerNew)    // finds all files with the suffix fileSuffix
  35.                                                                                     // (should look like ".NCI") and fills in the specified list
  36.                                                                                     // this is used by the following two functions
  37.                                                                                     // if offerNew is true, an option will be provided with name
  38.                                                                                     // "New Configuration" and value "_new_"
  39.  
  40. //    function fillNCIFileList(formName, selectListName)    //will fill the specified select list with the names of all NCI files in the Config folder
  41. //    function fillIASFileList(formName, selectListName)    //will fill the specified select list with the names of all IAS files in the Config folder
  42.                                                         //selects RegServ.SR if that file exists
  43. //    function setSelectList(formName, selectListName, inValue)    // sets the selectlist to select the option whose text is inValue, if it exists
  44.                                                                 // used internally to set the value of the NCI file list, for example
  45.                                                                 
  46. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  47. //    these functions get the values of elements of your form and return text suitable for writing into Config files (all return strings)
  48. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  49. //    function getRadio(formName, radioName)            //     returns "yes" if first radio is selected, "no" if second is selected, else returns
  50.                                                     //    index of selected radio (-1 if none selected)
  51. //    function getText(formName, textFieldName)        //    returns the text inside a text field
  52. //    function getCheckBox(formName, selectListName)    //    returns true if checkbox is checked, false if not
  53. //    function getSelectListSelection(formName, selectListName)
  54.  
  55. ////////these are specific functions which get specfic information using the above functions//////////////////
  56. //    function getCardTypes(formName)        // returns a string of the form "AX,MC,DC,VI", based on the values of the four checkboxes in
  57.                                         // the specified form, whose names MUST be: "AX", "MC", "DC", and "VI"
  58.                                         
  59. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  60. //    Other Functions
  61. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  62.  
  63. //function yesNoToNoYes(inValue)    // if inValue == "yes" returns "no".  if invalue == "no" returns yes, else nothing
  64.  
  65. //function getAcctSetupFileName()    //returns the name of ACCTSET.INI
  66.  
  67. //function debug(theString)    // writes the string to the java console, using the setUpPlugin
  68.  
  69. //these should be overriden if this file is included from within another javascript file
  70. //    function checkData()        // this should return true in most cases, you can add checks in here for determining if any necessary fields
  71.                                 // have been left empty, etc. - if it returns false, account setup's global navigation won't proceed when next is clicked
  72. //    function getAcctSetFlags()    // this is an example of a function that would be used as an onLoad handler in a file where the form name is
  73.                                 // "acctsetForm", and it has form elements for all the flags in ACCTSET.INI 
  74. //    function saveAcctSetFlags()    // this is an example of a function that would be used as an onUnLoad handler in a file where the form name is
  75.                                 // "acctsetForm", and it has form elements for all the flags in ACCTSET.INI 
  76.  
  77. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  78. //    LOCATION DEPENDENT FUNCTIONS
  79. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  80. // The following functions are dependent on the LOCATION OF THIS FILE and the LOCATION OF THE globals.js FILE
  81. //    actually, they are really dependent on the part of the frameset heirarchy in which this file is included
  82. //    right now we assume it is included two framesets deep, and the outermost frameset contains a frame called "globals", 
  83. //    which includes the "globals.js" file which is the meat of the account setup javascript universe - it interfaces with the plugin
  84. //  SO, if the heirarchy changes, the path of the "globals" frame should be updated
  85.  
  86. //    function getGlobalsLocation()
  87.  
  88.  
  89. //this is the function that determines where access to the globals is
  90. //from the document that is including this file.
  91. //it's made out of ugly hacks and ricotta cheese
  92. function getGlobalsLocation()
  93. {
  94.     var loc = ""; 
  95.  
  96.     //this stuff is no longer necessary, since we now do everything in the same window,
  97.     //and the globals are always in the same relative location.    
  98.     //if (top.name == "addnci")
  99.     //{    
  100.     //    //alert("addnci!");
  101.     //    loc = ("top.opener.top.globals");
  102.     //}
  103.     
  104.     //else if (top.name == "addias")
  105.     //{
  106.     //    loc = ("top.window.opener.globals");
  107.     //}
  108.     //else
  109.     //{
  110.         //standard case, globals is in the same window
  111.         var loc = "top.globals";
  112.         
  113.     //}
  114.     return loc;
  115. }
  116.  
  117.  
  118.  
  119. function getAcctSetupFileName()
  120. {
  121.     return     "ACCTSET.INI";
  122. }
  123.  
  124. function completeConfigFilePath(inFileName)
  125. {
  126.     var outFileName = top.globals.getConfigFolder(top.globals) + inFileName;
  127.     return outFileName;
  128. }
  129.  
  130.  
  131. ///WARNING THE LOCATION OF THE GLOBALS IS HARDCODED IN THIS FCN - it can only be accessed by children windows
  132. function saveNewConfigFile(fileName, inValue, doPrompt)
  133. {
  134.     // Request privilege
  135.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  136.  
  137.     if ((doPrompt != true) && (doPrompt != false))
  138.         doPrompt = false;    //should we really assume false?
  139.     
  140.     if ((fileName != null) && (fileName != ""))
  141.     {
  142.         var cFileName = completeConfigFilePath(fileName);
  143.         
  144.         if ((cFileName != null) && (inValue != null) && (cFileName != "") && (inValue != ""))
  145.             top.globals.document.setupPlugin.SaveTextToFile(cFileName, inValue, doPrompt);
  146.         
  147.     }
  148. }
  149.  
  150. function debug(theString)
  151. {
  152.     top.globals.debug(theString);
  153. }
  154.  
  155.  
  156. function GetNameValuePair(inFileName, sectionName, flagName)
  157. {
  158.     // Request privilege
  159.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  160.  
  161.     
  162.     var fileName = completeConfigFilePath(inFileName);
  163.  
  164.     
  165.     var data = top.globals.document.setupPlugin.GetNameValuePair(fileName, sectionName, flagName);
  166.     
  167.     
  168.     debug("\tGetNameValuePair: (" + inFileName + ") [" +sectionName+ "] " +flagName+ "=" + data);
  169.     return data;
  170. }
  171.  
  172. function SetNameValuePair(inFileName, section, variable, data)
  173. {
  174.     // Request privilege
  175.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  176.  
  177.     var fileName = completeConfigFilePath(inFileName);
  178.  
  179.     top.globals.document.setupPlugin.SetNameValuePair(fileName, section, variable, data);
  180.     debug("\tSetNameValuePair: (" + fileName + ")[" +section+ "] " +variable+ "=" + data);
  181. }
  182.  
  183. function getFileListFromConfigFolder(fileSuffix)
  184. {
  185.     // Request privilege
  186.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  187.  
  188.     var pathName = top.globals.getConfigFolder(top.globals);
  189.     var globalsLocate = top.globals;
  190.     var theList = top.globals.document.setupPlugin.GetFolderContents(pathName, fileSuffix);
  191.  
  192.     return theList;
  193. }
  194.  
  195. function fillSelectListWithConfigFiles(formName, selectListName, fileSuffix, offerNew)
  196. {
  197.     var curConfigName = "";
  198.     var curConfigDescription = "";
  199.  
  200.     //blank out old list
  201.     for (var i = (document[formName][selectListName].length -1); i >= 0 ; i--)
  202.     {
  203.         document[formName][selectListName].options[i] = null;
  204.     }    
  205.     
  206.     //make a blank so the user can choose nothing
  207.     document[formName][selectListName].options[0] = new Option("< None Selected >","",false, false); 
  208.     
  209.     //Only offer a new if we said so
  210.     if (offerNew == true)
  211.         document[formName][selectListName].options[1] = new Option("< New Configuration >","_new_",false, false); 
  212.  
  213.     // Get a list of the files in the Config folder
  214.     fileList = getFileListFromConfigFolder(fileSuffix);
  215.     
  216.     //alert( "filelist: " + fileList);
  217.     
  218.     if (fileList != null)    {
  219.         for (var i=0; i<fileList.length; i++)    {
  220.                 curConfigName             = GetNameValuePair(fileList[i], "Dial-In Configuration", "SiteName");
  221.                 curConfigDescription     = GetNameValuePair(fileList[i], "Dial-In Configuration", "Description");
  222.  
  223.                 if ((curConfigName != null)  && (curConfigName != ""))
  224.                     document[formName][selectListName].options[document[formName][selectListName].length] = new Option(curConfigName,fileList[i], false, false);
  225.                 else if ((curConfigDescription != null) && (curConfigDescription != ""))
  226.                     document[formName][selectListName].options[document[formName][selectListName].length] = new Option(curConfigDescription,fileList[i], false, false);
  227.                 else
  228.                     document[formName][selectListName].options[document[formName][selectListName].length] = new Option(fileList[i],fileList[i], false, false);
  229.                     
  230.             }
  231.         }
  232. }
  233.  
  234.  
  235. //this is a helper function that converts "yes" to 0 and "no" to 1 - but leaves integers alone
  236. function ynToZeroOne(inValue)
  237. {
  238.     var ynValue = new String(inValue);
  239.     var intValue = -1;
  240.     
  241.     if (ynValue == "yes") 
  242.     {
  243.         intValue = 0;    
  244.     }
  245.     
  246.     else if (ynValue == "no")
  247.     {
  248.         intValue = 1;        
  249.     }
  250.     
  251.     else
  252.     {
  253.     if (!isNaN(parseInt(inValue)))
  254.         {
  255.                 intValue = inValue;
  256.         }
  257.     }
  258.     return intValue;    
  259. }
  260.  
  261.  
  262. function yesNoToNoYes(inValue)
  263. {
  264.     var tempValue = new String(inValue);
  265.     
  266.     if ((tempValue != null))
  267.     {
  268.         if (tempValue == "yes")
  269.         {
  270.             return "no";    
  271.         }        
  272.         else if (tempValue == "no")
  273.         {
  274.             return "yes";
  275.         }    
  276.         else
  277.             return inValue;    
  278.     }
  279. }
  280.  
  281. //set checkbox on if inValue is "yes" or 0, off otherwise
  282. function setCheckBox(formName, boxName, inValue)
  283. {
  284.  
  285.     debug("SetCheckbox: " + inValue);
  286.     var intValue = ynToZeroOne(inValue);
  287.  
  288.     if (intValue == 0)
  289.         document[formName][boxName].checked = 1;
  290.     else
  291.         document[formName][boxName].checked = 0;
  292. }
  293.  
  294. function getCheckBox(formName, boxName)        // returns yes if checked, no if not
  295. {
  296.     var outValue = "no";
  297.     
  298.     var tfValue =    (document[formName][boxName].checked);
  299.         
  300.     if (tfValue == true)
  301.         outValue = "yes";
  302.         
  303.     return outValue;    
  304. }
  305.  
  306. function setRadio(formName, radioName, inValue)
  307. {
  308.     var intValue = ynToZeroOne(inValue);
  309.  
  310.     document[formName][radioName][intValue].checked = 1;
  311.     debug("Setting radio " +radioName + " to " + intValue);
  312. }
  313.  
  314. function getRadio(formName, radioName)
  315. {
  316.     var radioIndex = -1;
  317.     //based on the assumption that yes is the first radio, "no" is the second radio
  318.     
  319.     if (document[formName][radioName][0].checked == 1)
  320.     {
  321.         //debug("getRadio: returning yes");
  322.         return ("yes");
  323.     }
  324.     else if (document[formName][radioName][1].checked == 1)
  325.     {    
  326.         //debug("getRadio: returning no");
  327.         return ("no");
  328.     }
  329.     else
  330.     {
  331.         //debug("getRadio: radio[0]" + document[formName][radioName][0].checked);
  332.         //debug("getRadio: radio[1]" + document[formName][radioName][1].checked);
  333.          
  334.         for (var i = 0; i < document[formName][radioName].length; i++)
  335.         {
  336.             if (document[formName][radioName][i].checked == 1)    
  337.                 radioIndex = i;        
  338.         }
  339.         return radioIndex;
  340.     }
  341. }
  342.  
  343. function getText(formName, textFieldName)
  344. {
  345.     return document[formName][textFieldName].value;
  346. }
  347.  
  348. function setText(formName, textFieldName, inValue)
  349. {
  350.     debug("Setting Text for " + textFieldName + " to " + inValue);
  351.     document[formName][textFieldName].value = inValue;
  352. }
  353.  
  354. function setCardTypes(formName, value)
  355. {
  356.     var cTypes = new String(value);
  357.     if (value.indexOf("AX") >= 0) setCheckBox(formName, "AX", 0);
  358.         else setCheckBox(formName, "AX", 1);
  359.     if (value.indexOf("MC") >= 0) setCheckBox(formName, "MC", 0);
  360.         else setCheckBox(formName, "MC", 1);
  361.     if (value.indexOf("DC") >= 0) setCheckBox(formName, "DC", 0);
  362.         else setCheckBox(formName, "DC", 1);
  363.     if (value.indexOf("VI") >= 0) setCheckBox(formName, "VI", 0);
  364.         else setCheckBox(formName, "VI", 1);
  365.     
  366. }
  367.  
  368. function getCardTypes(formName)
  369. {
  370.     var cardTypes = "";
  371.  
  372.     if (document[formName].AX.checked == 1)
  373.         cardTypes = "AX,";
  374.     if (document[formName].MC.checked == 1)
  375.         cardTypes = (cardTypes + "MC,");
  376.     if (document[formName].DC.checked == 1)
  377.         cardTypes = (cardTypes + "DC,");
  378.     if (document[formName].VI.checked == 1)
  379.         cardTypes = (cardTypes + "VI");
  380.  
  381.     if ( ( cardTypes.length > 2) && (cardTypes.charAt(cardTypes.length-1) == ","))
  382.         cardTypes = cardTypes.substring(0, cardTypes.length-1);
  383.     
  384.     cardTypes = ("\"" + cardTypes + "\"");
  385.  
  386.     return cardTypes;
  387. }
  388.  
  389.  
  390. function setSelectList(formName, selectListName, inValue)
  391. {
  392.     if (inValue != null)
  393.     { 
  394.          for (var i = (document[formName][selectListName].length - 1); i >= 0 ; i--)
  395.          {
  396.              if(inValue.toString() == (document[formName][selectListName].options[i].value.toString()))
  397.              {
  398.                  //debug("Found select list Match (" + i + ")(" + inValue + ")");
  399.                  document[formName][selectListName].options[i].selected = true;
  400.              }
  401.          }
  402.     }    
  403. }
  404.  
  405.  
  406.  
  407. function fillNCIFileList(formName, listName)
  408. {
  409.         fillSelectListWithConfigFiles(formName, listName, ".NCI", false);
  410.         
  411.         var acctSetupFile = getAcctSetupFileName();
  412.          var selectedNCIFile = GetNameValuePair(acctSetupFile,"Mode Selection","ExistingSRFile");
  413.         setSelectList(formName, listName, selectedNCIFile);
  414. } // fillNCIFileList
  415.  
  416. function fillIASFileList(formName, listName)
  417. {
  418.         fillSelectListWithConfigFiles(formName, listName, ".IAS", false);
  419.         
  420.         var acctSetupFile = getAcctSetupFileName();
  421.          var selectedIASFile = GetNameValuePair(acctSetupFile,"New Acct Mode","RegServer");
  422.  
  423.         setSelectList(formName, listName, selectedIASFile);        
  424. } // fillIASFileList
  425.  
  426.  
  427. function getSelectListSelection(formName, selectListName)
  428. {
  429.     return    document[formName][selectListName].options[document[formName][selectListName].options.selectedIndex].value.toString();
  430. }
  431.  
  432.  
  433. // this is a smaple onLoad event handler - this would be used if the form in question
  434. // had an element for each and every flag in ACCTSET.INI
  435. function getAcctSetFlags()
  436. {
  437.     
  438.  
  439.     var acctSetupFile        = getAcctSetupFileName();
  440.      var tempFlagValue         =     "";
  441.      var asFormName            =    "acctsetForm";
  442.      
  443.      //parent.parent.parent.status = ("loading data from " + acctSetupFile + "...");
  444.      
  445.      //get all the flags related to mode selection, set the appropriate form fields (4)
  446.     tempFlagValue = GetNameValuePair(acctSetupFile,"Mode Selection","ForceExisting");
  447.     setRadio(asFormName, "ForceExisting", tempFlagValue);
  448.         
  449.     fillNCIFileList(asFormName, "ExistingSRFile");
  450.     
  451.     tempFlagValue = GetNameValuePair(acctSetupFile,"Mode Selection","ForceNew");
  452.     setRadio(asFormName, "ForceNew", tempFlagValue);
  453.     tempFlagValue = GetNameValuePair(acctSetupFile,"Mode Selection","IntlMode");
  454.     setRadio(asFormName, "IntlMode", tempFlagValue);
  455.     
  456.     //get all the flags related to new account mode, set the appropriate form fields (9)
  457.     tempFlagValue = GetNameValuePair(acctSetupFile,"New Acct Mode","ShowNewPathInfo");
  458.     setRadio(asFormName, "ShowNewPathInfo", tempFlagValue);
  459.     tempFlagValue = GetNameValuePair(acctSetupFile,"New Acct Mode","AskSaveAcctInfo");
  460.     setRadio(asFormName, "AskSaveAcctInfo", tempFlagValue);
  461.     tempFlagValue = GetNameValuePair(acctSetupFile,"New Acct Mode","SavePasswords");
  462.     setRadio(asFormName, "SavePasswords", tempFlagValue);
  463.     tempFlagValue = GetNameValuePair(acctSetupFile,"New Acct Mode","AskPersonalInfo");
  464.     setRadio(asFormName, "AskPersonalInfo", tempFlagValue);
  465.     tempFlagValue = GetNameValuePair(acctSetupFile,"New Acct Mode","AskBillingInfo");
  466.     setRadio(asFormName, "AskBillingInfo", tempFlagValue);
  467.     tempFlagValue = GetNameValuePair(acctSetupFile,"New Acct Mode","RegServer");
  468.     setText(asFormName, "RegServer", tempFlagValue);
  469.     tempFlagValue = GetNameValuePair(acctSetupFile,"New Acct Mode","CardTypes");
  470.     setCardTypes(asFormName, tempFlagValue);
  471.     
  472.     //get all the flags related to Existing account mode, set the appropriate form fields (15)
  473.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","ShowExistingPathInfo");
  474.     setRadio(asFormName, "ShowExistingPathInfo", tempFlagValue);
  475.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","RegPodURL");
  476.     setText(asFormName, "RegPodURL", tempFlagValue);
  477.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","ShowIntro2");
  478.     setRadio(asFormName, "ShowIntro2", tempFlagValue);
  479.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","ShowPhones");
  480.     setRadio(asFormName, "ShowPhones", tempFlagValue);
  481.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","AskName");
  482.     setRadio(asFormName, "AskName", tempFlagValue);
  483.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","AskLogin");
  484.     setRadio(asFormName, "AskLogin", tempFlagValue);
  485.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","AskTTY");
  486.     setRadio(asFormName, "AskTTY", tempFlagValue);
  487.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","AskEmail");
  488.     setRadio(asFormName, "AskEmail", tempFlagValue);
  489.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","AskPhone");
  490.     setRadio(asFormName, "AskPhone", tempFlagValue);
  491.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","AskDNS");
  492.     setRadio(asFormName, "AskDNS", tempFlagValue);
  493.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","AskHosts");
  494.     setRadio(asFormName, "AskHosts", tempFlagValue);
  495.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","AskPublishing");
  496.     setRadio(asFormName, "AskPublishing", tempFlagValue);
  497.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","AskRegister");
  498.     setRadio(asFormName, "AskRegister", tempFlagValue);
  499.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","AskLDAP");
  500.     setRadio(asFormName, "AskLDAP", tempFlagValue);
  501.     tempFlagValue = GetNameValuePair(acctSetupFile,"Existing Acct Mode","AskIMAP");
  502.     setRadio(asFormName, "AskIMAP", tempFlagValue);
  503.     
  504.     //parent.parent.status = ("Loading Data.....Done.");
  505. }//function getAcctSetFlags()
  506.  
  507.  
  508. function checkData()
  509. {
  510.     return true;
  511. }
  512.  
  513.  
  514. //sample onUnload event handler - this would be used if the form in question
  515. // had an element for each and every flag in ACCTSET.INI
  516. function saveAcctSetFlags()
  517. {
  518.     // save globals here
  519.  
  520.     var modeSectionName        =     "Mode Selection";
  521.     var existingSectionName    =    "Existing Acct Mode";
  522.     var newSectionName        =    "New Acct Mode";
  523.     var    asFormName            =    "acctsetForm";
  524.  
  525.     //debug("trying to save...");
  526.  
  527.     // Request privilege
  528.     netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  529.  
  530.     if (top.globals.document.setupPlugin == null)    return;
  531.  
  532.     var acctSetupFile = getAcctSetupFileName();
  533.     
  534.     debug("writing data to " + acctSetupFile);
  535.     
  536.     if (acctSetupFile != null && acctSetupFile != "")    {
  537.  
  538.         SetNameValuePair(acctSetupFile,modeSectionName,"ForceExisting", getRadio("acctsetForm", "ForceExisting"));
  539.         SetNameValuePair(acctSetupFile,modeSectionName,"ExistingSRFile", getSelectListSelection("acctsetForm", "ExistingSRFile"));
  540.         SetNameValuePair(acctSetupFile,modeSectionName,"ForceNew", getRadio(asFormName,"ForceNew"));
  541.         SetNameValuePair(acctSetupFile,modeSectionName,"IntlMode", getRadio(asFormName,"IntlMode"));
  542.         
  543.         
  544.         SetNameValuePair(acctSetupFile,newSectionName,"ShowNewPathInfo", getRadio(asFormName,"ShowNewPathInfo"));
  545.         SetNameValuePair(acctSetupFile,newSectionName,"AskSaveAcctInfo", getRadio(asFormName,"AskSaveAcctInfo"));
  546.         SetNameValuePair(acctSetupFile,newSectionName,"SavePasswords", getRadio(asFormName,"SavePasswords"));
  547.         SetNameValuePair(acctSetupFile,newSectionName,"AskPersonalInfo", getRadio(asFormName,"AskPersonalInfo"));
  548.         SetNameValuePair(acctSetupFile,newSectionName,"AskBillingInfo", getRadio(asFormName,"AskBillingInfo"));
  549.         SetNameValuePair(acctSetupFile,newSectionName,"RegServer", getText(asFormName, "RegServer"));
  550.  
  551.         SetNameValuePair(acctSetupFile,newSectionName,"CardTypes", getCardTypes(asFormName));
  552.         
  553.         
  554.         SetNameValuePair(acctSetupFile,existingSectionName,"ShowExistingPathInfo", getRadio(asFormName,"ShowExistingPathInfo"));
  555.         SetNameValuePair(acctSetupFile,existingSectionName,"RegPodURL", getText(asFormName, "RegPodURL"));
  556.         SetNameValuePair(acctSetupFile,existingSectionName,"ShowIntro2", getRadio(asFormName,"ShowIntro2"));
  557.         SetNameValuePair(acctSetupFile,existingSectionName,"ShowPhones", getRadio(asFormName,"ShowPhones"));
  558.         SetNameValuePair(acctSetupFile,existingSectionName,"AskName", getRadio(asFormName,"AskName"));
  559.         SetNameValuePair(acctSetupFile,existingSectionName,"AskLogin", getRadio(asFormName,"AskLogin"));
  560.  
  561.         SetNameValuePair(acctSetupFile,existingSectionName,"AskTTY", getRadio(asFormName,"AskTTY"));
  562.         SetNameValuePair(acctSetupFile,existingSectionName,"AskEmail", getRadio(asFormName,"AskEmail"));
  563.         SetNameValuePair(acctSetupFile,existingSectionName,"AskPhone", getRadio(asFormName,"AskPhone"));
  564.  
  565.         SetNameValuePair(acctSetupFile,existingSectionName,"AskDNS", getRadio(asFormName,"AskDNS"));
  566.         SetNameValuePair(acctSetupFile,existingSectionName,"AskHosts", getRadio(asFormName,"AskHosts"));
  567.         SetNameValuePair(acctSetupFile,existingSectionName,"AskPublishing", getRadio(asFormName,"AskPublishing"));
  568.         SetNameValuePair(acctSetupFile,existingSectionName,"AskRegister", getRadio(asFormName,"AskRegister"));
  569.         SetNameValuePair(acctSetupFile,existingSectionName,"AskLDAP", getRadio(asFormName,"AskLDAP"));
  570.  
  571.         SetNameValuePair(acctSetupFile,existingSectionName,"AskIMAP", getRadio(asFormName,"AskIMAP"));
  572.         }
  573. }
  574.  
  575.  
  576.  //    For easy reference, this is the list of flags that ACCTSET.INI currently supports
  577.  //    ForceExisting
  578.  // ExistingSRFile
  579.  //    ForceNew
  580.  //    IntlMode
  581.  //    ShowNewPathInfo
  582.  //    AskSaveAcctInfo
  583.  //    SavePasswords
  584.  //    AskPersonalInfo
  585.  //    //AskSurvey        //defunct
  586.  //    //AskShareInfo    //defunct
  587.  //    AskBillingInfo
  588.  //    RegServer
  589.  //    CardTypes
  590.  //    ShowExistingPathInfo
  591.  //    RegPodURL
  592.  //    ShowIntro2
  593.  // ShowPhones
  594.  //    AskName
  595.  //    AskLogin
  596.  //    AskTTY
  597.  //    AskEmail
  598.  //    AskPhone
  599.  //    AskDNS
  600.  //    AskHosts
  601.  // AskPublishing
  602.  //    AskRegister
  603.  //    AskLDAP
  604.  //    AskIMAP
  605.  
  606.  
  607.  
  608. // end hiding contents from old browsers  -->
  609.