diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-10-31 18:28:13 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-10-31 18:28:54 -0400 |
commit | acbd265ed090c4c8c575b288cf001c97f51cc7da (patch) | |
tree | 6fc0ef6a62551d5a6dbf81ce884c4f29042d2502 /src | |
parent | 86b2861ce6aa2f086b45978d54dcc7913e74283a (diff) | |
download | pfsense-acbd265ed090c4c8c575b288cf001c97f51cc7da.zip pfsense-acbd265ed090c4c8c575b288cf001c97f51cc7da.tar.gz |
Fixed #5362
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/widgets/widgets/ipsec.widget.php | 69 |
1 files changed, 63 insertions, 6 deletions
diff --git a/src/usr/local/www/widgets/widgets/ipsec.widget.php b/src/usr/local/www/widgets/widgets/ipsec.widget.php index 791b39b..1a94e64 100644 --- a/src/usr/local/www/widgets/widgets/ipsec.widget.php +++ b/src/usr/local/www/widgets/widgets/ipsec.widget.php @@ -61,9 +61,9 @@ require_once("ipsec.inc"); if (isset($config['ipsec']['phase1'])) { $tab_array = array(); - $tab_array[0] = array("Overview", true, "ipsec-Overview"); - $tab_array[1] = array("Tunnels", false, "ipsec-tunnel"); - $tab_array[2] = array("Mobile", false, "ipsec-mobile"); + $tab_array[] = array("Overview", true, "ipsec-Overview"); + $tab_array[] = array("Tunnels", false, "ipsec-tunnel"); + $tab_array[] = array("Mobile", false, "ipsec-mobile"); display_widget_tabs($tab_array); @@ -86,6 +86,7 @@ if (isset($config['ipsec']['phase1'])) { if ($ph2ent['remoteid']['type'] == "mobile" || isset($ph1ent['mobile'])) { continue; } + if (isset($ph1ent['disabled']) || isset($ph2ent['disabled'])) { continue; } @@ -96,11 +97,13 @@ if (isset($config['ipsec']['phase1'])) { } else { $ikenum[$ph1ent['ikeid']]++; } + $ikeid = "con{$ph1ent['ikeid']}00" . $ikenum[$ph1ent['ikeid']]; } else { if (isset($ikenum[$ph1ent['ikeid']])) { continue; } + $ikeid = "con{$ph1ent['ikeid']}"; $ikenum[$ph1ent['ikeid']] = true; } @@ -149,7 +152,8 @@ if (isset($config['ipsec']['phase1'])) { } if (isset($config['ipsec']['phase2'])): ?> - <table class="table"> +<div id="ipsec-Overview" style="display:block;background-color:#EEEEEE;" class="table-responsive"> + <table class="table table-striped table-hover"> <thead> <tr> <th>Active Tunnels</td> @@ -165,7 +169,8 @@ if (isset($config['ipsec']['phase2'])): ?> </tr> </tbody> </table> - +</div> +<div class="table-responsive" id="ipsec-tunnel" style="display:none;background-color:#EEEEEE;"> <table class="table table-striped table-hover"> <thead> <th>Source</th> @@ -190,8 +195,10 @@ if (isset($config['ipsec']['phase2'])): ?> <?php endforeach; ?> </tbody> </table> +</div> <?php if (is_array($mobile['pool'])): ?> +<div id="ipsec-mobile" style="display:none;background-color:#EEEEEE;" class="table-responsive"> <table class="table table-striped table-hover"> <thead> <th>User</th> @@ -215,10 +222,60 @@ if (isset($config['ipsec']['phase2'])): ?> endforeach; ?> </tbody> </table> + </div> <?php endif;?> <?php else: ?> <div> <h5 style="padding-left:10px;">There are no configured IPsec Tunnels</h5> <p style="padding-left:10px;">You can configure your IPsec <a href="vpn_ipsec.php">here</a>.</p> </div> -<?php endif; ?> +<?php endif; + +// This function was in index.php It seems that the ipsec widget is the only place it is used +// so now it lives here. It wouldn't hurt to update this functions and the tab display, but it +// looks OK for now. The display_widget_tabs() function in guiconfig.inc would need to be updated to match +?> +<script> +//<![CDATA[ +function changeTabDIV(selectedDiv) { + var dashpos = selectedDiv.indexOf("-"); + var tabclass = selectedDiv.substring(0, dashpos); + d = document; + + //get deactive tabs first + tabclass = tabclass + "-class-tabdeactive"; + var tabs = document.getElementsByClassName(tabclass); + var incTabSelected = selectedDiv + "-deactive"; + + for (i = 0; i < tabs.length; i++) { + var tab = tabs[i].id; + dashpos = tab.lastIndexOf("-"); + var tab2 = tab.substring(0, dashpos) + "-deactive"; + + if (tab2 == incTabSelected) { + tablink = d.getElementById(tab2); + tablink.style.display = "none"; + tab2 = tab.substring(0, dashpos) + "-active"; + tablink = d.getElementById(tab2); + tablink.style.display = "table-cell"; + + //now show main div associated with link clicked + tabmain = d.getElementById(selectedDiv); + tabmain.style.display = "block"; + } else { + tab2 = tab.substring(0, dashpos) + "-deactive"; + tablink = d.getElementById(tab2); + tablink.style.display = "table-cell"; + tab2 = tab.substring(0, dashpos) + "-active"; + tablink = d.getElementById(tab2); + tablink.style.display = "none"; + + //hide sections we don't want to see + tab2 = tab.substring(0, dashpos); + tabmain = d.getElementById(tab2); + tabmain.style.display = "none"; + } + } +} +//]]> +</script>
\ No newline at end of file |