home *** CD-ROM | disk | FTP | other *** search
/ PC User 2004 November / PCU1104CD1.iso / software / security / files / norton.exe / Setup / PControl / APP / pcwiz.dll / HTML / WIZ-SUPERVISOR.JS < prev    next >
Encoding:
JavaScript  |  2003-09-06  |  2.6 KB  |  98 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) 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. function OnLoad()
  22. {
  23.     // Disable NextButton so user cannot constantly click next.
  24.     window.parent.frames("bottom").NextB.disabled = true;
  25.  
  26.     AcctName.value = parent.UserManager.CurrentUser;
  27.     g_OrignalSupervisorName = parent.UserManager.CurrentUser;
  28.     AcctName.focus();
  29.     
  30.     // Enable NextButton
  31.     window.parent.frames("bottom").NextB.disabled = false;
  32. }
  33.  
  34. function Page_GoNext()
  35. {
  36.     
  37.     try
  38.     { 
  39.         // Disable NextButton so user cannot constantly click next.
  40.         window.parent.frames("bottom").NextB.disabled = true;
  41.         
  42.         // If they modified the Supervisor's name, create a new account, log him in, and delete the old account
  43.         if(AcctName.value != g_OrignalSupervisorName)
  44.         {
  45.             var reason = 0;
  46.             if (!parent.UserManager.VerifyUserName(AcctName.value, true, null, reason))
  47.                 return false;
  48.             parent.UserManager.ResetSupervisor(g_OrignalSupervisorName, AcctName.value);
  49.         }
  50.  
  51.         // Make sure password and confirmation match
  52.         if (Pass.value != PassB.value)
  53.         {
  54.             alert(StrID("ParentalProductivity_PasswordError"));
  55.             window.parent.frames("bottom").NextB.disabled = false;
  56.             return false;
  57.         }
  58.  
  59.         // If password is empty, pass in empty string
  60.         if(!Pass.value)
  61.         {
  62.             Pass.value = "";
  63.         }
  64.  
  65.         if (!parent.UserManager.SetAdministratorPassword(AcctName.value, Pass.value))
  66.         {
  67.             // Password change failed, most probably the administrator account was deleted
  68.             // so try creating a new account
  69.             parent.UserManager.CreateAccount(AcctName.value, Pass.value, "3");
  70.         }
  71.  
  72.         window.parent.frames("bottom").NextB.disabled = false;
  73.         return true;
  74.     }
  75.     catch(err)
  76.     {
  77.         window.parent.frames("bottom").NextB.disabled = false;
  78.     }
  79. }
  80.  
  81. function Page_GoBack()
  82. {
  83.     return true;
  84. }
  85.  
  86. function OnKeyDownHandler()
  87. {
  88.     // Last Control Tab over to the <back, next, close> button.
  89.     var VK_ESCAPE = 27;
  90.  
  91.     if (window.event.keyCode == VK_ESCAPE)
  92.     {
  93.         // Escape key.. We want to exit out of the wizard..
  94.         parent.window.navigate("res://closeme.xyz");
  95.  
  96.     }
  97. }
  98.