home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: wiz-SetPasswords (Javascript file for wiz-SetPasswords.HTM)
- //
- // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
- var m_iCurrentPage = 1;
-
-
- function GetCurrentUser()
- {
-
- UserName.innerText = window.parent.aAccounts[m_iCurrentPage - 1].m_sAccountName;
-
- // Set the user type
- switch(window.parent.aAccounts[m_iCurrentPage - 1].m_iAccountType)
- {
-
- case "0":
- UserType.innerText = "Child";
- break;
-
- case "1":
- UserType.innerText = "Teenager";
- break;
-
- case "2":
- UserType.innerText = "Adult";
- break;
-
- case "3":
- UserType.innerText = "Supervisor";
- break;
-
- default:
- UserType.innerText = "Error";
- }
-
- }
-
- function SavePassword()
- {
- window.parent.SetAccountInfo(m_iCurrentPage - 1, null, Pass.value, null);
-
- }
-
- function OnLoad()
- {
- // If no accounts were created we can skip the "Set Password" page by simulating "Next Click"
- if (window.parent.m_iAccounts < 1)
- {
- window.parent.frames("bottom",0).GoNext("Set Password");
-
- }
- else
- {
- GetCurrentUser(); // Get First User
- CurrentNum.innerText = m_iCurrentPage;
- TotalNum.innerText = window.parent.m_iAccounts;
- }
- }
-
-
- function Page_GoNext()
- {
-
- if (m_iCurrentPage < window.parent.m_iAccounts)
- {
-
- // Check Password if it is valid
- if(Pass.value != PassConfirm.value)
- {
- alert("Password does not match confirmation");
- return false;
- }
-
- // If password in empty pass in empty string
- if(!Pass.value)
- {
- Pass.value = "";
- }
-
- SavePassword(); // Save Password off
-
- // Now update the page for next user
- m_iCurrentPage++; // Increment "user" count
- CurrentNum.innerText = m_iCurrentPage; // Update text that refers to user count
- Pass.value = ""; // Clear password fields
- PassConfirm.value = "";
- GetCurrentUser(); // Get Next user info
-
- return false; // Return False because we do not want to go "next" just yet
- }
- else
- {
-
- // Check Last Password if it is valid
- if(Pass.value != PassConfirm.value)
- {
- alert("Password does not match confirmation");
- return false;
- }
-
- // If password in empty pass in empty string
- if(!Pass.value)
- {
- Pass.value = "";
- }
-
- SavePassword(); // Save off last password
-
- // Now save off each account
- for (i = 0; i < window.parent.m_iAccounts; i++)
- {
- // Now go ahead and create each account;
- var name = window.parent.aAccounts[i].m_sAccountName;
-
- if(!name || name == "")
- name = " ";
-
- // call WrapUM to create this account
- UserManager.CreateAccount(window.parent.aAccounts[i].m_sAccountName,
- window.parent.aAccounts[i].m_sAccountPassword,
- window.parent.aAccounts[i].m_iAccountType);
- }
-
-
- return true;
- }
-
-
- }
-
-
- function Page_GoBack()
- {
- return true;
- }
-
- function OnKeyDownHandler()
- {
- // Last Control Tab over to the <back, next, close> button.
- var VK_ESCAPE = 27;
-
- if (window.event.keyCode == VK_ESCAPE)
- {
- // Escape key.. We want to exit out of the wizard..
- parent.window.navigate("res://closeme.xyz");
-
- }
-
- }