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

  1. <!--  to hide script contents from old browsers
  2.  
  3. //the file that includes this must also include settings.js and iasglob.js
  4. var loaded = false;
  5. function loadData()
  6. {
  7.     if (parent.parent.iasglobals && parent.parent.iasglobals.getText)
  8.     {
  9.         var FormName = "IASACCOUNTACCESS";
  10.         
  11.         
  12.         parent.parent.iasglobals.setText(FormName, "IASPHONE", parent.parent.iasglobals.getGlobal("Phone"));            
  13.         
  14.         parent.parent.iasglobals.setText(FormName, "IASLOGIN", parent.parent.iasglobals.getGlobal("Name"));            
  15.         parent.parent.iasglobals.setText(FormName, "IASPASSWORD", parent.parent.iasglobals.getGlobal("Password"));
  16.         parent.parent.iasglobals.setText(FormName, "REGCGI", parent.parent.iasglobals.getGlobal("RegCGI"));
  17.         this.focus();
  18.         document.forms[0]["IASPHONE"].focus();
  19.         loaded = true;    
  20.     }
  21.     else
  22.         setTimeout("loadData()",500);
  23.     
  24. }//function loadData()
  25.  
  26.  
  27. function checkData()
  28. {
  29.     if (loaded && loaded == true)
  30.     {
  31.  
  32.         if (parent.parent.iasglobals.iasDirty(null))
  33.         {
  34.             var FormName    = "IASACCOUNTACCESS";
  35.             var valid         = true;
  36.             var tempData     = "";
  37.             var override    = false;
  38.         
  39.             tempData = parent.parent.iasglobals.getText(FormName, "IASPHONE");
  40.             if (tempData == null || tempData == "" || tempData == "null")
  41.             {
  42.                 override = !confirm("Please enter the phone number for the Internet Account Server, or choose cancel to ignore changes.");
  43.                 document.forms[FormName]["IASPHONE"].focus();
  44.                 document.forms[FormName]["IASPHONE"].select();
  45.                 valid = override;
  46.             }
  47.             
  48.             if (valid == true && override == false)
  49.             {
  50.                 tempData = parent.parent.iasglobals.getText(FormName, "REGCGI");
  51.                 if (tempData == null || tempData == "" || tempData == "null")
  52.                 {
  53.                     override = !confirm("Please enter the URL for the Internet Account Server's CGI, or choose cancel to ignore changes.");
  54.                     document.forms[FormName]["REGCGI"].focus();
  55.                     document.forms[FormName]["REGCGI"].select();
  56.                     valid = override;
  57.                 }
  58.             }
  59.         
  60.             if (valid == true && override == false)
  61.             {
  62.                 tempData = parent.parent.iasglobals.getText(FormName, "IASLOGIN");
  63.                 if (tempData == null || tempData == "" || tempData == "null")
  64.                 {
  65.                     //valid = confirm("You have not entered a login name for dialing into the Internet Account Server.  Are you sure you don't need one? (If no login name is necessary, choose \"OK\")");
  66.                     //if (valid == false)
  67.     
  68.                     override = !confirm("Please enter the login name required to dial into the Internet Account Server, or choose cancel to ignore changes.");
  69.                     valid = override;
  70.                     {
  71.                         document.forms[FormName]["IASLOGIN"].focus();
  72.                         document.forms[FormName]["IASLOGIN"].select();
  73.                     }
  74.                 }
  75.             }
  76.             
  77.             
  78.             if (valid == true && override == false)
  79.             {
  80.                 tempData = parent.parent.iasglobals.getText(FormName, "IASPASSWORD");
  81.                 if (tempData == null || tempData == "" || tempData == "null")
  82.                 {
  83.                     //valid = confirm("You have not entered a password for dialing into the Internet Account Server.  Are you sure you don't need one? (If no password is necessary, choose \"OK\")");
  84.         
  85.                     //if (valid == false)
  86.                     override = !confirm("Please enter the password required to dial into the Internet Account Server, or choose cancel to ignore changes.");
  87.                     valid = false;
  88.                     {
  89.                         document.forms[FormName]["IASPASSWORD"].focus();
  90.                         document.forms[FormName]["IASPASSWORD"].select();
  91.                     }
  92.                 }
  93.             }
  94.             
  95.             if (override == true)
  96.                 parent.parent.iasglobals.iasDirty(false);
  97.         
  98.             return valid;
  99.         }
  100.         else
  101.             return true;
  102.     }
  103.     else
  104.         return true;
  105. }
  106.  
  107.  
  108. function saveData()
  109. {
  110.     if (loaded && loaded == true)
  111.     {
  112.         var FormName = "IASACCOUNTACCESS";
  113.         
  114.         parent.parent.iasglobals.setGlobal("Phone", parent.parent.iasglobals.getText(FormName, "IASPHONE"));
  115.         parent.parent.iasglobals.setGlobal("Name", parent.parent.iasglobals.getText(FormName, "IASLOGIN"));
  116.         parent.parent.iasglobals.setGlobal("Password", parent.parent.iasglobals.getText(FormName, "IASPASSWORD"));
  117.         parent.parent.iasglobals.setGlobal("RegCGI", parent.parent.iasglobals.getText(FormName, "REGCGI"));
  118.     
  119.     }
  120. }
  121.  
  122. function encryptPassword()
  123. {
  124.  
  125.  
  126.     var FormName = "IASACCOUNTACCESS";
  127.     var passwd = parent.parent.iasglobals.getText(FormName, "IASPASSWORD");
  128.  
  129.     if (passwd && passwd != null && passwd.length > 0)
  130.     {
  131.         if (passwd.length < 20)
  132.         {
  133.             netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  134.             var encPass = top.globals.document.setupPlugin.EncryptPassword(passwd);
  135.             parent.parent.iasglobals.setText(FormName, "IASPASSWORD", encPass);
  136.         }        
  137.     } 
  138. }
  139.  
  140. // end hiding contents from old browsers  -->
  141.