From 8c5b659410a252f726eeafcda366015193db0943 Mon Sep 17 00:00:00 2001 From: Tom Schaefer Date: Wed, 29 Sep 2010 04:45:25 -0400 Subject: Version 1.5 added if selection, nano functions, and sp fix --- config/countryblock/countryblock_if.tmp | 194 ++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 config/countryblock/countryblock_if.tmp (limited to 'config/countryblock/countryblock_if.tmp') diff --git a/config/countryblock/countryblock_if.tmp b/config/countryblock/countryblock_if.tmp new file mode 100644 index 00000000..af56756a --- /dev/null +++ b/config/countryblock/countryblock_if.tmp @@ -0,0 +1,194 @@ +. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +$pgtitle = "Country Block - Interfaces"; +require("guiconfig.inc"); + +/* + In this file, "port" refers to the physical port name, + while "interface" refers to LAN, WAN, or OPTn. +*/ + +/* get list without VLAN interfaces */ +$portlist = get_interface_list(); + +/* add VLAN interfaces */ +if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { + $i = 0; + foreach ($config['vlans']['vlan'] as $vlan) { + $portlist['vlan' . $i] = $vlan; + $portlist['vlan' . $i]['isvlan'] = true; + $i++; + } +} + +if ($_POST) { + + unset($input_errors); + + /* input validation */ + + /* Build a list of the port names so we can see how the interfaces map */ + $portifmap = array(); + foreach ($portlist as $portname => $portinfo) + $portifmap[$portname] = array(); + + /* Go through the list of ports selected by the user, + build a list of port-to-interface mappings in portifmap */ + conf_mount_rw(); + $myFile = "interfaces.txt"; + $fh = fopen($myFile, 'w+'); + + foreach ($_POST as $ifname => $ifport) { + //echo $ifname; + //echo "
"; + fwrite($fh, $ifname . "\n"); + //if (($ifname == 'lan') || ($ifname == 'wan') || (substr($ifname, 0, 3) == 'opt')) + //$portifmap[$ifport][] = strtoupper($ifname); + } + + conf_mount_ro(); + + + if (!$input_errors) { + /* No errors detected, so update the config */ + foreach ($_POST as $ifname => $ifport) { + + if (($ifname == 'lan') || ($ifname == 'wan') || + (substr($ifname, 0, 3) == 'opt')) { + + + } + } + + $savemsg = get_std_save_message($retval); + + + + } +} + + + + + +$pgtitle = "CountryBlock Interfaces"; +include("head.inc"); + + + +?> + + + +

+ +Here to go back"); ?> +
+ + + + + +
+ +
+
+ + + + + + + $iface): + if ($iface['descr']) + $ifdescr = $iface['descr']; + else + $ifdescr = strtoupper($ifname); + ?> + + + + + + + + + + + +
InterfaceSelected 
+ + + + + $portinfo): ?> + + $portname"; + else + echo "$portname"; + } + ?> + + + + +
+
+
+

+

+
+ + + + + + + -- cgit v1.2.3