home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: wiz-CreateAccounts (Javascript file for wiz-CreateAccounts.HTM)
- //
- // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
-
-
- function OnLoad()
- {
- AccountName1.focus();
- }
-
- function Page_GoNext()
- {
- var iAccountIndex = 0;
- // Verify Names
-
- if (AccountName1.value.length > 0)
- {
- // Fix Defect#361885, make sure account names entered are unique and not duplicated
- if ((stricmp(AccountName1.value, AccountName2.value) == 0) ||
- (stricmp(AccountName1.value, AccountName3.value) == 0) ||
- (stricmp(AccountName1.value, AccountName4.value) == 0) ||
- (stricmp(AccountName1.value, AccountName5.value) == 0))
- {
- alert("You have entered an account name more then once. Please make sure that the account names are unique.");
- return false;
- }
-
- // Fix Defect#362860. Making sure that account name is valid, i.e. not already used and valid account name
- var reason = 0;
- var validName = parent.UserManager.VerifyUserName(AccountName1.value, true, null, reason);
-
- if(!validName)
- return false;
-
- parent.window.SetAccountInfo(iAccountIndex, AccountName1.value, null, select1.value);
- iAccountIndex++;
- }
-
- if (AccountName2.value.length > 0)
- {
-
- if( (stricmp(AccountName2.value, AccountName1.value)==0) ||
- (stricmp(AccountName2.value, AccountName3.value)==0) ||
- (stricmp(AccountName2.value, AccountName4.value)==0) ||
- (stricmp(AccountName2.value, AccountName5.value)==0))
- {
- alert("You have entered an account name more then once. Please make sure that the account names are unique.");
- return false;
-
- }
-
- var reason = 0;
- var validName = parent.UserManager.VerifyUserName(AccountName2.value, true, null, reason);
-
- if(!validName)
- return false;
-
-
- parent.window.SetAccountInfo(iAccountIndex, AccountName2.value, null, select2.value);
- iAccountIndex++;
- }
-
- if (AccountName3.value.length > 0)
- {
- if( (stricmp(AccountName3.value, AccountName1.value)==0) ||
- (stricmp(AccountName3.value, AccountName2.value)==0) ||
- (stricmp(AccountName3.value, AccountName4.value)==0) ||
- (stricmp(AccountName3.value, AccountName5.value)==0))
- {
- alert("You have entered an account name more then once. Please make sure that the account names are unique.");
- return false;
-
- }
-
- var reason = 0;
- var validName = parent.UserManager.VerifyUserName(AccountName3.value, true, null, reason);
-
- if(!validName)
- return false;
-
- parent.window.SetAccountInfo(iAccountIndex, AccountName3.value, null, select3.value);
- iAccountIndex++;
- }
-
- if (AccountName4.value.length > 0)
- {
- if( (stricmp(AccountName4.value, AccountName1.value)==0) ||
- (stricmp(AccountName4.value, AccountName2.value)==0) ||
- (stricmp(AccountName4.value, AccountName3.value)==0) ||
- (stricmp(AccountName4.value, AccountName5.value)==0))
- {
- alert("You have entered an account name more then once. Please make sure that the account names are unique.");
- return false;
-
- }
-
- var reason = 0;
- var validName = parent.UserManager.VerifyUserName(AccountName4.value, true, null, reason);
-
- if(!validName)
- return false;
-
- parent.window.SetAccountInfo(iAccountIndex, AccountName4.value, null, select4.value);
- iAccountIndex++;
- }
-
- if (AccountName5.value.length > 0)
- {
- if( (stricmp(AccountName5.value, AccountName1.value)==0) ||
- (stricmp(AccountName5.value, AccountName2.value)==0) ||
- (stricmp(AccountName5.value, AccountName3.value)==0) ||
- (stricmp(AccountName5.value, AccountName4.value)==0))
- {
- alert("You have entered an account name more then once. Please make sure that the account names are unique.");
- return false;
-
- }
-
- var reason = 0;
- var validName = parent.UserManager.VerifyUserName(AccountName5.value, true, null, reason);
-
- if(!validName)
- return false;
-
- parent.window.SetAccountInfo(iAccountIndex, AccountName5.value, null, select5.value);
- iAccountIndex++;
- }
-
-
- // Tell parent window, how many accounts to set
- parent.window.SetAccountNum(iAccountIndex);
- 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");
-
- }
-
- }
-
- function stricmp(szA, szB)
- {
- if(szA.toUpperCase() < szB.toUpperCase())
- return -1;
- else if(szA.toUpperCase() > szB.toUpperCase())
- return 1;
-
- return 0;
- }
-