home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 May / 05_02.iso / software / nis / files / NIS / NIS.MSI / pcwiz.dll / HTML / WIZ-SUPERVISOR.JS < prev    next >
Encoding:
JavaScript  |  2001-12-01  |  2.2 KB  |  85 lines

  1. ////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
  4. //
  5. // NAME:    wiz-Supervisor.js (Javascript file for wiz-Supervisor.HTM)
  6. //
  7. // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
  8. //
  9. ////////////////////////////////////////////////////////////////////////////////////////////
  10.  
  11. var g_OrignalSupervisorName;
  12.  
  13. function OnTabOver()
  14. {
  15.     // Last Control Tab over to the <back, next, close> button.
  16.     var VK_TAB = 9;
  17.     if (window.event.keyCode == VK_TAB)
  18.         window.parent.frames("bottom",0).focus();
  19.  
  20. }
  21.  
  22. function OnLoad()
  23. {
  24.     AcctName.value = parent.UserManager.CurrentUser;
  25.     g_OrignalSupervisorName = parent.UserManager.CurrentUser;
  26.     AcctName.focus();
  27. }
  28.  
  29. function Page_GoNext()
  30. {
  31.     
  32.     // If they modified the Supervisor's name, create a new account, log him in, and delete the old account
  33.     if(AcctName.value != g_OrignalSupervisorName)
  34.     {
  35.         parent.UserManager.ResetSupervisor(g_OrignalSupervisorName, AcctName.value);
  36.         
  37.     }
  38.  
  39.     // Make sure password and confirmation match
  40.     if (Pass.value != PassB.value)
  41.     {
  42.         // See if the user did NOT want to change password
  43.         // i.e. just clicked next in the administrator pane
  44.         // (the fields are initialized in html to the values below)
  45.         if (Pass.value == "LaKeRs" && PassB.value == "*RuLe*")
  46.             return true;
  47.  
  48.         alert("Password does not match confirmation");
  49.         return false;                
  50.     }
  51.  
  52.     // If password is empty, pass in empty string
  53.     if(!Pass.value)
  54.     {
  55.         Pass.value = "";
  56.     }
  57.  
  58.     if (!parent.UserManager.SetAdministratorPassword(AcctName.value, Pass.value))
  59.     {
  60.         // Password change failed, most probably the administrator account was deleted
  61.         // so try creating a new account        
  62.         parent.UserManager.CreateAccount(AcctName.value, Pass.value, "3"); 
  63.     }
  64.  
  65.     return true;
  66. }
  67.  
  68. function Page_GoBack()
  69. {
  70.     return true;
  71. }
  72.  
  73. function OnKeyDownHandler()
  74. {
  75.     // Last Control Tab over to the <back, next, close> button.
  76.     var VK_ESCAPE = 27;
  77.  
  78.     if (window.event.keyCode == VK_ESCAPE)
  79.     {
  80.         // Escape key.. We want to exit out of the wizard..
  81.         parent.window.navigate("res://closeme.xyz");
  82.  
  83.     }
  84.     
  85. }