summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-07-03 23:21:25 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-07-03 23:21:25 +0000
commitc98e7fb75aaff33dbb1ef20eb1556ac605e28828 (patch)
treeb5d4f976e6826561e205032ce0a2d9c7d9cb6f4b
parenta812c95a3696847ff8f2ea075e7c676e4bb27baf (diff)
downloadpfsense-c98e7fb75aaff33dbb1ef20eb1556ac605e28828.zip
pfsense-c98e7fb75aaff33dbb1ef20eb1556ac605e28828.tar.gz
Allow filtering of interfaces_selection box
-rw-r--r--usr/local/pkg/sasyncd.xml50
-rwxr-xr-xusr/local/www/pkg_edit.php18
2 files changed, 64 insertions, 4 deletions
diff --git a/usr/local/pkg/sasyncd.xml b/usr/local/pkg/sasyncd.xml
new file mode 100644
index 0000000..65e0a7b
--- /dev/null
+++ b/usr/local/pkg/sasyncd.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<packagegui>
+ <name>sasyncd</name>
+ <version>0.1.0</version>
+ <title>Services: SASYNCD (VPN failover)</title>
+ <!-- configpath gets expanded out automatically and config items will be
+ stored in that location -->
+ <configpath>['installedpackages']['sasyncd']['config']</configpath>
+ <aftersaveredirect>pkg_edit.php?xml=sassyncd.xml&amp;id=0</aftersaveredirect>
+ <!-- Menu is where this packages menu will appear -->
+ <menu>
+ <name>SASYNCD (VPN failover)</name>
+ <tooltiptext>The sasyncd daemon synchronizes IPSec SA and SPD information between a number of failover IPsec gateways. The most typical scenario is to run sasyncd on hosts also running isakmpd and sharing a common IP-address using carp.</tooltiptext>
+ <section>Services</section>
+ <configfile>sasyncd.xml</configfile>
+ </menu>
+ <adddeleteeditpagefields>
+ <columnitem>
+ <fielddescr>Interface</fielddescr>
+ <fieldname>interface</fieldname>
+ </columnitem>
+ <columnitem>
+ <fielddescr>Peer IP</fielddescr>
+ <fieldname>peerip</fieldname>
+ </columnitem>
+ </adddeleteeditpagefields>
+ <!-- fields gets invoked when the user adds or edits a item. the following items
+ will be parsed and rendered for the user as a gui with input, and selectboxes. -->
+ <fields>
+ <field>
+ <fielddescr>Interface</fielddescr>
+ <fieldname>interface</fieldname>
+ <description>Select the carp interface to use</description>
+ <interface_filter>carp</interface_filter>
+ <type>interfaces_selection</type>
+ </field>
+ <field>
+ <fielddescr>Peer IP</fielddescr>
+ <fieldname>peerip</fieldname>
+ <description>Enter the peers ip address</description>
+ <type>input</type>
+ </field>
+ <field>
+ <fielddescr>Shared Key</fielddescr>
+ <fieldname>sharedkey</fieldname>
+ <description>The shared AES key used to encrypt messages between sasyncd(8) hosts. This configuration setting is required and must be either 16, 24 or 32 bytes long (corresponding to AES using a 128, 192 or 256 bit key).</description>
+ <type>input</type>
+ </field>
+ </fields>
+</packagegui>
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php
index a61c506..5529dd2 100755
--- a/usr/local/www/pkg_edit.php
+++ b/usr/local/www/pkg_edit.php
@@ -396,11 +396,21 @@ if ($pkg['tabs'] <> "") {
$ifname = $iface['descr'];
$SELECTED = "";
if($value == $ifdescr) $SELECTED = " SELECTED";
- echo "<option value='" . $ifdescr . "'" . $SELECTED . ">" . $ifdescr . "</option>\n";
- echo "<!-- {$value} -->";
+ $to_echo = "<option value='" . $ifdescr . "'" . $SELECTED . ">" . $ifdescr . "</option>\n";
+ $to_echo .= "<!-- {$value} -->";
+ $canecho = 0;
+ if($pkga['interface_filter'] <> "") {
+ if(stristr($value, $pkga['interface_filter']) == true)
+ $canecho = 1;
+ } else {
+ $canecho = 1;
+ }
+ }
+ if($canecho == 1) {
+ echo $to_echo;
+ echo "</select>\n";
+ echo "<br>" . fixup_string($pkga['description']) . "\n";
}
- echo "</select>\n";
- echo "<br>" . fixup_string($pkga['description']) . "\n";
} else if($pkga['type'] == "radio") {
echo "<input type='radio' name='" . $pkga['fieldname'] . "' value='" . $value . "'>";
} else if($pkga['type'] == "rowhelper") {
OpenPOWER on IntegriCloud