home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 January / 01_03.iso / software / snpf / NPF / NPF.MSI / IntroWiz.exe / 1033 / HTML / IW-ABOUTPASSWORD.JS < prev    next >
Encoding:
JavaScript  |  2002-09-21  |  2.7 KB  |  118 lines

  1. ////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
  4. //
  5. // NAME:    iw-AboutPassword.js (Javascript file for iw-AboutHomeNet.HTM)
  6. //
  7. // Copyright (c) 2002 by Symantec Corporation. All rights reserved.
  8. //
  9. ////////////////////////////////////////////////////////////////////////////////////////////
  10.  
  11. function RefreshLinkText()
  12. {
  13.     if (ccPassWord.Enabled)
  14.         ToggleSpan.innerText = "off ";
  15.     else
  16.         ToggleSpan.innerText = "on ";
  17. }
  18.  
  19. function OnLoad()
  20. {
  21.     window.NISTitleName1.innerText = WrapNisum.ProductName;
  22.     window.NISTitleName2.innerText = WrapNisum.ProductName;
  23.     
  24.     //    Initialize our ccPassWord object
  25.     ccPassWord.ProductName = WrapNisum.ProductName;
  26.     ccPassWord.ProductID = 2;    // Product ID for NIS is 2
  27.     ccPassWord.FeatureName = "";
  28.     ccPassWord.UserName = WrapNisum.CurrentUser;
  29.     ccPassWord.UseWindowsAccounts = false;
  30.  
  31.     RefreshLinkText();        
  32. }
  33.  
  34. function Is9x()
  35. {
  36.     var agt=navigator.userAgent.toLowerCase();;
  37.     var is_win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
  38.     var is_winme = ((agt.indexOf("win 9x 4.90")!=-1));
  39.       
  40.     if(!is_win98 && !is_winme)
  41.     {
  42.         return false;
  43.     }
  44.     else
  45.     {
  46.         return true;
  47.     }
  48.         
  49.     
  50. }
  51.  
  52. function TogglePasswordProtection()
  53. {
  54.     
  55.     var sProductType = WrapNisum.ProductType;
  56.     var sSetPasswordPrompt = "you must set the password for the current user"
  57.     
  58.     switch (sProductType)
  59.     {
  60.         case "PT_SDF":
  61.         case "PT_NPF":        
  62.         case "PT_PE":
  63.         sSetPasswordPrompt = "you must set a password"
  64.         break
  65.         
  66.         case "PT_NOAD":
  67.         case "PT_FE":
  68.         case "PT_PRO":
  69.         break
  70.     }    
  71.     
  72.     
  73.     if (ccPassWord.Enabled)
  74.         ccPassWord.Enabled = false;
  75.     else
  76.     {
  77.  
  78.         if(PCWizHelper.bWindowsAccount == true && Is9x())
  79.         {
  80.             
  81.             ccWebWindow.MsgBox("This feature cannot be turned on when windows account integration is enabled",
  82.                 WrapNisum.ProductName, 0);
  83.             
  84.             return ;
  85.                             
  86.         }
  87.  
  88.         if (ccPassWord.UserPasswordSet)
  89.         {
  90.             //    User has password; Switch it on
  91.             ccPassWord.Enabled = true;
  92.             ccWebWindow.MsgBox("Password Protection is on.",
  93.                 WrapNisum.ProductName, 0);
  94.         }
  95.         else
  96.         {
  97.             //    User has no password; Set one before switching it on
  98.             ccWebWindow.MsgBox("In order to enable Password Protection, " +
  99.                 sSetPasswordPrompt,
  100.                 WrapNisum.ProductName, 0);
  101.             if (ccPassWord.Set(false))
  102.             {
  103.                 //    Password has been set; Switch it on
  104.                 ccPassWord.Enabled = true;
  105.                 ccWebWindow.MsgBox("Password Protection is on.",
  106.                     WrapNisum.ProductName, 0);
  107.             }
  108.             else
  109.             {
  110.                 ccWebWindow.MsgBox("Password was not set, " +
  111.                     "Password Protection was not enabled",
  112.                     WrapNisum.ProductName, 0);
  113.             }
  114.         }
  115.     }
  116.     RefreshLinkText();        
  117. }
  118.