diff options
author | xbipin <bipin@xbipin.com> | 2015-01-28 12:46:51 +0400 |
---|---|---|
committer | xbipin <bipin@xbipin.com> | 2015-01-28 12:46:51 +0400 |
commit | 085136fe60d9a60d5a3e2f04e45ba2568b592b6f (patch) | |
tree | e6671019110215fa5878c6433603ae1d0bc0e84a | |
parent | f76cbd6ffea4753abae87efae1d7a73bde67f3cd (diff) | |
download | pfsense-085136fe60d9a60d5a3e2f04e45ba2568b592b6f.zip pfsense-085136fe60d9a60d5a3e2f04e45ba2568b592b6f.tar.gz |
multiple allow/deny entries for UPnP (rowhelper)
This patch will allow the web GUI for UPnP to enter more user specified
entries rather than just 4, I replaced the 4 boxes with one rowhelper
control
-rw-r--r-- | usr/local/pkg/miniupnpd.inc | 8 | ||||
-rw-r--r-- | usr/local/pkg/miniupnpd.xml | 34 |
2 files changed, 13 insertions, 29 deletions
diff --git a/usr/local/pkg/miniupnpd.inc b/usr/local/pkg/miniupnpd.inc index 4cad0e5..c48e767 100644 --- a/usr/local/pkg/miniupnpd.inc +++ b/usr/local/pkg/miniupnpd.inc @@ -98,7 +98,7 @@ $input_errors[] = 'You must specify a valid traffic shaping queue.'; /* user permissions validation */ - for($i=1; $i<=4; $i++) { + for ($i=0; $i<500; $i++){ if($post["permuser{$i}"]) { $perm = explode(' ',$post["permuser{$i}"]); /* should explode to 4 args */ @@ -209,9 +209,9 @@ $config_text .= "model_number=".file_get_contents("/etc/version")."\n"; /* upnp access restrictions */ - for($i=1; $i<=4; $i++) { - if($upnp_config["permuser{$i}"]) - $config_text .= "{$upnp_config["permuser{$i}"]}\n"; + foreach($upnp_config['row'] as $row){ + if($row['permuser']) + $config_text .= "{$row["permuser"]}\n"; } if($upnp_config['permdefault']) diff --git a/usr/local/pkg/miniupnpd.xml b/usr/local/pkg/miniupnpd.xml index 9153e53..be2c6e0 100644 --- a/usr/local/pkg/miniupnpd.xml +++ b/usr/local/pkg/miniupnpd.xml @@ -116,34 +116,18 @@ <type>checkbox</type> </field> <field> - <fielddescr>User specified permissions 1</fielddescr> - <fieldname>permuser1</fieldname> + <fielddescr>User specified permissions</fielddescr> <description>Format: [allow or deny] [ext port or range] [int ipaddr or ipaddr/CIDR] [int port or range] <br />Example: allow 1024-65535 192.168.0.0/24 1024-65535</description> - <type>input</type> - <size>60</size> + <type>rowhelper</type> + <rowhelper> + <rowhelperfield> + <fieldname>permuser</fieldname> + <type>input</type> + <size>60</size> + </rowhelperfield> + </rowhelper> </field> - <field> - <fielddescr>User specified permissions 2</fielddescr> - <fieldname>permuser2</fieldname> - <description>Format: [allow or deny] [ext port or range] [int ipaddr or ipaddr/CIDR] [int port or range]</description> - <type>input</type> - <size>60</size> - </field> - <field> - <fielddescr>User specified permissions 3</fielddescr> - <fieldname>permuser3</fieldname> - <description>Format: [allow or deny] [ext port or range] [int ipaddr or ipaddr/CIDR] [int port or range]</description> - <type>input</type> - <size>60</size> - </field> - <field> - <fielddescr>User specified permissions 4</fielddescr> - <fieldname>permuser4</fieldname> - <description>Format: [allow or deny] [ext port or range] [int ipaddr or ipaddr/CIDR] [int port or range]</description> - <type>input</type> - <size>60</size> - </field> </fields> <custom_php_command_before_form> before_form_miniupnpd($pkg); |