mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
system: stop using get_possible_listen_ips()
This commit is contained in:
parent
772ea4ace1
commit
d93f60bf08
@ -757,17 +757,9 @@ EOD;
|
||||
file_put_contents('/var/etc/syslog.conf', $syslogconf);
|
||||
|
||||
if (!empty($syslogcfg['sourceip'])) {
|
||||
if ($syslogcfg['ipproto'] == "ipv6") {
|
||||
$ifaddr = is_ipaddr($syslogcfg['sourceip']) ? $syslogcfg['sourceip'] : get_interface_ipv6($syslogcfg['sourceip']);
|
||||
if (!is_ipaddr($ifaddr)) {
|
||||
$ifaddr = get_interface_ip($syslogcfg['sourceip']);
|
||||
}
|
||||
} else {
|
||||
$ifaddr = is_ipaddr($syslogcfg['sourceip']) ? $syslogcfg['sourceip'] : get_interface_ip($syslogcfg['sourceip']);
|
||||
if (!is_ipaddr($ifaddr)) {
|
||||
$ifaddr = get_interface_ipv6($syslogcfg['sourceip']);
|
||||
}
|
||||
}
|
||||
$ifaddr = $syslogcfg['ipproto'] == 'ipv6' ?
|
||||
get_interface_ipv6($syslogcfg['sourceip']) :
|
||||
get_interface_ip($syslogcfg['sourceip']);
|
||||
if (is_ipaddr($ifaddr)) {
|
||||
$syslogd_extra .= exec_safe('-b %s ', $ifaddr);
|
||||
}
|
||||
|
||||
@ -1,33 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
Copyright (C) 2014-2015 Deciso B.V.
|
||||
Copyright (C) 2007 Seth Mos <seth.mos@dds.nl>
|
||||
Copyright (C) 2004-2009 Scott Ullrich <sullrich@gmail.com>
|
||||
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>
|
||||
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.
|
||||
*/
|
||||
* Copyright (C) 2014-2015 Deciso B.V.
|
||||
* Copyright (C) 2007 Seth Mos <seth.mos@dds.nl>
|
||||
* Copyright (C) 2004-2009 Scott Ullrich <sullrich@gmail.com>
|
||||
* Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>
|
||||
* 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.
|
||||
*/
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
require_once("interfaces.inc");
|
||||
@ -342,7 +342,7 @@ $(document).ready(function() {
|
||||
<td style="width:22%"><strong><?=gettext("Local Logging Options");?></strong></td>
|
||||
<td style="width:78%; text-align:right">
|
||||
<small><?=gettext("full help"); ?> </small>
|
||||
<i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page"></i>
|
||||
<i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page"></i>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -421,7 +421,7 @@ $(document).ready(function() {
|
||||
</div>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext('Local Logging') ?></td>
|
||||
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext('Local Logging') ?></td>
|
||||
<td> <input name="disablelocallogging" type="checkbox" id="disablelocallogging" value="yes" <?=!empty($pconfig['disablelocallogging']) ? "checked=\"checked\"" :""; ?> onclick="enable_change(false)" />
|
||||
<?=gettext("Disable writing log files to the local disk");?></td>
|
||||
</tr>
|
||||
@ -447,15 +447,13 @@ $(document).ready(function() {
|
||||
<tr>
|
||||
<td><a id="help_for_sourceip" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Source Address"); ?></td>
|
||||
<td>
|
||||
<select name="sourceip" class="form-control">
|
||||
<option value=""><?=gettext('Default (any)') ?></option>
|
||||
<?php
|
||||
foreach (get_possible_listen_ips() as $sip): ?>
|
||||
<option value="<?=$sip['value'];?>" <?=!link_interface_to_bridge($sip['value']) && ($sip['value'] == $pconfig['sourceip']) ? "selected=\"selected\"" : "";?>>
|
||||
<?=htmlspecialchars($sip['name']);?>
|
||||
<select name="sourceip" class="form-control">
|
||||
<option value=""><?= gettext('Any') ?></option>
|
||||
<?php foreach (get_configured_interface_with_descr() as $ifname => $ifdescr): ?>
|
||||
<option value="<?= html_safe($ifname) ?>" <?= $ifname == $pconfig['sourceip'] ? 'selected="selected"' : '' ?>>
|
||||
<?= html_safe($ifdescr) ?>
|
||||
</option>
|
||||
<?php
|
||||
endforeach; ?>
|
||||
<?php endforeach ?>
|
||||
</select>
|
||||
<div class="hidden" data-for="help_for_sourceip">
|
||||
<?= gettext("This option will allow the logging daemon to bind to a single IP address, rather than all IP addresses."); ?>
|
||||
@ -561,4 +559,6 @@ $(document).ready(function() {
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<?php include("foot.inc"); ?>
|
||||
<?php
|
||||
|
||||
include("foot.inc");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user