home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: Adapters-Popup.js (Javascript file for Adapters-popup.HTM)
- //
- // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
- returnValue = null;
- var g_ipList = null;
-
- function Page_OnLoad()
- {
- UIIPLoad(window.dialogArguments[1]);
- IPSetText(window.dialogArguments[0]);
-
- UserManager.WatchForFREIntegStart();
-
- //
- // Register special handlers
- //
- IPAdd.onclick = IPAdd_OnClick;
- IPRemove.onclick = IPRemove_OnClick;
-
- OKB.focus();
- }
-
- function UserManager_OnFREIntegratorStart()
- {
- window.navigate('res://closeme.xyz');
- }
-
- ////////////////////////////////////////////////////////////////////////////////////
- // Local Sites/Zones to Block page
- //
-
- var currentActionState = null;
-
- function IPList_OnClick()
- {
- // Enable the modify/delete buttons
- EnableButton(IPRemove,true);
- }
-
- function IPCtlsEnabled(enable)
- {
-
- EnableButton(IPAdd,enable);
-
- //
- // Only allow this button to be disabled. Be sure to remove
- // selection too.
- //
- if (!enable)
- {
- EnableButton(IPRemove,enable);
- IPList.SetCurSel(-1);
- }
-
- //
- // Enable radio buttons appropriately.
- //
- Addresses[0].checked = !enable;
- Addresses[1].checked = enable;
- }
-
- function UIIPLoad(ipList)
- {
- IPList_OnLoad();
-
- g_ipList = ipList;
-
- refreshIPList();
- }
-
- function refreshIPList()
- {
- //
- // Reset the list control
- //
- IPList.DeleteAllRows();
- IPList.SetColumnCount(2);
-
- var bEnableList = false;
-
- var curIP = g_ipList.GetFirst();
-
- while(null != curIP)
- {
- // If the ip item is a Network...
- if(curIP.Type == 3)
- {
- var text = StrID("IP") + ": " + curIP.NetworkIP + "<BR>" + StrID("Mask") + ": " + curIP.NetworkMask;
-
- pRow = IPList.InsertRow(-1);
- IPList.SetCellTextPtr(pRow, 0, StrID("NetworkAddress"));
- IPList.SetCellTextPtr(pRow, 1, text);
- }
- // If the IP item is a range...
- else if(curIP.Type == 2)
- {
- var text = StrID("From") + ": " + curIP.RangeStart + "<BR>" + StrID("To") + ": " + curIP.RangeEnd;
-
- pRow = IPList.InsertRow(-1);
- IPList.SetCellTextPtr(pRow, 0, StrID("AddressRange"));
- IPList.SetCellTextPtr(pRow, 1, text);
- }
- // If the IP item is a named item...
- else if(curIP.Type == 1)
- {
- var text = StrID("Name") + ": " + curIP.NamedIP;
-
- pRow = IPList.InsertRow(-1);
- IPList.SetCellTextPtr(pRow, 0, StrID("SingleAddress"));
- IPList.SetCellTextPtr(pRow, 1, text);
- }
- // If the IP item is an address...
- else if(curIP.Type == 0)
- {
- var text = StrID("IP") + ": " + curIP.RawIP;
-
- pRow = IPList.InsertRow(-1);
- IPList.SetCellTextPtr(pRow, 0, StrID("SingleAddress"));
- IPList.SetCellTextPtr(pRow, 1, text);
- }
-
- curIP = g_ipList.GetNext();
- }
-
- if(g_ipList.ItemCount > 0)
- bEnableList = true;
-
- IPCtlsEnabled(bEnableList);
- }
-
- function IPAdd_OnClick()
- {
- var Params = new Array;
-
- Params[0] = currentActionState;
- Params[1] = null;
- Params[2] = g_ipList;
-
- webWnd.SetIcon2("res://NisRes.dll/105");
- var newIPList = webWnd.showModalDialog('res://fwui.dll/IP-Popup.htm', 450, 350, Params);
-
- if(null != newIPList)
- {
- var curIP = newIPList.GetFirst();
-
- while(null != curIP)
- {
- g_ipList.LastError = 0;
- g_ipList.AppendItem(curIP);
- if(HandleListError(g_ipList.LastError, 1008, 102))
- break;
-
- curIP = newIPList.GetNext();
- }
- }
-
- refreshIPList();
- IPRemove.disabled = true;
- }
-
- function IPRemove_OnClick()
- {
- var nSel = IPList.GetCurSel();
- var rule = g_ipList.GetItem(nSel);
-
- if(null != rule)
- g_ipList.DeleteItem(rule);
-
- refreshIPList();
-
- if(IPList.GetRowCount() <= nSel)
- nSel = IPList.GetRowCount()-1;
- IPList.SetCurSel(nSel);
- }
-
- function IPList_OnLoad()
- {
- IPList.SetTableClass("ListBoxClass");
- IPList.OnClick = IPList_OnClick;
- }
-
- function IPSetText(action)
- {
- currentActionState = action;
- switch (action)
- {
- case "permit":
- IPPermitRule.style.display = "";
- IPBlockRule.style.display = "none";
- IPMonitorRule.style.display = "none";
- break;
- case "block":
- IPPermitRule.style.display = "none";
- IPBlockRule.style.display = "";
- IPMonitorRule.style.display = "none";
- break;
- case "monitor":
- IPPermitRule.style.display = "none";
- IPBlockRule.style.display = "none";
- IPMonitorRule.style.display = "";
- break;
- }
- }
-
- function OKB_OnClick()
- {
- if (Addresses[1].checked && g_ipList.ItemCount == 0)
- {
- webWnd.MsgBox(StrID("AdapterListError"), UserManager.AppTitle, MB_OK | MB_ICONEXCLAMATION);
- }
- else
- {
- if(Addresses[0].checked)
- {
- var ipList = new ActiveXObject("ccFWSettg.IPList");
-
- returnValue = ipList;
- }
- else
- returnValue = g_ipList;
-
- window.navigate("res://closeme.xyz");
- }
- }
-
- function CancelB_OnClick()
- {
- returnValue = null;
- window.navigate("res://closeme.xyz");
- }