home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2004 July / APC0407D1.iso / powerkit / firewall / files / NPF2004.exe / Setup / ISCommon / APP / fwUI.dll / HTML / ADDRULEWIZ.JS < prev    next >
Encoding:
JavaScript  |  2003-09-06  |  3.7 KB  |  171 lines

  1. ////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
  4. //
  5. // NAME:    AddRuleWiz.js (Javascript file for AddRuleWiz.HTM)
  6. //
  7. // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
  8. //
  9. ////////////////////////////////////////////////////////////////////////////////////////////
  10.  
  11. var CCFW_ACTION_BLOCK = 1;
  12.  
  13. window.returnValue = null;
  14.  
  15. function init()
  16. {
  17.     NextB.disabled = "";
  18.     NextB.focus();
  19.  
  20.     var rule = window.dialogArguments;
  21.  
  22.     UserManager.WatchForFREIntegStart();
  23.  
  24.     rule.Priority = 1;
  25.     // Re-Position the background bitmap.
  26.  
  27.     ruleDoc.document.body.style.backgroundPositionX = "121%";
  28.     ruleDoc.document.body.style.backgroundPositionY = "49%";
  29.  
  30.     if("" != rule.ApplicationDescription)
  31.     {                
  32.         ruleDoc.init(rule, "Application", rule.ApplicationDescription);
  33.         return;
  34.     }
  35.     else
  36.     {
  37.         if(rule.Type == 0)
  38.         {
  39.             ruleDoc.init(rule, "System", StrID("your_computer"));        
  40.             return;
  41.         }
  42.  
  43.         if(rule.Type == 1)
  44.         {
  45.             rule.Action = CCFW_ACTION_BLOCK;
  46.             ruleDoc.init(rule, "Trojan", StrID("Trojan"));
  47.             return;
  48.         }
  49.     }
  50. }
  51.  
  52. function UserManager_OnFREIntegratorStart()
  53. {
  54.     window.navigate('res://closeme.xyz');
  55. }
  56.  
  57. function BackB_OnClick()
  58. {
  59.     tellMe.style.visibility = "";
  60.  
  61.     switch(ruleDoc.CurrPage)
  62.     {
  63.         // case "Action": // Do nothing
  64.         case "Direction":
  65.             ruleDoc.SetPage("Action");
  66.             BackB.disabled = "disabled";
  67.             break;
  68.         case "IP":
  69.             ruleDoc.SetPage("Direction");
  70.             break;
  71.         case "Ports":
  72.             ruleDoc.SetPage("IP");
  73.             break;
  74.         case "Logging":
  75.             ruleDoc.SetPage("Ports");
  76.             break;
  77.         case "Type":
  78.             ruleDoc.SetPage("Logging");
  79.             break;
  80.         case "Title":
  81.             if(usingClientRules() && (UserManager.CurrentUserType == "UT_SUPERVISOR"))
  82.                 ruleDoc.SetPage("Type");
  83.             else
  84.                 ruleDoc.SetPage("Logging");
  85.             break;
  86.         case "Locations":
  87.             ruleDoc.SetPage("Title");
  88.             break;        
  89.         case "Finished":            
  90.             ruleDoc.SetPage("Locations");
  91.             NextB.value = StrID("NextB");
  92.             NextB.accessKey = "N";
  93.     }
  94.     
  95.     NextB.disabled = false;
  96.     window.focus();
  97. }
  98.  
  99. function NextB_OnClick()
  100. {
  101.     tellMe.style.visibility = "";
  102.     
  103.     switch(ruleDoc.CurrPage)
  104.     {
  105.         case "Action":
  106.             if (ruleDoc.ActionValidate())
  107.             {
  108.                 ruleDoc.SetPage("Direction");
  109.                 BackB.disabled = "";
  110.             }
  111.             break;
  112.         case "Direction":
  113.             if (ruleDoc.DirectionValidate())
  114.             {
  115.                 ruleDoc.SetPage("IP");
  116.             }
  117.             break;
  118.         case "IP":
  119.                if (ruleDoc.IPValidate())
  120.             {
  121.                 ruleDoc.SetPage("Ports");
  122.             }
  123.             break;
  124.         case "Ports":
  125.             if (ruleDoc.ProtocolAndPortValidate())
  126.             {
  127.                 ruleDoc.SetPage("Logging");
  128.             }
  129.             break;
  130.         case "Logging":
  131.             if(usingClientRules() && (UserManager.CurrentUserType == "UT_SUPERVISOR"))
  132.             {
  133.                 ruleDoc.SetPage("Type");
  134.             }
  135.             else
  136.             {
  137.                 ruleDoc.SetPage("Title");
  138.             }            
  139.             break;
  140.         case "Type":
  141.             ruleDoc.SetPage("Title");
  142.             ruleDoc.displayRuleData();
  143.             break;
  144.         case "Title":    
  145.             if (ruleDoc.TitleValidate()) {
  146.                 ruleDoc.SetPage("Locations");
  147.                 ruleDoc.displayRuleData();
  148.             }
  149.             break;
  150.         case "Locations":
  151.             ruleDoc.SetPage("Finished");
  152.             NextB.value = StrID("FinishB");
  153.             NextB.accessKey = "F";
  154.             ruleDoc.displayRuleData();
  155.             tellMe.style.visibility = "hidden";
  156.             break;        
  157.         case "Finished":
  158.         {
  159.             window.returnValue = ruleDoc.saveRule();
  160.             window.navigate("res://closeme.xyz");
  161.             break;
  162.         }
  163.     }
  164.     window.focus();
  165. }
  166.  
  167. function CancelB_OnClick()
  168. {
  169.     window.navigate("res://closeme.xyz");
  170. }
  171.