From 7cca27694705d00641c3f0fef7109a00279d9c49 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Wed, 5 Aug 2015 00:03:49 +0200 Subject: pfflowd - code style fixes, add copyright header --- config/pfflowd/pfflowd.xml | 68 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 10 deletions(-) (limited to 'config/pfflowd') diff --git a/config/pfflowd/pfflowd.xml b/config/pfflowd/pfflowd.xml index 0a683bba..ea32c858 100644 --- a/config/pfflowd/pfflowd.xml +++ b/config/pfflowd/pfflowd.xml @@ -1,4 +1,46 @@ + + + + + + pfflowd 1.0.3 pfflowd: Settings @@ -82,19 +124,23 @@ conf_mount_rw(); config_lock(); global $config; - foreach($config['installedpackages']['pfflowd']['config'] as $cf) { - if($cf['host'] != "") { + foreach ($config['installedpackages']['pfflowd']['config'] as $cf) { + if ($cf['host'] != "") { $start = "\n/sbin/ifconfig pfsync0 up\n"; $start .= "/usr/local/sbin/pfflowd "; $start .= " -n {$cf['host']}"; - if($cf['port'] != "") + if ($cf['port'] != "") { $start .= ":{$cf['port']}"; - if(!empty($cf['sourcehost'])) + } + if (!empty($cf['sourcehost'])) { $start .= " -s {$cf['sourcehost']} "; - if($cf['direction'] != "") + } + if ($cf['direction'] != "") { $start .= " -S {$cf['direction']}"; - if($cf['version'] != "") + } + if ($cf['version'] != "") { $start .= " -v {$cf['version']}"; + } write_rcfile(array( "file" => "pfflowd.sh", "start" => $start, @@ -110,18 +156,20 @@ } function validate_form_pfflowd($post, &$input_errors) { - if(($post['host'] == "") || !is_ipaddr($post['host'])) + if (($post['host'] == "") || !is_ipaddr($post['host'])) { $input_errors[] = 'You must specify a valid ip address in the \'Host\' field'; - if(($post['port'] == "") || !is_port($post['port'])) + } + if (($post['port'] == "") || !is_port($post['port'])) { $input_errors[] = 'You must specify a valid port number in the \'Port\' field'; + } } - + function cleanup_config_pfflowd() { global $a_pkg; $pffconf = array(); if (is_array($a_pkg)) { foreach($a_pkg as $cf) { - if($cf['host'] != "") { + if ($cf['host'] != "") { $pffconf = $cf; } } -- cgit v1.2.3