summaryrefslogtreecommitdiffstats
path: root/usr/local/www/javascript/firewall_nat_edit/firewall_nat_edit.js
blob: c215dd64c2a4ab798fb07755875ae3e3eef04586 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!--
function ext_change() {
	if (document.iform.beginport.selectedIndex == 0) {
		document.iform.beginport_cust.disabled = 0;
	} else {
		document.iform.beginport_cust.value = "";
		document.iform.beginport_cust.disabled = 1;
	}
	if (document.iform.endport.selectedIndex == 0) {
		document.iform.endport_cust.disabled = 0;
	} else {
		document.iform.endport_cust.value = "";
		document.iform.endport_cust.disabled = 1;
	}
	if (document.iform.localbeginport.selectedIndex == 0) {
		document.iform.localbeginport_cust.disabled = 0;
	} else {
		document.iform.localbeginport_cust.value = "";
		document.iform.localbeginport_cust.disabled = 1;
	}
}

function ext_rep_change() {
	document.iform.endport.selectedIndex = document.iform.beginport.selectedIndex;
	document.iform.localbeginport.selectedIndex = document.iform.beginport.selectedIndex;
}

function check_for_aliases() {
	/*  if External port range is an alias, then disallow
	 *  entry of Local port
	 */
	document.iform.endport_cust.disabled = 0;
	document.iform.localbeginport.disabled = 0;
	document.iform.localbeginport_cust.disabled = 0;
	for(i=0; i<customarray.length; i++) {
		if(document.iform.beginport_cust.value == customarray[i]) {
			document.iform.endport_cust.value = "";
			document.iform.localbeginport_cust.value = "";
			document.iform.endport_cust.disabled = 1;
			document.iform.localbeginport.disabled = 1;
			document.iform.localbeginport_cust.disabled = 1;
		}
		if(document.iform.beginport.value == customarray[i]) {
			document.iform.endport_cust.value = "";
			document.iform.localbeginport_cust.value = "";
			document.iform.endport_cust.disabled = 1;
			document.iform.localbeginport.disabled = 1;
			document.iform.localbeginport_cust.disabled = 1;
		}
		if(document.iform.endport_cust.value == customarray[i]) {
			document.iform.endport_cust.value = "";
			document.iform.localbeginport_cust.value = "";
			document.iform.endport_cust.disabled = 1;
			document.iform.localbeginport.disabled = 1;
			document.iform.localbeginport_cust.disabled = 1;
		}
		if(document.iform.endport.value == customarray[i]) {
			document.iform.endport_cust.value = "";
			document.iform.localbeginport_cust.value = "";
			document.iform.endport_cust.disabled = 1;
			document.iform.localbeginport.disabled = 1;
			document.iform.localbeginport_cust.disabled = 1;
		}
	}
}

function proto_change() {
	if(document.iform.proto.selectedIndex > 2) {
		document.iform.beginport_cust.disabled = 1;
		document.iform.endport_cust.disabled = 1;
		document.iform.beginport.disabled = 1;
		document.iform.endport.disabled = 1;
		document.iform.localbeginport_cust.disabled = 1;
		document.iform.localbeginport.disabled = 1;
	} else {
		document.iform.beginport_cust.disabled = 0;
		document.iform.endport_cust.disabled = 0;
		document.iform.beginport.disabled = 0;
		document.iform.endport.disabled = 0;
		document.iform.localbeginport_cust.disabled = 0;
		document.iform.localbeginport.disabled = 0;
	}
}

window.onload = function () {
	var oTextbox1 = new AutoSuggestControl(document.getElementById("localip"), new StateSuggestions(addressarray));
	var oTextbox2 = new AutoSuggestControl(document.getElementById("beginport_cust"), new StateSuggestions(customarray));
	var oTextbox3 = new AutoSuggestControl(document.getElementById("endport_cust"), new StateSuggestions(customarray));
	var oTextbox4 = new AutoSuggestControl(document.getElementById("localbeginport_cust"), new StateSuggestions(customarray));
}

//-->
OpenPOWER on IntegriCloud