本文整理汇总了PHP中build_if_list函数的典型用法代码示例。如果您正苦于以下问题:PHP build_if_list函数的具体用法?PHP build_if_list怎么用?PHP build_if_list使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了build_if_list函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: print_apply_box
}
if (is_subsystem_dirty('unbound')) {
print_apply_box(gettext("The DNS Resolver configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$tab_array = array();
$tab_array[] = array(gettext("General settings"), true, "services_unbound.php");
$tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_advanced.php");
$tab_array[] = array(gettext("Access Lists"), false, "/services_unbound_acls.php");
display_top_tabs($tab_array, true);
$form = new Form();
$section = new Form_Section('General DNS Resolver Options');
$section->addInput(new Form_Checkbox('enable', 'Enable', 'Enable DNS resolver', $pconfig['enable']));
$section->addInput(new Form_Input('port', 'Listen Port', 'number', $pconfig['port'], ['placeholder' => '53']))->setHelp('The port used for responding to DNS queries. It should normally be left blank unless another service needs to bind to TCP/UDP port 53.');
$activeiflist = build_if_list($pconfig['active_interface']);
$section->addInput(new Form_Select('active_interface', 'Network Interfaces', $activeiflist['selected'], $activeiflist['options'], true))->addClass('general')->setHelp('Interface IPs used by the DNS Resolver for responding to queries from clients. If an interface has both IPv4 and IPv6 IPs, both are used. Queries to other interface IPs not selected below are discarded. ' . 'The default behavior is to respond to queries on every available IPv4 and IPv6 address.');
$outiflist = build_if_list($pconfig['outgoing_interface']);
$section->addInput(new Form_Select('outgoing_interface', 'Outgoing Network Interfaces', $outiflist['selected'], $outiflist['options'], true))->addClass('general')->setHelp('Utilize different network interface(s) that the DNS Resolver will use to send queries to authoritative servers and receive their replies. By default all interfaces are used.');
$unbound_local_zone_types = array("deny" => gettext("Deny"), "refuse" => gettext("Refuse"), "static" => gettext("Static"), "transparent" => gettext("Transparent"), "typetransparent" => gettext("Type Transparent"), "redirect" => gettext("Redirect"), "inform" => gettext("Inform"), "inform_deny" => gettext("Inform Deny"), "nodefault" => gettext("No Default"));
$section->addInput(new Form_Select('system_domain_local_zone_type', 'System Domain Local Zone Type', $pconfig['system_domain_local_zone_type'], $unbound_local_zone_types))->setHelp('The local-zone type used for the pfSense system domain (System | General Setup | Domain). Transparent is the default. Local-Zone type descriptions are available in the unbound.conf(5) manual pages.');
$section->addInput(new Form_Checkbox('dnssec', 'DNSSEC', 'Enable DNSSEC Support', $pconfig['dnssec']));
$section->addInput(new Form_Checkbox('forwarding', 'DNS Query Forwarding', 'Enable Forwarding Mode', $pconfig['forwarding']));
$section->addInput(new Form_Checkbox('regdhcp', 'DHCP Registration', 'Register DHCP leases in the DNS Resolver', $pconfig['regdhcp']))->setHelp(sprintf('If this option is set, then machines that specify their hostname when requesting a DHCP lease will be registered' . ' in the DNS Resolver, so that their name can be resolved.' . ' You should also set the domain in %sSystem: General setup%s to the proper value.', '<a href="system.php">', '</a>'));
$section->addInput(new Form_Checkbox('regdhcpstatic', 'Static DHCP', 'Register DHCP static mappings in the DNS Resolver', $pconfig['regdhcpstatic']))->setHelp(sprintf('If this option is set, then DHCP static mappings will be registered in the DNS Resolver, so that their name can be ' . 'resolved. You should also set the domain in %s' . 'System: General setup%s to the proper value.', '<a href="system.php">', '</a>'));
$btnadvdns = new Form_Button('btnadvdns', 'Custom options');
$btnadvdns->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText('Custom options', $btnadvdns . ' ' . 'Show custom options'));
$section->addInput(new Form_Textarea('custom_options', 'Custom options', $pconfig['custom_options']))->setHelp('Enter any additional configuration parameters to add to the DNS Resolver configuration here, separated by a newline');
$form->add($section);
print $form;
?>
示例2: print_input_errors
}
$interfaces['lo0'] = 'Localhost';
return $interfaces;
}
if ($input_errors) {
print_input_errors($input_errors);
}
$form = new Form();
$section = new Form_Section('Edit Virtual IP');
$group = new Form_Group('Type');
$group->add(new Form_Checkbox('mode', null, 'IP Alias', $pconfig['mode'] == "ipalias", 'ipalias'))->displayAsRadio();
$group->add(new Form_Checkbox('mode', null, 'CARP', $pconfig['mode'] == "carp", 'carp'))->displayAsRadio();
$group->add(new Form_Checkbox('mode', null, 'Proxy ARP', $pconfig['mode'] == "proxyarp", 'proxyarp'))->displayAsRadio();
$group->add(new Form_Checkbox('mode', null, 'Other', $pconfig['mode'] == "other", 'other'))->displayAsRadio();
$section->add($group);
$section->addInput(new Form_Select('interface', 'Interface', $pconfig['interface'], build_if_list()));
$section->addInput(new Form_Select('type', 'Address type', !$pconfig['range'] && $pconfig['subnet_bits'] == 32 || !isset($pconfig['subnet']) ? 'single' : 'network', array('single' => 'Single address', 'network' => 'Network')))->addClass('typesel');
$section->addInput(new Form_IpAddress('subnet', 'Address(es)', $pconfig['subnet']))->addMask('subnet_bits', $pconfig['subnet_bits'])->setHelp('<span id="address_note"></span>');
$section->addInput(new Form_Checkbox('noexpand', 'Expansion', 'Disable expansion of this entry into IPs on NAT lists (e.g. 192.168.1.0/24 expands to 256 entries.) ', isset($pconfig['noexpand'])));
$section->addInput(new Form_Input('password', 'Virtual IP Password', 'password', $pconfig['password']))->setHelp('Enter the VHID group password.');
$section->addInput(new Form_Select('vhid', 'VHID Group', $pconfig['vhid'], array_combine(range(1, 255, 1), range(1, 255, 1))))->setHelp('Enter the VHID group that the machines will share');
$group = new Form_Group('Advertising frequency');
$group->add(new Form_Select('advbase', 'Base', $pconfig['advbase'], array_combine(range(1, 254, 1), range(1, 254, 1))))->setHelp('Base');
$group->add(new Form_Select('advskew', 'Skew', $pconfig['advskew'], array_combine(range(0, 254, 1), range(0, 254, 1))))->setHelp('Skew');
$group->setHelp('The frequency that this machine will advertise. 0 means usually master. Otherwise the lowest combination of both values in the cluster determines the master.');
$section->add($group);
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('You may enter a description here for your reference (not parsed).');
if (isset($id) && $a_vip[$id]) {
$section->addInput(new Form_Input('id', null, 'hidden', $id));
}
$section->addInput(new Form_Input('uniqid', null, 'hidden', $pconfig['uniqid']));
示例3: array
$pgtitle = array(gettext("Services"), gettext("Dynamic DNS client"));
include "head.inc";
if ($input_errors) {
print_input_errors($input_errors);
}
if ($savemsg) {
print_info_box($savemsg, 'success');
}
require_once 'classes/Form.class.php';
$form = new Form();
$section = new Form_Section('Dynamic DNS Client');
// Confusingly the 'enable' checkbox is labelled 'Disable', but thats the way it works!
// No action (hide or disable) is taken on selecting this.
$section->addInput(new Form_Checkbox('enable', 'Disable', 'Disable this client', $pconfig['enable']));
$section->addInput(new Form_Select('type', 'Service Type', $pconfig['type'], build_type_list()));
$interfacelist = build_if_list();
$section->addInput(new Form_Select('interface', 'Interface to monitor', $pconfig['interface'], $interfacelist));
$section->addInput(new Form_Select('requestif', 'Interface to send update from', $pconfig['request'], $interfacelist))->setHelp('This is almost always the same as the Interface to Monitor. ');
$section->addInput(new Form_Input('host', 'Hostname', 'text', $pconfig['host']))->setHelp('Enter the complete fully qualified domain name. Example: myhost.dyndns.org' . '<br />' . 'he.net tunnelbroker: Enter your tunnel ID' . '<br />' . 'GleSYS: Enter your record ID' . '<br />' . 'DNSimple: Enter only the domain name.');
$section->addInput(new Form_Input('mx', 'MX', 'text', $pconfig['mx']))->setHelp('Note: With DynDNS service you can only use a hostname, not an IP address. ' . 'Set this option only if you need a special MX record. Not all services support this.');
$section->addInput(new Form_Checkbox('wildcard', 'Wildcards', 'Enable Wildcard', $pconfig['wildcard']));
$section->addInput(new Form_Checkbox('verboselog', 'Verbose logging', 'Enable verbose logging', $pconfig['verboselog']));
$section->addInput(new Form_Checkbox('curl_ipresolve_v4', 'CURL options', 'Force IPv4 resolving', $pconfig['curl_ipresolve_v4']));
$section->addInput(new Form_Checkbox('curl_ssl_verifypeer', null, 'Verify SSL peer', $pconfig['curl_ssl_verifypeer']));
$section->addInput(new Form_Input('username', 'Username', 'text', $pconfig['username']))->setHelp('Username is required for all types except Namecheap, FreeDNS and Custom Entries.' . '<br />' . 'Route 53: Enter your Access Key ID.' . '<br />' . 'GleSYS: Enter your API user.' . '<br />' . 'For Custom Entries, Username and Password represent HTTP Authentication username and passwords.');
$section->addInput(new Form_Input('passwordfld', 'Password', 'password', $pconfig['passwordfld']))->setHelp('FreeDNS (freedns.afraid.org): Enter your "Authentication Token" provided by FreeDNS.' . '<br />' . 'Route 53: Enter your Secret Access Key.' . '<br />' . 'GleSYS: Enter your API key.' . '<br />' . 'DNSimple: Enter your API token.');
$section->addInput(new Form_Input('zoneid', 'Zone ID', 'text', $pconfig['zoneid']))->setHelp('Enter Zone ID that you received when you created your domain in Route 53.' . '<br />' . 'DNSimple: Enter the Record ID of record to update.');
$section->addInput(new Form_Input('updateurl', 'Update URL', 'text', $pconfig['updateurl']))->setHelp('This is the only field required by for Custom Dynamic DNS, and is only used by Custom Entries.');
$section->addInput(new Form_Textarea('resultmatch', 'Result Match', $pconfig['resultmatch']))->sethelp('This field should be identical to what your DDNS Provider will return if the update succeeds, leave it blank to disable checking of returned results.' . '<br />' . 'If you need the new IP to be included in the request, put %IP% in its place.' . '<br />' . 'If you need to include multiple possible values, separate them with a |. If your provider includes a |, escape it with \\|)' . '<br />' . 'Tabs (\\t), newlines (\\n) and carriage returns (\\r) at the beginning or end of the returned results are removed before comparison.');
$section->addInput(new Form_Input('ttl', 'TTL', 'text', $pconfig['ttl']))->setHelp('Choose TTL for your dns record.');
$section->addInput(new Form_Input('description', 'Description', 'text', $pconfig['description']))->setHelp('You may enter a description here for your reference (not parsed).');
示例4: array
}
/* add ipsec interfaces */
if (ipsec_enabled() && have_ruleint_access("enc0")) {
$interfaces["enc0"] = "IPsec";
}
/* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
$interfaces["openvpn"] = "OpenVPN";
}
return $interfaces;
}
$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("NPt"), gettext("Edit"));
include "head.inc";
if ($input_errors) {
print_input_errors($input_errors);
}
$form = new Form();
$section = new Form_Section('Edit NAT NPt entry');
$section->addInput(new Form_Checkbox('disabled', 'Disabled', 'Disable this rule', $pconfig['disabled']));
$section->addInput(new Form_Select('interface', 'Interface', $pconfig['interface'], build_if_list()))->setHelp('Choose which interface this rule applies to.' . '<br />' . 'Hint: in most cases, you\'ll want to use "WAN" here.');
$section->addInput(new Form_Checkbox('srcnot', 'Internal IPv6 prefix', 'Not', $pconfig['srcnot']))->setHelp('Use this option to invert the sense of the match. ');
$section->addInput(new Form_IpAddress('src', 'Address', $pconfig['src']))->addMask('srcmask', $pconfig['srcmask'])->setHelp('Internal (LAN) ULA IPv6 Prefix for the Network Prefix translation. ' . 'The prefix size specified for the internal IPv6 prefix will be applied to the external prefix.');
$section->addInput(new Form_Checkbox('dstnot', 'Destination IPv6 prefix', 'Not', $pconfig['dstnot']))->setHelp('Use this option to invert the sense of the match. ');
$section->addInput(new Form_IpAddress('dst', 'Address', $pconfig['dst']))->addMask('dstmask', $pconfig['dstmask'])->setHelp('Global Unicast routable IPv6 prefix');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('You may enter a description here for your reference (not parsed).');
if (isset($id) && $a_npt[$id]) {
$section->addInput(new Form_Input('id', null, 'hidden', $id));
}
$form->add($section);
print $form;
include "foot.inc";
示例5: foreach
$extra = '';
foreach ($config['nat']['rule'] as $index => $nat_rule) {
if ($nat_rule['associated-rule-id'] === $pconfig['associated-rule-id']) {
$extra = '<br/><a href="firewall_nat_edit.php?id=' . $index . '">' . gettext('View the NAT rule') . '</a>';
}
}
$section->addInput(new Form_StaticText('Associated filter rule', '<span class="help-block">' . 'This is associated with a NAT rule.<br/>' . 'Editing the interface, protocol, source, or destination of associated filter rules is not permitted.' . $extra . '</span>'));
$form->addGlobal(new Form_Input('associated-rule-id', null, 'hidden', $pconfig['associated-rule-id']));
if (!empty($pconfig['interface'])) {
$form->addGlobal(new Form_Input('interface', null, 'hidden', $pconfig['interface']));
}
}
if ($if == "FloatingRules" || isset($pconfig['floating'])) {
$section->addInput($input = new Form_Select('interface', 'Interface', $pconfig['interface'], build_if_list(), true))->setHelp('Choose the interface(s) for this rule.');
} else {
$section->addInput($input = new Form_Select('interface', 'Interface', $pconfig['interface'], build_if_list()))->setHelp('Choose the interface from which packets must come to match this rule.');
}
if ($if == "FloatingRules" || isset($pconfig['floating'])) {
$section->addInput(new Form_Select('direction', 'Direction', $pconfig['direction'], array('any' => gettext('any'), 'in' => gettext('in'), 'out' => gettext('out'))));
$section->addInput(new Form_Input('floating', 'Floating', 'hidden', 'floating'));
}
$section->addInput(new Form_Select('ipprotocol', 'Address Family', $pconfig['ipprotocol'], array('inet' => 'IPv4', 'inet6' => 'IPv6', 'inet46' => 'IPv4+IPv6')))->setHelp('Select the Internet Protocol version this rule applies to.');
$section->addInput(new Form_Select('proto', 'Protocol', $pconfig['proto'], array('tcp' => 'TCP', 'udp' => 'UDP', 'tcp/udp' => 'TCP/UDP', 'icmp' => 'ICMP', 'esp' => 'ESP', 'ah' => 'AH', 'gre' => 'GRE', 'ipv6' => 'IPV6', 'igmp' => 'IGMP', 'pim' => 'PIM', 'ospf' => 'OSPF', 'sctp' => 'SCTP', 'any' => gettext('any'), 'carp' => 'CARP', 'pfsync' => 'PFSYNC')))->setHelp('Choose which IP protocol this rule should match.');
$section->addInput(new Form_Select('icmptype', 'ICMP type', $pconfig['icmptype'], $icmptypes))->setHelp('If ICMP is selected for the protocol above, an ICMP type may be specified here.');
$section->addInput(new Form_Select('icmp6type', 'ICMPv6 type', $pconfig['icmptype'], $icmp6types))->setHelp('If ICMP is selected for the protocol above, an ICMP type may be specified here.');
$form->add($section);
// Source and destination share a lot of logic. Loop over the two
// ToDo: Unfortunately they seem to differ more than they share. This needs to be unrolled
foreach (['src' => 'Source', 'dst' => 'Destination'] as $type => $name) {
$section = new Form_Section($name);
$group = new Form_Group($name);
示例6: print_info_box_np
if (is_subsystem_dirty('hosts')) {
print_info_box_np(gettext("The DNS forwarder configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect."));
}
$form = new Form();
$section = new Form_Section('General DNS Forwarder Options');
$section->addInput(new Form_Checkbox('enable', 'Enable', 'Enable DNS forwarder', $pconfig['enable']))->toggles('.toggle-dhcp', 'disable');
$section->addInput(new Form_Checkbox('regdhcp', 'DHCP Registration', 'Register DHCP leases in DNS forwarder', $pconfig['regdhcp']))->setHelp(sprintf("If this option is set, then machines that specify" . " their hostname when requesting a DHCP lease will be registered" . " in the DNS forwarder, so that their name can be resolved." . " You should also set the domain in %sSystem:" . " General setup%s to the proper value.", '<a href="system.php">', '</a>'))->addClass('toggle-dhcp');
$section->addInput(new Form_Checkbox('regdhcpstatic', 'Static DHCP', 'Register DHCP static mappings in DNS forwarder', $pconfig['regdhcpstatic']))->setHelp(sprintf("If this option is set, then DHCP static mappings will " . "be registered in the DNS forwarder, so that their name can be " . "resolved. You should also set the domain in %s" . "System: General setup%s to the proper value.", '<a href="system.php">', '</a>'))->addClass('toggle-dhcp');
$section->addInput(new Form_Checkbox('dhcpfirst', 'Prefer DHCP', 'Resolve DHCP mappings first', $pconfig['dhcpfirst']))->setHelp(sprintf("If this option is set, then DHCP mappings will " . "be resolved before the manual list of names below. This only " . "affects the name given for a reverse lookup (PTR)."))->addClass('toggle-dhcp');
$group = new Form_Group('DNS Query Forwarding');
$group->add(new Form_Checkbox('strict_order', 'DNS Query Forwarding', 'Query DNS servers sequentially', $pconfig['strict_order']))->setHelp(sprintf("If this option is set, %s DNS Forwarder (dnsmasq) will " . "query the DNS servers sequentially in the order specified (<i>System - General Setup - DNS Servers</i>), " . "rather than all at once in parallel. ", $g['product_name']));
$group->add(new Form_Checkbox('domain_needed', null, 'Require domain', $pconfig['domain_needed']))->setHelp(sprintf("If this option is set, %s DNS Forwarder (dnsmasq) will " . "not forward A or AAAA queries for plain names, without dots or domain parts, to upstream name servers.\t " . "If the name is not known from /etc/hosts or DHCP then a \"not found\" answer is returned. ", $g['product_name']));
$group->add(new Form_Checkbox('no_private_reverse', null, 'Do not forward private reverse lookups', $pconfig['no_private_reverse']))->setHelp(sprintf("If this option is set, %s DNS Forwarder (dnsmasq) will " . "not forward reverse DNS lookups (PTR) for private addresses (RFC 1918) to upstream name servers. " . "Any entries in the Domain Overrides section forwarding private \"n.n.n.in-addr.arpa\" names to a specific server are still forwarded. " . "If the IP to name is not known from /etc/hosts, DHCP or a specific domain override then a \"not found\" answer is immediately returned. ", $g['product_name']));
$section->add($group);
$section->addInput(new Form_Input('port', 'Listen Port', 'number', $pconfig['port'], ['placeholder' => '53']))->setHelp('The port used for responding to DNS queries. It should normally be left blank unless another service needs to bind to TCP/UDP port 53.');
$iflist = build_if_list();
$section->addInput(new Form_Select('interface', 'Interfaces', $iflist['selected'], $iflist['options'], true))->setHelp('Interface IPs used by the DNS Forwarder for responding to queries from clients. If an interface has both IPv4 and IPv6 IPs, both are used. Queries to other interface IPs not selected below are discarded. ' . 'The default behavior is to respond to queries on every available IPv4 and IPv6 address.');
$section->addInput(new Form_Checkbox('strictbind', 'Strict binding', 'Strict interface binding', $pconfig['strictbind']))->setHelp('If this option is set, the DNS forwarder will only bind to the interfaces containing the IP addresses selected above, ' . 'rather than binding to all interfaces and discarding queries to other addresses.' . '<br /><br />' . 'This option does NOT work with IPv6. If set, dnsmasq will not bind to IPv6 addresses.');
$section->addInput(new Form_Textarea('custom_options', 'Custom options', $pconfig['custom_options']))->setHelp('Enter any additional options you would like to add to the dnsmasq configuration here, separated by a space or newline')->addClass('advanced');
$form->add($section);
print $form;
print_info_box(sprintf("If the DNS forwarder is enabled, the DHCP" . " service (if enabled) will automatically serve the LAN IP" . " address as a DNS server to DHCP clients so they will use" . " the forwarder. The DNS forwarder will use the DNS servers" . " entered in %sSystem: General setup%s" . " or those obtained via DHCP or PPP on WAN if the "Allow" . " DNS server list to be overridden by DHCP/PPP on WAN"" . " is checked. If you don't use that option (or if you use" . " a static IP address on WAN), you must manually specify at" . " least one DNS server on the %sSystem:" . "General setup%s page.", '<a href="system.php">', '</a>', '<a href="system.php">', '</a>'), info);
?>
<div class="panel panel-default">
<div class="panel-heading"><h2 class="panel-title"><?php
echo gettext("Host Overrides");
?>
</h2></div>
<div class="panel-body table-responsive">
<table class="table table-striped table-hover table-condensed sortable-theme-bootstrap" data-sortable>
示例7: Form_Checkbox
$group->add(new Form_Checkbox('actpass', 'Pass', 'Pass', in_arrayi('Pass', $Include_Act)));
$group->add(new Form_Input('filterlogentries_time', null, 'text', $filterfieldsarray['time']))->setHelp('Time');
$group->add(new Form_Input('filterlogentries_sourceport', null, 'text', $filterfieldsarray['srcport']))->setHelp('Source Port');
$group->add(new Form_Input('filterlogentries_protocol', null, 'text', $filterfieldsarray['proto']))->setHelp('Protocol');
$group->add(new Form_Input('filterlogentries_qty', null, 'text', $filterlogentries_qty))->setHelp('Quantity');
$section->add($group);
$group = new Form_Group('');
$group->add(new Form_Checkbox('actblock', 'Block', 'Block', in_arrayi('Block', $Include_Act)));
$group->add(new Form_Input('filterlogentries_interfaces', null, 'text', $filterfieldsarray['interface']))->setHelp('Interface');
$group->add(new Form_Input('filterlogentries_destinationport', null, 'text', $filterfieldsarray['dstport']))->setHelp('Destination Port');
$group->add(new Form_Input('filterlogentries_protocolflags', null, 'text', $filterfieldsarray['tcpflags']))->setHelp('Protocol Flags');
} else {
// Simple log filter form
$form = new Form(new Form_Button('filtersubmit', 'Filter'));
$section = new Form_Section('Log Filter');
$section->addInput(new Form_Select('filterdescriptions', 'Where to show rule descriptions', $interfacefilter, build_if_list()));
$group = new Form_Group('');
$group->add(new Form_Input('filtertext', null, 'text', $filtertext))->setHelp('Filter Expression');
$group->add(new Form_Input('filterlogentries_qty', null, 'text', $filterlogentries_qty))->setHelp('Quantity');
}
$group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . 'Regular expression reference</a> Precede with exclamation (!) to exclude match.');
$section->add($group);
$form->add($section);
print $form;
// Now the forms are complete we can draw the log table and its controls
if (!isset($config['syslog']['rawfilter'])) {
$iflist = get_configured_interface_with_descr(false, true);
if ($iflist[$interfacefilter]) {
$interfacefilter = $iflist[$interfacefilter];
}
if ($filterlogentries_submit) {
示例8: Form_Input
$group->add(new Form_Input('filterlogentries_sourceport', null, 'text', $filterfieldsarray['srcport']))->setWidth(2)->setHelp('Source Port');
$group->add(new Form_Input('filterlogentries_protocol', null, 'text', $filterfieldsarray['proto']))->setWidth(2)->setHelp('Protocol');
$group->add(new Form_Input('filterlogentries_qty', null, 'number', $filterlogentries_qty, ['placeholder' => $nentries]))->setWidth(2)->setHelp('Quantity');
$section->add($group);
$group = new Form_Group('');
$group->add(new Form_Checkbox('actblock', null, 'Block', in_arrayi('Block', $Include_Act), 'Block'))->setWidth(1);
$group->add(new Form_Input('filterlogentries_interfaces', null, 'text', $filterfieldsarray['interface']))->setWidth(2)->setHelp('Interface');
$group->add(new Form_Input('filterlogentries_destinationport', null, 'text', $filterfieldsarray['dstport']))->setWidth(2)->setHelp('Destination Port');
$group->add(new Form_Input('filterlogentries_protocolflags', null, 'text', $filterfieldsarray['tcpflags']))->setWidth(2)->setHelp('Protocol Flags');
$btnsubmit = new Form_Button('filterlogentries_submit', ' ' . gettext('Apply Filter'), null, 'fa-filter');
} else {
// Simple log filter form
$form = new Form(false);
$section = new Form_Section('Log Filter', 'basic-filter-panel', COLLAPSIBLE | $filter_state);
$group = new Form_Group('');
$group->add(new Form_Select('interface', null, $interfacefilter, build_if_list()))->setWidth(2)->setHelp('Interface');
$group->add(new Form_Input('filterlogentries_qty', null, 'number', $filterlogentries_qty, ['placeholder' => $nentries]))->setWidth(2)->setHelp('Quantity');
$section->add($group);
$group = new Form_Group('');
$group->add(new Form_Input('filtertext', null, 'text', $filtertext))->setWidth(6)->setHelp('Filter Expression');
$btnsubmit = new Form_Button('filtersubmit', ' ' . gettext('Apply Filter'), null, 'fa-filter');
}
$btnsubmit->removeClass('btn-primary')->addClass('btn-success')->addClass('btn-sm');
$group->add(new Form_StaticText('', $btnsubmit));
$group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . gettext('Regular expression reference') . '</a> ' . gettext('Precede with exclamation (!) to exclude match.'));
$section->add($group);
$form->add($section);
print $form;
// Now the forms are complete we can draw the log table and its controls
if (!$rawfilter) {
$iflist = get_configured_interface_with_descr(false, true);
示例9: gettext
}
/* add ipsec interfaces */
if (ipsec_enabled() && have_ruleint_access("enc0")) {
$interfaces["enc0"] = gettext("IPsec");
}
/* add openvpn/tun interfaces */
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
$interfaces["openvpn"] = gettext("OpenVPN");
}
return $interfaces;
}
$pgtitle = array(gettext("Firewall"), gettext("NAT"), gettext("NPt"), gettext("Edit"));
include "head.inc";
if ($input_errors) {
print_input_errors($input_errors);
}
$form = new Form();
$section = new Form_Section('Edit NAT NPt Entry');
$section->addInput(new Form_Checkbox('disabled', 'Disabled', 'Disable this rule', $pconfig['disabled']));
$section->addInput(new Form_Select('interface', 'Interface', $pconfig['interface'], build_if_list()))->setHelp('Choose which interface this rule applies to.' . '<br />' . 'Hint: Typically the "WAN" is used here.');
$section->addInput(new Form_Checkbox('srcnot', 'Internal IPv6 prefix', 'Not', $pconfig['srcnot']))->setHelp('Use this option to invert the sense of the match. ');
$section->addInput(new Form_IpAddress('src', 'Address', $pconfig['src'], 'V6'))->addMask('srcmask', $pconfig['srcmask'])->setHelp('Internal (LAN) ULA IPv6 Prefix for the Network Prefix translation. ' . 'The prefix size specified for the internal IPv6 prefix will be applied to the external prefix.');
$section->addInput(new Form_Checkbox('dstnot', 'Destination IPv6 prefix', 'Not', $pconfig['dstnot']))->setHelp('Use this option to invert the sense of the match. ');
$section->addInput(new Form_IpAddress('dst', 'Address', $pconfig['dst'], 'V6'))->addMask('dstmask', $pconfig['dstmask'])->setHelp('Global Unicast routable IPv6 prefix');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('A description may be entered here for administrative reference (not parsed).');
if (isset($id) && $a_npt[$id]) {
$section->addInput(new Form_Input('id', null, 'hidden', $id));
}
$form->add($section);
print $form;
include "foot.inc";
示例10: Form_Checkbox
$group->add(new Form_Checkbox('actpass', 'Pass', 'Pass', in_arrayi('Pass', $Include_Act), 'Pass'));
$group->add(new Form_Input('filterlogentries_time', null, 'text', $filterfieldsarray['time']))->setHelp('Time');
$group->add(new Form_Input('filterlogentries_sourceport', null, 'text', $filterfieldsarray['srcport']))->setHelp('Source Port');
$group->add(new Form_Input('filterlogentries_protocol', null, 'text', $filterfieldsarray['proto']))->setHelp('Protocol');
$group->add(new Form_Input('filterlogentries_qty', null, 'text', $filterlogentries_qty))->setHelp('Quantity');
$section->add($group);
$group = new Form_Group('');
$group->add(new Form_Checkbox('actblock', 'Block', 'Block', in_arrayi('Block', $Include_Act), 'Block'));
$group->add(new Form_Input('filterlogentries_interfaces', null, 'text', $filterfieldsarray['interface']))->setHelp('Interface');
$group->add(new Form_Input('filterlogentries_destinationport', null, 'text', $filterfieldsarray['dstport']))->setHelp('Destination Port');
$group->add(new Form_Input('filterlogentries_protocolflags', null, 'text', $filterfieldsarray['tcpflags']))->setHelp('Protocol Flags');
} else {
// Simple log filter form
$form = new Form(new Form_Button('filtersubmit', 'Filter'));
$section = new Form_Section('Log Filter');
$section->addInput(new Form_Select('interface', 'Interface', $interfacefilter, build_if_list()));
$group = new Form_Group('');
$group->add(new Form_Input('filtertext', null, 'text', $filtertext))->setHelp('Filter Expression');
$group->add(new Form_Input('filterlogentries_qty', null, 'text', $filterlogentries_qty))->setHelp('Quantity');
}
$group->setHelp('<a target="_blank" href="http://www.php.net/manual/en/book.pcre.php">' . 'Regular expression reference</a> Precede with exclamation (!) to exclude match.');
$section->add($group);
$form->add($section);
print $form;
// Now the forms are complete we can draw the log table and its controls
if (!isset($config['syslog']['rawfilter'])) {
$iflist = get_configured_interface_with_descr(false, true);
if ($iflist[$interfacefilter]) {
$interfacefilter = $iflist[$interfacefilter];
}
if ($filterlogentries_submit) {