// A real gateway has been selected. if (is_ipaddr($pconfig[$dnsname])) { if (is_ipaddrv4($pconfig[$dnsname]) && validate_address_family($pconfig[$dnsname], $pconfig[$dnsgwname]) === false) { $input_errors[] = gettext("You can not specify IPv6 gateway '{$pconfig[$dnsgwname]}' for IPv4 DNS server '{$pconfig[$dnsname]}'"); } if (is_ipaddrv6($pconfig[$dnsname]) && validate_address_family($pconfig[$dnsname], $pconfig[$dnsgwname]) === false) { $input_errors[] = gettext("You can not specify IPv4 gateway '{$pconfig[$dnsgwname]}' for IPv6 DNS server '{$pconfig[$dnsname]}'"); } } else { // The user selected a gateway but did not provide a DNS address. Be nice and set the gateway back to "none". $ignore_posted_dnsgw[$dnsgwname] = true; } } } /* XXX cranky low-level call, please refactor */ $direct_networks_list = explode(' ', filter_get_direct_networks_list(filter_generate_optcfg_array())); for ($dnscounter = 1; $dnscounter < 5; $dnscounter++) { $dnsitem = "dns{$dnscounter}"; $dnsgwitem = "dns{$dnscounter}gw"; if (!empty($pconfig[$dnsgwitem])) { if (interface_has_gateway($pconfig[$dnsgwitem])) { foreach ($direct_networks_list as $direct_network) { if (ip_in_subnet($_POST[$dnsitem], $direct_network)) { $input_errors[] = sprintf(gettext("You can not assign a gateway to DNS '%s' server which is on a directly connected network."), $pconfig[$dnsitem]); } } } } } # it's easy to have a little too much whitespace in the field, clean it up for the user before processing. $pconfig['timeservers'] = preg_replace('/[[:blank:]]+/', ' ', $pconfig['timeservers']);
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. */ require_once "guiconfig.inc"; require_once "filter.inc"; require_once "pfsense-utils.inc"; require_once "interfaces.inc"; global $GatewaysList; $FilterIflist = filter_generate_optcfg_array(); if (!is_array($config['nat']['outbound'])) { $config['nat']['outbound'] = array(); } if (!is_array($config['nat']['outbound']['rule'])) { $config['nat']['outbound']['rule'] = array(); } $a_out =& $config['nat']['outbound']['rule']; if (!isset($config['nat']['outbound']['mode'])) { $config['nat']['outbound']['mode'] = "automatic"; } $mode = $config['nat']['outbound']['mode']; if ($_POST['apply']) { write_config(); $retval = 0; $retval |= filter_configure();
</button> <button type="submit" id="order-store" class="btn btn-primary btn-sm" value="Save changes" disabled name="order-store" title="<?php echo gettext('Save mapping order'); ?> "> <i class="fa fa-save icon-embed-btn"></i> <?php echo gettext("Save"); ?> </button> </nav> <?php if ($mode == "automatic" || $mode == "hybrid") { if (empty($FilterIflist)) { filter_generate_optcfg_array(); } if (empty($GatewaysList)) { filter_generate_gateways(); } $automatic_rules = filter_nat_rules_outbound_automatic(implode(" ", filter_nat_rules_automatic_tonathosts())); unset($FilterIflist, $GatewaysList); ?> <div class="panel panel-default"> <div class="panel-heading"><h2 class="panel-title"><?php echo gettext("Automatic rules:"); ?> </h2></div> <div class="panel-body table-responsive"> <table class="table table-hover table-striped table-condensed"> <thead>