本文整理汇总了PHP中filter_configure函数的典型用法代码示例。如果您正苦于以下问题:PHP filter_configure函数的具体用法?PHP filter_configure怎么用?PHP filter_configure使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了filter_configure函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: dhcpv6_apply_changes
function dhcpv6_apply_changes($dhcpdv6_enable_changed)
{
$retval = 0;
$retvaldhcp = 0;
$retvaldns = 0;
/* Stop DHCPv6 so we can cleanup leases */
killbypid("{$g['dhcpd_chroot_path']}{$g['varrun_path']}/dhcpdv6.pid");
// dhcp_clean_leases();
/* dnsmasq_configure calls dhcpd_configure */
/* no need to restart dhcpd twice */
if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic'])) {
$retvaldns = services_dnsmasq_configure();
if ($retvaldns == 0) {
clear_subsystem_dirty('hosts');
clear_subsystem_dirty('staticmaps');
}
} else {
if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
$retvaldns = services_unbound_configure();
if ($retvaldns == 0) {
clear_subsystem_dirty('unbound');
clear_subsystem_dirty('staticmaps');
}
} else {
$retvaldhcp = services_dhcpd_configure();
if ($retvaldhcp == 0) {
clear_subsystem_dirty('staticmaps');
}
}
}
if ($dhcpdv6_enable_changed) {
$retvalfc = filter_configure();
}
if ($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) {
$retval = 1;
}
return get_std_save_message($retval);
}
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:38,代码来源:services_dhcpv6.php
示例2: interface_bring_down
interface_bring_down($ifapply, false, $ifcfgo);
interface_configure($ifapply, true);
} else {
interface_bring_down($ifapply, true, $ifcfgo);
if (isset($config['dhcpd'][$ifapply]['enable']) || isset($config['dhcpdv6'][$ifapply]['enable'])) {
services_dhcpd_configure();
}
}
}
}
/* restart snmp so that it binds to correct address */
services_snmpd_configure();
/* sync filter configuration */
setup_gateways_monitor();
clear_subsystem_dirty('interfaces');
filter_configure();
enable_rrd_graphing();
if (is_subsystem_dirty('staticroutes') && system_routing_configure() == 0) {
clear_subsystem_dirty('staticroutes');
}
}
@unlink("{$g['tmp_path']}/.interfaces.apply");
header("Location: interfaces.php?if={$if}");
exit;
} else {
if ($_POST && $_POST['enable'] != "yes") {
unset($wancfg['enable']);
if (isset($wancfg['wireless'])) {
interface_sync_wireless_clones($wancfg, false);
}
write_config("Interface {$_POST['descr']}({$if}) is now disabled.");
开发者ID:simudream,项目名称:pfsense,代码行数:31,代码来源:interfaces.php
示例3: str_replace
$host = str_replace(array("[", "]"), "", implode(":", $http_host_port));
$host = "[{$host}]";
}
} else {
list($host) = explode(":", $_SERVER['HTTP_HOST']);
}
$prot = $config['system']['webgui']['protocol'];
$port = $config['system']['webgui']['port'];
if ($port) {
$url = "{$prot}://{$host}:{$port}/system_advanced_admin.php";
} else {
$url = "{$prot}://{$host}/system_advanced_admin.php";
}
}
write_config();
$retval = filter_configure();
$savemsg = get_std_save_message($retval);
if ($restart_webgui) {
$savemsg .= sprintf("<br />" . gettext("One moment...redirecting to %s in 20 seconds."), $url);
}
conf_mount_rw();
setup_serial_port();
// Restart DNS in case dns rebinding toggled
if (isset($config['dnsmasq']['enable'])) {
services_dnsmasq_configure();
} elseif (isset($config['unbound']['enable'])) {
services_unbound_configure();
}
conf_mount_ro();
}
}
开发者ID:calvinbui,项目名称:pfsense,代码行数:31,代码来源:system_advanced_admin.php
示例4: services_unbound_configure
}
} else {
if (isset($config['unbound']['enable']) && isset($config['unbound']['regdhcpstatic'])) {
$retvaldns = services_unbound_configure();
if ($retvaldns == 0) {
clear_subsystem_dirty('unbound');
}
} else {
$retvaldhcp = services_dhcpd_configure();
if ($retvaldhcp == 0) {
clear_subsystem_dirty('staticmaps');
}
}
}
if ($dhcpd_enable_changed) {
$retvalfc = filter_configure();
}
if ($retvaldhcp == 1 || $retvaldns == 1 || $retvalfc == 1) {
$retval = 1;
}
$savemsg = get_std_save_message();
}
if ($act == "delpool") {
if ($a_pools[$_GET['id']]) {
unset($a_pools[$_GET['id']]);
write_config();
header("Location: services_dhcp.php?if={$if}");
exit;
}
}
if ($act == "del") {
开发者ID:karawan,项目名称:core,代码行数:31,代码来源:services_dhcp.php
示例5: easyrule_pass_rule_add
function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport, $ipproto)
{
global $config;
/* No rules, start a new array */
if (!is_array($config['filter']['rule'])) {
$config['filter']['rule'] = array();
}
filter_rules_sort();
$a_filter =& $config['filter']['rule'];
/* Make up a new rule */
$filterent = array();
$filterent['type'] = 'pass';
$filterent['interface'] = $int;
$filterent['ipprotocol'] = $ipproto;
$filterent['descr'] = gettext("Easy Rule: Passed from Firewall Log View");
if ($proto != "any") {
$filterent['protocol'] = $proto;
} else {
unset($filterent['protocol']);
}
/* Default to only allow echo requests, since that's what most people want and
* it should be a safe choice. */
if ($proto == "icmp") {
$filterent['icmptype'] = 'echoreq';
}
if (strtolower($proto) == "icmp6" || strtolower($proto) == "icmpv6") {
$filterent['protocol'] = "icmp";
}
if (is_subnet($srchost)) {
list($srchost, $srcmask) = explode("/", $srchost);
} elseif (is_specialnet($srchost)) {
$srcmask = 0;
} elseif (is_ipaddrv6($srchost)) {
$srcmask = 128;
} else {
$srcmask = 32;
}
if (is_subnet($dsthost)) {
list($dsthost, $dstmask) = explode("/", $dsthost);
} elseif (is_specialnet($dsthost)) {
$dstmask = 0;
} elseif (is_ipaddrv6($dsthost)) {
$dstmask = 128;
} else {
$dstmask = 32;
}
pconfig_to_address($filterent['source'], $srchost, $srcmask);
pconfig_to_address($filterent['destination'], $dsthost, $dstmask, '', $dstport, $dstport);
$filterent['created'] = make_config_revision_entry(null, gettext("Easy Rule"));
$a_filter[] = $filterent;
write_config($filterent['descr']);
$retval = filter_configure();
return true;
}
开发者ID:noikiy,项目名称:core-2,代码行数:54,代码来源:diag_logs_filter.php
示例6: filter_configure_xmlrpc
function filter_configure_xmlrpc($raw_params)
{
global $xmlrpc_g, $config;
$params = xmlrpc_params_to_php($raw_params);
if (!xmlrpc_auth($params)) {
xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
}
filter_configure();
system_routing_configure();
setup_gateways_monitor();
relayd_configure();
require_once "openvpn.inc";
openvpn_resync_all();
if (isset($config['dnsmasq']['enable'])) {
services_dnsmasq_configure();
} elseif (isset($config['unbound']['enable'])) {
services_unbound_configure();
} else {
# Both calls above run services_dhcpd_configure(), then we just
# need to call it when they are not called to avoid restarting dhcpd
# twice, as described on ticket #3797
services_dhcpd_configure();
}
local_sync_accounts();
return $xmlrpc_g['return']['true'];
}
开发者ID:michaeleino,项目名称:pfsense,代码行数:27,代码来源:xmlrpc.php
示例7: filter_configure
/**
* Wrapper for filter_configure()
*
* @param string $username
* @param string $password
*
* @return bool
*/
public function filter_configure($username, $password)
{
$this->auth($username, $password);
global $g, $config;
filter_configure();
system_routing_configure();
setup_gateways_monitor();
relayd_configure();
require_once "openvpn.inc";
openvpn_resync_all();
/*
* The DNS Resolver and the DNS Forwarder may both be active so
* long as * they are running on different ports.
* See ticket #5882
*/
if (isset($config['dnsmasq']['enable'])) {
/* Configure dnsmasq but tell it NOT to restart DHCP */
services_dnsmasq_configure(false);
} else {
/* kill any running dnsmasq instance */
if (isvalidpid("{$g['varrun_path']}/dnsmasq.pid")) {
sigkillbypid("{$g['varrun_path']}/dnsmasq.pid", "TERM");
}
}
if (isset($config['unbound']['enable'])) {
/* Configure unbound but tell it NOT to restart DHCP */
services_unbound_configure(false);
} else {
/* kill any running Unbound instance */
if (isvalidpid("{$g['varrun_path']}/unbound.pid")) {
sigkillbypid("{$g['varrun_path']}/unbound.pid", "TERM");
}
}
/*
* Call this separately since the above are manually set to
* skip the DHCP restart they normally perform.
* This avoids restarting dhcpd twice as described on
* ticket #3797
*/
services_dhcpd_configure();
local_sync_accounts();
return true;
}
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:51,代码来源:xmlrpc.php
示例8: filter_configure_xmlrpc
function filter_configure_xmlrpc($raw_params)
{
global $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
if (!xmlrpc_auth($params)) {
return $xmlrpc_g['return']['authfail'];
}
require_once "vslb.inc";
slbd_configure();
filter_configure();
system_routing_configure();
return $xmlrpc_g['return']['true'];
}
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:13,代码来源:xmlrpc.php
示例9: filter_configure_xmlrpc
function filter_configure_xmlrpc($raw_params)
{
global $xmlrpc_g, $g, $config;
$params = xmlrpc_params_to_php($raw_params);
if (!xmlrpc_auth($params)) {
xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
}
filter_configure();
system_routing_configure();
setup_gateways_monitor();
relayd_configure();
require_once "openvpn.inc";
openvpn_resync_all();
/* The DNS Resolver and the DNS Forwarder may both be active so long as
* they are running on different ports. See ticket #5882
*/
$need_dhcp_start = true;
if (isset($config['dnsmasq']['enable'])) {
/* Configure dnsmasq but tell it NOT to restart DHCP */
services_dnsmasq_configure(false);
} else {
/* kill any running dnsmasq since it is not enabled. */
if (file_exists("{$g['varrun_path']}/dnsmasq.pid")) {
sigkillbypid("{$g['varrun_path']}/dnsmasq.pid", "TERM");
}
}
if (isset($config['unbound']['enable'])) {
/* Configure unbound but tell it NOT to restart DHCP */
services_unbound_configure(false);
} else {
/* kill any running Unbound instance since it is not enabled. */
if (file_exists("{$g['varrun_path']}/unbound.pid")) {
sigkillbypid("{$g['varrun_path']}/unbound.pid", "TERM");
}
}
/* Call this separately since the above are manually set to skip the DHCP restart they normally perform.
* This avoids restarting dhcpd twice as described on ticket #3797
*/
services_dhcpd_configure();
local_sync_accounts();
return $xmlrpc_g['return']['true'];
}
开发者ID:curtiszimmerman,项目名称:pfsense,代码行数:43,代码来源:xmlrpc.php
示例10: filter_configure_xmlrpc
function filter_configure_xmlrpc($raw_params)
{
global $xmlrpc_g;
$params = xmlrpc_params_to_php($raw_params);
if (!xmlrpc_auth($params)) {
xmlrpc_authfail();
return $xmlrpc_g['return']['authfail'];
}
filter_configure();
system_routing_configure();
setup_gateways_monitor();
relayd_configure();
require_once "openvpn.inc";
openvpn_resync_all();
services_dhcpd_configure();
services_dnsmasq_configure();
local_sync_accounts();
return $xmlrpc_g['return']['true'];
}
开发者ID:rdmenezes,项目名称:pfsense,代码行数:19,代码来源:xmlrpc.php
注:本文中的filter_configure函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论