Exemplo n.º 1
0
if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) {
    $interfaces["openvpn"] = "OpenVPN";
}
$section->addInput(new Form_Select('interface', 'Interface', $pconfig['interface'], $interfaces))->setHelp('Choose which interface this rule applies to. In most cases "WAN" is specified.');
$section->addInput(new Form_IpAddress('external', 'External subnet IP', $pconfig['external']))->setHelp('Enter the external (usually on a WAN) subnet\'s starting address for the 1:1 mapping. ' . 'The subnet mask from the internal address below will be applied to this IP address.');
$group = new Form_Group('Internal IP');
$group->add(new Form_Checkbox('srcnot', null, 'Not', $pconfig['srcnot']))->setHelp('Invert the sense of the match.');
$group->add(new Form_Select('srctype', null, srctype_selected(), build_srctype_list()))->setHelp('Type');
$group->add(new Form_IpAddress('src', null, is_specialnet($pconfig['src']) ? '' : $pconfig['src']))->addMask('srcmask', $pconfig['srcmask'], 31)->setHelp('Address/mask')->setPattern('[0-9, a-z, A-Z and .');
$group->setHelp('Enter the internal (LAN) subnet for the 1:1 mapping. ' . 'The subnet size specified for the internal subnet will be applied to the external subnet.');
$section->add($group);
$group = new Form_Group('Destination');
$group->add(new Form_Checkbox('dstnot', null, 'Not', $pconfig['dstnot']))->setHelp('Invert the sense of the match.');
$group->add(new Form_Select('dsttype', null, dsttype_selected(), build_dsttype_list()))->setHelp('Type');
$group->add(new Form_IpAddress('dst', null, is_specialnet($pconfig['dst']) ? '' : $pconfig['dst']))->addMask('dstmask', $pconfig['dstmask'], 31)->setHelp('Address/mask')->setPattern('[0-9, a-z, A-Z and .');
$group->setHelp('The 1:1 mapping will only be used for connections to or from the specified destination. Hint: this is usually "Any".');
$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).');
$section->addInput(new Form_Select('natreflection', 'NAT reflection', $pconfig['natreflection'], array('default' => 'Use system default', 'enable' => 'Enable', 'disable' => 'Disable')));
$form->add($section);
print $form;
?>

<script type="text/javascript">
//<![CDATA[
events.push(function() {

	// Disables the specified input element
	function disableInput(id, disable) {
		$('#' + id).prop("disabled", disable);
	}
Exemplo n.º 2
0
        $csslist[$file] = pathinfo($file, PATHINFO_FILENAME);
    }
}
if (!isset($pconfig['webguicss']) || !isset($csslist[$pconfig['webguicss']])) {
    $pconfig['webguicss'] = "pfSense.css";
}
$section = new Form_Section('webConfigurator');
$section->addInput(new Form_Select('webguicss', 'Theme', $pconfig['webguicss'], $csslist))->setHelp(sprintf(gettext('Choose an alternative css file (if installed) to change the appearance of the webConfigurator. css files are located in /usr/local/www/css/%s'), '<span id="csstxt"></span>'));
$section->addInput(new Form_Select('webguifixedmenu', 'Top Navigation', $pconfig['webguifixedmenu'], ["" => gettext("Scrolls with page"), "fixed" => gettext("Fixed (Remains visible at top of page)")]))->setHelp("The fixed option is intended for large screens only.");
$section->addInput(new Form_Input('dashboardcolumns', 'Dashboard Columns', 'number', $pconfig['dashboardcolumns'], [min => 1, max => 4]));
$group = new Form_Group('Associated Panels Show/Hide');
$group->add(new Form_Checkbox('dashboardavailablewidgetspanel', null, 'Available Widgets', $pconfig['dashboardavailablewidgetspanel']))->setHelp('Show the Available Widgets panel on the Dashboard.');
$group->add(new Form_Checkbox('systemlogsfilterpanel', null, 'Log Filter', $pconfig['systemlogsfilterpanel']))->setHelp('Show the Log Filter panel in System Logs.');
$group->add(new Form_Checkbox('systemlogsmanagelogpanel', null, 'Manage Log', $pconfig['systemlogsmanagelogpanel']))->setHelp('Show the Manage Log panel in System Logs.');
$group->add(new Form_Checkbox('statusmonitoringsettingspanel', null, 'Monitoring Settings', $pconfig['statusmonitoringsettingspanel']))->setHelp('Show the Settings panel in Status Monitoring.');
$group->setHelp('These options allow certain panels to be automatically hidden on page load. A control is provided in the title bar to un-hide the panel.');
$section->add($group);
$section->addInput(new Form_Checkbox('webguileftcolumnhyper', 'Left Column Labels', 'Active', $pconfig['webguileftcolumnhyper']))->setHelp('If selected, clicking a label in the left column will select/toggle the first item of the group.');
$form->add($section);
print $form;
$csswarning = sprintf(gettext("%sUser-created themes are unsupported, use at your own risk."), "<br />");
?>
</div>

<script>
//<![CDATA[
events.push(function() {

	function setThemeWarning() {
		if ($('#webguicss').val().startsWith("pfSense")) {
			$('#csstxt').html("").addClass("text-default");
Exemplo n.º 3
0
     }
 }
 $section->addInput(new Form_Select('channel', 'Channel', $pconfig['channel'], $mode_list))->setHelp('Legend: wireless standards - channel # (frequency @ max TX power / TX power allowed in reg. domain)' . '<br />' . 'Not all channels may be supported by your card.  Auto may override the wireless standard selected above.');
 if (ANTENNAS) {
     if (isset($wl_sysctl["{$wl_sysctl_prefix}.diversity"]) || isset($wl_sysctl["{$wl_sysctl_prefix}.txantenna"]) || isset($wl_sysctl["{$wl_sysctl_prefix}.rxantenna"])) {
         $group = new Form_Group('Antenna Settings');
         if (isset($wl_sysctl["{$wl_sysctl_prefix}.diversity"])) {
             $group->add(new Form_Select('diversity', null, isset($pconfig['diversity']) ? $pconfig['diversity'] : '', ['' => 'Default', '0' => 'Off', '1' => 'On']))->setHelp('Diversity');
         }
         if (isset($wl_sysctl["{$wl_sysctl_prefix}.txantenna"])) {
             $group->add(new Form_Select('txantenna', null, isset($pconfig['txantenna']) ? $pconfig['txantenna'] : '', ['' => 'Default', '0' => 'Auto', '1' => '#1', '2' => '#2']))->setHelp('Transmit antenna');
         }
         if (isset($wl_sysctl["{$wl_sysctl_prefix}.rxantenna"])) {
             $group->add(new Form_Select('rxantenna', null, isset($pconfig['rxantenna']) ? $pconfig['rxantenna'] : '', ['' => 'Default', '0' => 'Auto', '1' => '#1', '2' => '#2']))->setHelp('Receive antenna');
         }
         $group->setHelp('Note: The antenna numbers do not always match up with the labels on the card.');
         $section->add($group);
     }
 }
 if (isset($wl_sysctl["{$wl_sysctl_prefix}.slottime"]) && isset($wl_sysctl["{$wl_sysctl_prefix}.acktimeout"]) && isset($wl_sysctl["{$wl_sysctl_prefix}.ctstimeout"])) {
     $section->addInput(new Form_Input('distance', 'Distance setting (meters)', 'test', $pconfig['distance']))->setHelp('This field can be used to tune ACK/CTS timers to fit the distance between AP and Client');
 }
 $form->add($section);
 // Regulatory settings
 $section = new Form_Section('Regulatory settings');
 $domain_list = array("" => 'Default');
 if (is_array($wl_regdomains)) {
     foreach ($wl_regdomains as $wl_regdomain_key => $wl_regdomain) {
         $domain_list[$wl_regdomains_attr[$wl_regdomain_key]['ID']] = $wl_regdomain['name'];
     }
 }
Exemplo n.º 4
0
    foreach ($config['system']['user'] as $user) {
        if (is_array($pconfig['members']) && in_array($user['uid'], $pconfig['members'])) {
            $usersGroups[$user['uid']] = $user['name'];
            // Add it to the user's list
        } else {
            $systemGroups[$user['uid']] = $user['name'];
            // Add it to the 'not a member of' list
        }
    }
    $group->add(new Form_Select('notmembers', null, array_combine((array) $pconfig['groups'], (array) $pconfig['groups']), $systemGroups, true))->setHelp('Not members');
    $group->add(new Form_Select('members', null, array_combine((array) $pconfig['groups'], (array) $pconfig['groups']), $usersGroups, true))->setHelp('Members');
    $section->add($group);
    $group = new Form_Group('');
    $group->add(new Form_Button('movetoenabled', 'Move to "Members" >'))->removeClass('btn-primary')->addClass('btn-default btn-sm');
    $group->add(new Form_Button('movetodisabled', '< Move to "Not members'))->removeClass('btn-primary')->addClass('btn-default btn-sm');
    $group->setHelp('Hold down CTRL (pc)/COMMAND (mac) key to select multiple items');
    $section->add($group);
}
if ($_GET['act'] != "new") {
    $section = new Form_Section('Assigned Privileges');
    $section->addInput(new Form_StaticText(null, build_priv_table()));
    $form->add($section);
}
print $form;
?>
<script type="text/javascript">
//<![CDATA[
events.push(function() {

	// Select every option in the specified multiselect
	function AllServers(id, selectAll) {
$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
display_top_tabs($tab_array);
?>
<div id="container"><?php 
$form = new Form();
$section = new Form_Section('Firewall Advanced');
$section->addInput(new Form_Checkbox('scrubnodf', 'IP Do-Not-Fragment compatibility', 'Clear invalid DF bits instead of dropping the packets', isset($config['system']['scrubnodf'])))->setHelp('This allows for communications with hosts that generate fragmented ' . 'packets with the don\'t fragment (DF) bit set. Linux NFS is known to do this. ' . 'This will cause the filter to not drop such packets but instead clear the don\'t ' . 'fragment bit.');
$section->addInput(new Form_Checkbox('scrubrnid', 'IP Random id generation', 'Insert a stronger ID into IP header of packets passing through the filter.', isset($config['system']['scrubrnid'])))->setHelp('Replaces the IP identification field of packets with random values to ' . 'compensate for operating systems that use predictable values. This option only ' . 'applies to packets that are not fragmented after the optional packet ' . 'reassembly.');
$section->addInput($input = new Form_Select('optimization', 'Firewall Optimization Options', $config['system']['optimization'], array('normal' => 'Normal', 'high-latency' => gettext('High-latency'), 'aggressive' => gettext('Aggressive'), 'conservative' => gettext('Conservative'))))->setHelp('Select the type of state table optimization to use');
$section->addInput(new Form_Checkbox('disablefilter', 'Disable Firewall', 'Disable all packet filtering.', isset($config['system']['disablefilter'])))->setHelp('Note: This converts %s into a routing only platform!<br/>' . 'Note: This will also turn off NAT! To only disable NAT, ' . 'and not firewall rules, visit the <a href="firewall_nat_out.php">Outbound ' . 'NAT</a> page.', [$g["product_name"]]);
$section->addInput(new Form_Checkbox('disablescrub', 'Disable Firewall Scrub', 'Disables the PF scrubbing option which can sometimes interfere with NFS traffic.', isset($config['system']['disablescrub'])));
$group = new Form_Group('Firewall Adaptive Timeouts');
$group->add(new Form_Input('adaptivestart', 'Adaptive start', 'number', $pconfig['adaptivestart'], ['min' => 1]))->setHelp('When the number of state entries exceeds this value, adaptive ' . 'scaling begins.  All timeout values are scaled linearly with factor ' . '(adaptive.end - number of states) / (adaptive.end - adaptive.start).');
$group->add(new Form_Input('adaptiveend', 'Adaptive end', 'number', $pconfig['adaptiveend'], ['min' => 1]))->setHelp('When reaching this number of state entries, all timeout values ' . 'become zero, effectively purging all state entries immediately.  This ' . 'value is used to define the scale factor, it should not actually be ' . 'reached (set a lower state limit, see below).');
$group->setHelp('Timeouts for states can be scaled adaptively as the number of ' . 'state table entries grows. Leave blank for the default (0)');
$section->add($group);
$section->addInput(new Form_Input('maximumstates', 'Firewall Maximum States', 'number', $pconfig['maximumstates'], ['min' => 1, 'placeholder' => pfsense_default_state_size()]))->setHelp('Maximum number of connections to hold in the firewall state table. ' . '<br/>Note: Leave this blank for the default. On this system the default ' . 'size is: %d', [pfsense_default_state_size()]);
$section->addInput(new Form_Input('maximumtableentries', 'Firewall Maximum Table Entries', 'text', $pconfig['maximumtableentries'], ['placeholder' => pfsense_default_table_entries_size()]))->setHelp('Maximum number of table entries for systems such as aliases, ' . 'sshlockout, snort, etc, combined.<br/>Note: Leave this blank for the ' . 'default. On this system the default size is: %d', [pfsense_default_table_entries_size()]);
$section->addInput(new Form_Input('maximumfrags', 'Firewall Maximum Fragment Entries', 'text', $pconfig['maximumfrags']))->setHelp('Maximum number of packet fragments to hold for reassembly by scrub rules. Leave this blank for the default (5000)');
$section->addInput(new Form_Checkbox('bypassstaticroutes', 'Static route filtering', 'Bypass firewall rules for traffic on the same interface', $pconfig['bypassstaticroutes']))->setHelp('This option only applies if one or more static routes have been defined. ' . 'If it is enabled, traffic that enters and leaves through the same ' . 'interface will not be checked by the firewall. This may be desirable in some ' . 'situations where multiple subnets are connected to the same interface.');
$section->addInput(new Form_Checkbox('disablevpnrules', 'Disable Auto-added VPN rules', 'Disable all auto-added VPN rules.', isset($config['system']['disablevpnrules'])))->setHelp('Note: This disables automatically added rules for IPsec.');
$section->addInput(new Form_Checkbox('disablereplyto', 'Disable reply-to', 'Disable reply-to on WAN rules', $pconfig['disablereplyto']))->setHelp('With Multi-WAN it is generally desired to ensure traffic leaves the same ' . 'interface it arrives on, hence reply-to is added automatically by default. When ' . 'using bridging, this behavior must be disabled if the WAN gateway IP is ' . 'different from the gateway IP of the hosts behind the bridged interface.');
$section->addInput(new Form_Checkbox('disablenegate', 'Disable Negate rules', 'Disable Negate rule on policy routing rules', $pconfig['disablenegate']))->setHelp('With Multi-WAN it is generally desired to ensure traffic reaches directly ' . 'connected networks and VPN networks when using policy routing. This can be disabled ' . 'for special purposes but it requires manually creating rules for these networks.');
$section->addInput(new Form_Input('aliasesresolveinterval', 'Aliases Hostnames Resolve Interval', 'text', $pconfig['aliasesresolveinterval'], ['placeholder' => '300']))->setHelp('Interval, in seconds, that will be used to resolve hostnames ' . 'configured on aliases. <br/>Note:	 Leave this blank for the default ' . '(300s).');
$section->addInput(new Form_Checkbox('checkaliasesurlcert', 'Check certificate of aliases URLs', 'Verify HTTPS certificates when downloading alias URLs', $pconfig['checkaliasesurlcert']))->setHelp('Make sure the certificate is valid for all HTTPS addresses on ' . 'aliases. If it\'s not valid or is revoked, do not download it.');
$form->add($section);
$section = new Form_Section('Bogon Networks');
$section->addInput(new Form_Select('bogonsinterval', 'Update Frequency', empty($pconfig['bogonsinterval']) ? 'monthly' : $pconfig['bogonsinterval'], array('monthly' => gettext('Monthly'), 'weekly' => gettext('Weekly'), 'daily' => gettext('Daily'))))->setHelp('The frequency of updating the lists of IP addresses that are ' . 'reserved (but not RFC 1918) or not yet assigned by IANA.');
$form->add($section);
if (count($config['interfaces']) > 1) {
Exemplo n.º 6
0
$group->add(new Form_Select('period', 'Period', $curperiod, $periods))->setHelp('Period');
if ($curcat == 'custom') {
    $group->setHelp('Any changes to these option may not take affect until the next auto-refresh.');
}
$section->add($group);
if ($curcat == 'custom') {
    $section->addInput(new Form_Input('cat', null, 'hidden', 'custom'));
    $tz = date_default_timezone_get();
    $tz_msg = gettext("Enter date and/or time. Current timezone:") . " {$tz}";
    $start_fmt = strftime("%m/%d/%Y %H:%M:%S", $start);
    $end_fmt = strftime("%m/%d/%Y %H:%M:%S", $end);
    $group = new Form_Group('');
    $group->add(new Form_Input('start', 'Start', 'datetime', $start_fmt))->setHelp('Start');
    $group->add(new Form_Input('end', 'End', 'datetime', $end_fmt))->setHelp('End');
    if ($curcat != 'custom') {
        $group->setHelp('Any changes to these option may not take affect until the next auto-refresh');
    }
    $section->add($group);
    $form->add($section);
    print $form;
    $curdatabase = $curoption;
    $graph = "custom-{$curdatabase}";
    if (in_array($curdatabase, $custom_databases)) {
        $id = "{$graph}-{$curoption}-{$curdatabase}";
        $id = preg_replace('/\\./', '_', $id);
        ?>
		<div class="panel panel-default">
			<img align="center" name="<?php 
        echo $id;
        ?>
" id="<?php 
Exemplo n.º 7
0
    if ($multiwan) {
        $options = array('none' => 'none');
        foreach ($arr_gateways as $gwname => $gwitem) {
            if (is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && is_ipaddrv6($gwitem['gateway'])) {
                continue;
            }
            if (is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && is_ipaddrv4($gwitem['gateway'])) {
                continue;
            }
            $options[$gwname] = $gwname . ' - ' . $gwitem['friendlyiface'] . ' - ' . $gwitem['gateway'];
        }
        $group->add(new Form_Select('dns' . $i . 'gw', null, $pconfig['dns' . $i . 'gw'], $options))->setHelp($i == 4 ? 'Gateway' : null);
        $help .= '<br/>' . "In addition, optionally select the gateway for each DNS server. " . "When using multiple WAN connections there should be at least one unique DNS server per gateway.";
    }
    if ($i == 4) {
        $group->setHelp($help);
    }
    $section->add($group);
}
$section->addInput(new Form_Checkbox('dnsallowoverride', 'DNS server override', 'Allow DNS server list to be overridden by DHCP/PPP on WAN', $pconfig['dnsallowoverride']))->setHelp(sprintf(gettext('If this option is set, %s will use DNS servers' . 'assigned by a DHCP/PPP server on WAN for its own purposes (including ' . 'the DNS forwarder). However, they will not be assigned to DHCP and PPTP ' . 'VPN clients.'), $g['product_name']));
$section->addInput(new Form_Checkbox('dnslocalhost', 'Disable DNS forwarder', 'Do not use the DNS Forwarder as a DNS server for the firewall', $pconfig['dnslocalhost']))->setHelp('By default localhost (127.0.0.1) will be used as the first DNS' . 'server where the DNS Forwarder or DNS Resolver is enabled and set to ' . 'listen on Localhost, so system can use the local DNS service to perform' . 'lookups. Checking this box omits localhost from the list of DNS servers.');
$form->add($section);
$section = new Form_Section('Localization');
$section->addInput(new Form_Select('timezone', 'Timezone', $pconfig['timezone'], array_combine($timezonelist, $timezonelist)))->setHelp('Select the location closest to you');
$section->addInput(new Form_Input('timeservers', 'Timeservers', 'text', $pconfig['timeservers']))->setHelp('Use a space to separate multiple hosts (only one required). ' . 'Remember to set up at least one DNS server if you enter a host name here!');
$section->addInput(new Form_Select('language', 'Language', $pconfig['language'], get_locale_list()))->setHelp('Choose a language for the webConfigurator');
$form->add($section);
$csslist = array();
$css = glob("/usr/local/www/bootstrap/css/*.css");
foreach ($css as $file) {
    $file = basename($file);
Exemplo n.º 8
0
$group->add($f2);
$section->add($group);
$f1 = new Form_Input('prefix_from', null, 'text', $pconfig['prefix_from']);
$f1->setHelp('To');
$f2 = new Form_Input('prefix_to', null, 'text', $pconfig['prefix_to']);
$f2->setHelp('From');
$group = new Form_Group('Prefix Delegation Range');
$group->add($f1);
$group->add($f2);
$section->add($group);
$section->addInput(new Form_Select('prefixrange_length', 'Prefix Delegation Size', $pconfig['prefixrange_length'], array('48' => '48', '52' => '52', '56' => '56', '60' => '60', '62' => '62', '63' => '63', '64' => '64')))->setHelp('You can define a Prefix range here for DHCP Prefix Delegation. This allows for assigning networks to subrouters. The start and end of the range must end on boundaries of the prefix delegation size.');
$group = new Form_Group('DNS Servers');
for ($i = 1; $i <= 4; $i++) {
    $group->add(new Form_input('dns' . $i, null, 'text', $pconfig['dns' . $i]))->setHelp('DNS ' . $i);
}
$group->setHelp('Leave blank to use the system default DNS servers,this interface\'s IP if DNS forwarder is enabled, or the servers configured on the "General" page.');
$section->add($group);
$section->addInput(new Form_Input('domain', 'Domain Name', 'text', $pconfig['domain']))->setHelp('The default is to use the domain name of this system as the default domain name provided by DHCP. You may specify an alternate domain name here. ');
$section->addInput(new Form_Input('domainsearchlist', 'Domain search list', 'text', $pconfig['domainsearchlist']))->setHelp('The DHCP server can optionally provide a domain search list. Use the semicolon character as separator');
$section->addInput(new Form_Input('deftime', 'Default lease time', 'text', $pconfig['deftime']))->setHelp('Seconds . Used for clients that do not ask for a specific expiration time. ' . ' <br />' . 'The default is 7200 seconds.');
$section->addInput(new Form_Input('maxtime', 'Max lease time', 'text', $pconfig['maxtime']))->setHelp('Maximum lease time for clients that ask for a specific expiration time.' . ' <br />' . 'The default is 86400 seconds.');
$section->addInput(new Form_Checkbox('dhcpv6leaseinlocaltime', 'Time Format Change', 'Change DHCPv6 display lease time from UTC to local time', $pconfig['dhcpv6leaseinlocaltime']))->setHelp('By default DHCPv6 leases are displayed in UTC time. ' . 'By checking this box DHCPv6 lease time will be displayed in local time and set to time zone selected. ' . 'This will be used for all DHCPv6 interfaces lease time.');
$btndyndns = new Form_Button('btndyndns', 'Advanced');
$btndyndns->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText('Dynamic DNS', $btndyndns . '&nbsp;' . 'Show dynamic DNS settings'));
$section->addInput(new Form_Checkbox('ddnsupdate', 'DHCP Registration', 'Enable registration of DHCP client names in DNS.', $pconfig['ddnsupdate']));
$section->addInput(new Form_Input('ddnsdomain', 'DDNS Domain', 'text', $pconfig['ddnsdomain']))->setHelp('Leave blank to disable dynamic DNS registration. Enter the dynamic DNS domain which will be used to register client names in the DNS server.');
$section->addInput(new Form_IpAddress('ddnsdomainprimary', 'DDNS Server IP', $pconfig['ddnsdomainprimary']))->setHelp('Enter the primary domain name server IP address for the dynamic domain name.');
$section->addInput(new Form_Input('ddnsdomainkeyname', 'DDNS Domain Key name', 'text', $pconfig['ddnsdomainkeyname']))->setHelp('Enter the dynamic DNS domain key name which will be used to register client names in the DNS server.');
$section->addInput(new Form_Input('ddnsdomainkey', 'DDNS Domain Key secret', 'text', $pconfig['ddnsdomainkey']))->setHelp('Enter the dynamic DNS domain key secret which will be used to register client names in the DNS server.');
$btnntp = new Form_Button('btnntp', 'Advanced');
Exemplo n.º 9
0
 $section->add($group);
 $section->addInput(new Form_Select('device', 'Device: /dev/', false, array_combine($devs, $devs)));
 $section->addInput(new Form_StaticText('', $btnview));
 $form->add($section);
 print $form;
 // Tests
 $form = new Form(false);
 $btntest = new Form_Button('submit', 'Test');
 $section = new Form_Section('Perform self-tests');
 $section->addInput(new Form_Input('action', null, 'hidden', 'test'));
 $group = new Form_Group('Test type');
 $group->add(new Form_Checkbox('testType', null, 'Offline', false, 'offline'))->displayAsRadio();
 $group->add(new Form_Checkbox('testType', null, 'Short', true, 'short'))->displayAsRadio();
 $group->add(new Form_Checkbox('testType', null, 'Long', false, 'long'))->displayAsRadio();
 $group->add(new Form_Checkbox('testType', null, 'Conveyance', false, 'conveyance'))->displayAsRadio();
 $group->setHelp('Select "Conveyance" for ATA disks only');
 $section->add($group);
 $section->addInput(new Form_Select('device', 'Device: /dev/', false, array_combine($devs, $devs)));
 $section->addInput(new Form_StaticText('', $btntest));
 $form->add($section);
 print $form;
 // Logs
 $form = new Form(false);
 $btnview = new Form_Button('submit', 'View');
 $section = new Form_Section('View Logs');
 $section->addInput(new Form_Input('action', null, 'hidden', 'logs'));
 $group = new Form_Group('Log type');
 $group->add(new Form_Checkbox('type', null, 'Error', true, 'error'))->displayAsRadio();
 $group->add(new Form_Checkbox('type', null, 'Self-test', false, 'selftest'))->displayAsRadio();
 $section->add($group);
 $section->addInput(new Form_Select('device', 'Device: /dev/', false, array_combine($devs, $devs)));
Exemplo n.º 10
0
$group->setHelp('Low and high thresholds for latency in milliseconds.
	Default is %d/%d.', [$apinger_default['latencylow'], $apinger_default['latencyhigh']]);
$section->add($group);
$group = new Form_Group('Packet Loss thresholds');
$group->add(new Form_Input('losslow', 'From', 'number', $pconfig['losslow'], ['placeholder' => $apinger_default['losslow']]));
$group->add(new Form_Input('losshigh', 'To', 'number', $pconfig['losshigh'], ['placeholder' => $apinger_default['losshigh']]));
$group->setHelp('Low and high thresholds for packet loss in milliseconds.
	Default is %d/%d.', [$apinger_default['losslow'], $apinger_default['losshigh']]);
$section->add($group);
$section->addInput(new Form_Input('interval', 'Probe Interval', 'number', $pconfig['interval'], ['placeholder' => $apinger_default['interval'], 'max' => 86400]))->setHelp('How often an ICMP probe will be sent in seconds. Default is %d.' . 'NOTE: The quality graph is averaged over seconds, not intervals, so as ' . 'the probe interval is increased the accuracy of the quality graph is ' . 'decreased.', [$apinger_default['interval']]);
$section->addInput(new Form_Input('down', 'Down', 'number', $pconfig['down'], ['placeholder' => $apinger_default['down']]))->setHelp('The number of seconds of failed probes before the alarm ' . 'will fire. Default is %d.', [$apinger_default['down']]);
$group = new Form_Group('Avg. Delay Replies Qty');
$group->add(new Form_Input('avg_delay_samples', null, 'number', $pconfig['avg_delay_samples'], ['placeholder' => $apinger_default['avg_delay_samples'], 'max' => 100]));
$group->add(new Form_Checkbox('avg_delay_samples_calculated', null, 'Use calculated value.', $pconfig['avg_delay_samples_calculated']));
$group->setHelp('How many replies should be used to compute average delay for ' . 'controlling "delay" alarms? Default is %d.', [$apinger_default['avg_delay_samples']]);
$section->add($group);
$group = new Form_Group('Avg. Packet Loss Probes');
$group->add(new Form_Input('avg_loss_samples', null, 'number', $pconfig['avg_loss_samples'], ['placeholder' => $apinger_default['avg_loss_samples'], 'max' => 1000]));
$group->add(new Form_Checkbox('avg_loss_samples_calculated', null, 'Use calculated value.', $pconfig['avg_loss_samples_calculated']));
$group->setHelp('How many probes should be useds to compute average packet loss? ' . 'Default is %d.', [$apinger_default['avg_loss_samples']]);
$section->add($group);
$group = new Form_Group('Lost Probe Delay');
$group->add(new Form_Input('avg_loss_delay_samples', null, 'number', $pconfig['avg_loss_delay_samples'], ['placeholder' => $apinger_default['avg_loss_delay_samples'], 'max' => 200]));
$group->add(new Form_Checkbox('avg_loss_delay_samples_calculated', null, 'Use calculated value.', $pconfig['avg_loss_samples_calculated']));
$group->setHelp('The delay (in qty of probe samples) after which loss is ' . 'computed. Without this, delays longer than the probe interval would be ' . 'treated as packet loss.  Default is %d.', [$apinger_default['avg_loss_delay_samples']]);
$section->add($group);
$section->addInput(new Form_StaticText('Additional information', '<span class="help-block">' . gettext('The probe interval must be less than the down time, otherwise the ' . 'gateway will seem to go down then come up again at the next probe.') . '<br/><br/>' . gettext('The down time defines the length of time before the gateway is marked ' . 'as down, but the accuracy is controlled by the probe interval. For example, ' . 'if your down time is 40 seconds but on a 30 second probe interval, only one ' . 'probe would have to fail before the gateway is marked down at the 40 second ' . 'mark. By default, the gateway is considered down after 10 seconds, and the ' . 'probe interval is 1 second, so 10 probes would have to fail before the gateway ' . 'is marked down.') . '</span>'));
$section->addInput(new Form_Checkbox('nonlocalgateway', 'Use non-local gateway', 'Use non-local gateway through interface specific route.', $pconfig['nonlocalgateway']))->setHelp('This will allow use of a gateway outside of this interface\'s subnet. This is usually indicative of a configuration error, but is required for some scenarios.');
$form->add($section);
print $form;
include "foot.inc";
Exemplo n.º 11
0
$section->add($group);
$group = new Form_Group('GUI Log Entries');
# Use the general logging options setting (global) as placeholder.
$group->add(new Form_Input('nentries', 'GUI Log Entries', 'number', $pconfig['nentries'], ['placeholder' => $config['syslog']['nentries']]))->setWidth(2);
$group->setHelp('This is the number of log entries displayed in the GUI. It does not affect how many entries are contained in the log.');
$section->add($group);
$group = new Form_Group('Log file size (Bytes)');
# Use the general logging options setting (global) as placeholder.
$group->add(new Form_Input('logfilesize', 'Log file size (Bytes)', 'number', $pconfig['logfilesize'], ['placeholder' => $config['syslog']['logfilesize'] ? $config['syslog']['logfilesize'] : "511488"]))->setWidth(2);
$group->setHelp("The log is held in a constant-size circular log file. This field controls how large the log file is, and thus how many entries may exist inside the log. The default is approximately 500KB." . '<br /><br />' . "NOTE: The log size is changed the next time it is cleared. To immediately change the log size, first save the options to set the size, then clear the log using the \"Clear Log\" action below. ");
$section->add($group);
$group = new Form_Group('Formatted/Raw Display');
$group->add(new Form_Checkbox('format', null, 'Formatted', $pconfig['format'] == 'formatted' ? true : false, 'formatted'))->displayAsRadio();
$group->add(new Form_Checkbox('format', null, 'Raw', $pconfig['format'] == 'raw' ? true : false, 'raw'))->displayAsRadio();
$group->add(new Form_Checkbox('format', null, 'General Logging Options Setting', $pconfig['format'] == '' ? true : false, ''))->displayAsRadio();
$group->setHelp('Show the log entries as formatted or raw output as generated by the service. The raw output will reveal more detailed information, but it is more difficult to read.');
$section->add($group);
# System General (main) Specific
if ($logfile == 'system') {
    $section->addInput(new Form_Checkbox('loglighttpd', 'Web Server Log', 'Log errors from the web server process', $pconfig['loglighttpd']))->setHelp('If this is checked, errors from the lighttpd web server process for the GUI or Captive Portal will appear in the system log.');
}
# Firewall Specific
if ($logfile == 'filter') {
    $section->addInput(new Form_Checkbox('logdefaultblock', 'Log firewall default blocks', 'Log packets matched from the default block rules in the ruleset', $pconfig['logdefaultblock']))->setHelp('Packets that are blocked by the implicit default block rule will not be logged if this option is unchecked. Per-rule logging options are still respected.');
    $section->addInput(new Form_Checkbox('logdefaultpass', null, 'Log packets matched from the default pass rules put in the ruleset', $pconfig['logdefaultpass']))->setHelp('Packets that are allowed by the implicit default pass rule will be logged if this option is checked. Per-rule logging options are still respected. ');
    $section->addInput(new Form_Checkbox('logbogons', null, 'Log packets blocked by \'Block Bogon Networks\' rules', $pconfig['logbogons']));
    $section->addInput(new Form_Checkbox('logprivatenets', null, 'Log packets blocked by \'Block Private Networks\' rules', $pconfig['logprivatenets']));
    $section->addInput(new Form_Select('filterdescriptions', 'Where to show rule descriptions', !isset($pconfig['filterdescriptions']) ? '0' : $pconfig['filterdescriptions'], array('0' => 'Dont load descriptions', '1' => 'Display as column', '2' => 'Display as second row')))->setHelp('Show the applied rule description below or in the firewall log rows' . '<br />' . 'Displaying rule descriptions for all lines in the log might affect performance with large rule sets');
}
$group = new Form_Group('Action');
$btnsavesettings = new Form_Button('save_settings', gettext('Save'), null);
Exemplo n.º 12
0
foreach ($p2_ealgos as $algo => $algodata) {
    $group = new Form_Group($i == 0 ? 'Encryption Algorithms' : '');
    $group->addClass('encalg');
    $group->add(new Form_Checkbox('ealgos[]', null, $algodata['name'], is_array($pconfig['ealgos']) && in_array($algo, $pconfig['ealgos']), $algo))->addClass('multi');
    if (is_array($algodata['keysel'])) {
        $list = array();
        $key_hi = $algodata['keysel']['hi'];
        $key_lo = $algodata['keysel']['lo'];
        $key_step = $algodata['keysel']['step'];
        for ($keylen = $key_hi; $keylen >= $key_lo; $keylen -= $key_step) {
            $list[$keylen] = $keylen . ' bits';
        }
        $group->add(new Form_Select('keylen_' . $algo, null, $keylen == $pconfig["keylen_" . $algo], array_merge(array('auto' => 'Auto'), $list)));
    }
    if ($i == $rows) {
        $group->setHelp('Use 3DES for best compatibility or if you have a hardware crypto accelerator card. Blowfish is usually the fastest in software encryption.');
    }
    $i++;
    $section->add($group);
}
$group = new Form_Group('Hash Algorithms');
foreach ($p2_halgos as $algo => $algoname) {
    $group->add(new Form_Checkbox('halgos[]', null, $algoname, in_array($algo, $pconfig['halgos']), $algo))->addClass('multi');
}
$section->add($group);
$sm = !isset($pconfig['mobile']) || !isset($a_client['pfs_group']);
$section->addInput(new Form_Select('pfsgroup', 'PFS key group', $pconfig['psgroup'], $sm ? $p2_pfskeygroups : array()))->setHelp($sm ? '' : 'Set globally in mobile client options');
$section->addInput(new Form_Input('lifetime', 'Lifetime', 'number', $pconfig['lifetime']))->setHelp('Seconds');
$form->add($section);
$section = new Form_Section('Advanced Configuration');
$section->addInput(new Form_IpAddress('pinghost', 'Automatically ping host', $pconfig['pinghost']))->setHelp('IP Address');
Exemplo n.º 13
0
$group->add(new Form_Select('dsttype', null, dsttype_selected(), build_dsttype_list()))->setHelp('Type');
$group->add(new Form_IpAddress('dst', null, is_specialnet($pconfig['dst']) ? '' : $pconfig['dst']))->setPattern('[.a-zA-Z0-9_]+')->addMask('dstmask', $pconfig['dstmask'], 31)->setHelp('Address/mask');
$section->add($group);
$group = new Form_Group('Destination port range');
$group->addClass('dstportrange');
$group->add(new Form_Select('dstbeginport', null, $pconfig['dstbeginport'], $portlist))->setHelp('From port');
$group->add(new Form_Input('dstbeginport_cust', null, 'text', $pconfig['dstbeginport'], ['min' => '1', 'max' => '65536']))->setHelp('Custom');
$group->add(new Form_Select('dstendport', null, $pconfig['dstendport'], $portlist))->setHelp('To port');
$group->add(new Form_Input('dstendport_cust', null, 'text', $pconfig['dstendport'], ['min' => '1', 'max' => '65536']))->setHelp('Custom');
$group->setHelp('Specify the port or port range for the destination of the packet for this mapping. ' . 'You can leave the \'to\' field empty if you only want to map a single port ');
$section->add($group);
$section->addInput(new Form_IpAddress('localip', 'Redirect target IP', $pconfig['localip']))->setPattern('[.a-zA-Z0-9_]+')->setHelp('Enter the internal IP address of the server on which you want to map the ports.' . '<br />' . 'e.g.: 192.168.1.12');
$group = new Form_Group('Redirect target port');
$group->addClass('lclportrange');
$group->add(new Form_Select('localbeginport', null, $pconfig['localbeginport'], array('' => 'Other') + $wkports))->setHelp('Port');
$group->setHelp('Specify the port on the machine with the IP address entered above. In case of a port range, specify the ' . 'beginning port of the range (the end port will be calculated automatically).' . '<br />' . 'this is usually identical to "From port" above');
$group->add(new Form_Input('localbeginport_cust', null, 'text', $pconfig['localbeginport'], ['min' => '1', 'max' => '65536']))->setHelp('Custom');
$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).');
$section->addInput(new Form_Checkbox('nosync', 'No XMLRPC Sync', 'Do not automatically sync to other CARP members', $pconfig['nosync']))->setHelp('This prevents the rule on Master from automatically syncing to other CARP members. ' . 'This does NOT prevent the rule from being overwritten on Slave.');
$section->addInput(new Form_Select('natreflection', 'NAT reflection', $pconfig['natreflection'], array('default' => 'Use system default', 'enable' => 'Enable (NAT + Proxy)', 'purenat' => 'Enable (Pure NAT)', 'disable' => 'Disable')));
if (isset($id) && $a_nat[$id] && (!isset($_GET['dup']) || !is_numericint($_GET['dup']))) {
    $hlpstr = '';
    $rulelist = array('' => 'None', 'pass' => 'Pass');
    if (is_array($config['filter']['rule'])) {
        filter_rules_sort();
        foreach ($config['filter']['rule'] as $filter_id => $filter_rule) {
            if (isset($filter_rule['associated-rule-id'])) {
                $rulelist[$filter_rule['associated-rule-id']] = 'Rule ' . $filter_rule['descr'];
                if ($filter_rule['associated-rule-id'] == $pconfig['associated-rule-id']) {
                    $hlpstr = '<a href="firewall_rules_edit.php?id=' . $filter_id . '">' . gettext("View the filter rule") . '</a><br />';
Exemplo n.º 14
0
         if ($act == 'edit' && $Ggroup['member'] && in_array($pconfig['uid'], $Ggroup['member'])) {
             $usersGroups[$Ggroup['name']] = $Ggroup['name'];
             // Add it to the user's list
         } else {
             $systemGroups[$Ggroup['name']] = $Ggroup['name'];
             // Add it to the 'not a member of' list
         }
     }
 }
 $group->add(new Form_Select('sysgroups', null, array_combine((array) $pconfig['groups'], (array) $pconfig['groups']), $systemGroups, true))->setHelp('Not member of');
 $group->add(new Form_Select('groups', null, array_combine((array) $pconfig['groups'], (array) $pconfig['groups']), $usersGroups, true))->setHelp('Member of');
 $section->add($group);
 $group = new Form_Group('');
 $group->add(new Form_Button('movetoenabled', 'Move to "Member of" list', null, 'fa-angle-double-right'))->setAttribute('type', 'button')->removeClass('btn-primary')->addClass('btn-info btn-sm');
 $group->add(new Form_Button('movetodisabled', 'Move to "Not member of" list', null, 'fa-angle-double-left'))->setAttribute('type', 'button')->removeClass('btn-primary')->addClass('btn-info btn-sm');
 $group->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items.');
 $section->add($group);
 // ==== Button for adding user certificate ================================
 if ($act == 'new') {
     $section->addInput(new Form_Checkbox('showcert', 'Certificate', 'Click to create a user certificate', false));
 }
 $form->add($section);
 // ==== Effective privileges section ======================================
 if (isset($pconfig['uid'])) {
     // We are going to build an HTML table and add it to an Input_StaticText. It may be ugly, but it
     // is the best way to make the display we need.
     $section = new Form_Section('Effective Privileges');
     $section->addInput(new Form_StaticText(null, build_priv_table()));
     $form->add($section);
     // ==== Certificate table section =====================================
     $section = new Form_Section('User Certificates');
$mymac = `/usr/sbin/arp -an | grep '('{$ip}')' | head -n 1 | cut -d" " -f4`;
$mymac = str_replace("\n", "", $mymac);
include "head.inc";
if ($input_errors) {
    print_input_errors($input_errors);
}
$form = new Form();
$section = new Form_Section('Edit MAC Address Rules');
$section->addInput(new Form_Select('action', 'Action', strtolower($pconfig['action']), array('pass' => gettext('Pass'), 'block' => gettext('Block'))))->setHelp('Choose what to do with packets coming from this MAC address.');
$macaddress = new Form_Input('mac', 'MAC Address', 'text', $pconfig['mac'], ['placeholder' => 'xx:xx:xx:xx:xx:xx']);
$btnmymac = new Form_Button('btnmymac', 'Copy My MAC', null, 'fa-clone');
$btnmymac->setAttribute('type', 'button')->removeClass('btn-primary')->addClass('btn-success btn-sm');
$group = new Form_Group('MAC Address');
$group->add($macaddress);
$group->add($btnmymac);
$group->setHelp('6 hex octets separated by colons');
$section->add($group);
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('A description may be entered here for administrative reference (not parsed)');
$section->addInput(new Form_Input('bw_up', 'Bandwidth up', 'text', $pconfig['bw_up']))->setHelp('Enter an upload limit to be enforced on this MAC in Kbit/s');
$section->addInput(new Form_Input('bw_down', 'Bandwidth down', 'text', $pconfig['bw_down']))->setHelp('Enter a download limit to be enforced on this MAC in Kbit/s');
$section->addInput(new Form_Input('zone', null, 'hidden', $cpzone));
if (isset($id) && $a_passthrumacs[$id]) {
    $section->addInput(new Form_Input('id', null, 'hidden', $id));
}
if (isset($pconfig['username']) && $pconfig['username']) {
    $section->addInput(new Form_Input('username', null, 'hidden', $pconfig['username']));
}
$form->add($section);
print $form;
?>
Exemplo n.º 16
0
}
$section->addClass('advanced-options');
$section->addInput(new Form_Select('weight', 'Weight', $pconfig['weight'], array_combine(range(1, 30), range(1, 30))))->setHelp('Weight for this gateway when used in a Gateway Group.');
$section->addInput(new Form_Input('data_payload', 'Data Payload', 'number', $pconfig['data_payload'], ['placeholder' => $dpinger_default['data_payload']]))->setHelp('Define data payload to send on ICMP packets to gateway monitor IP.');
$group = new Form_Group('Latency thresholds');
$group->add(new Form_Input('latencylow', 'From', 'number', $pconfig['latencylow'], ['placeholder' => $dpinger_default['latencylow']]));
$group->add(new Form_Input('latencyhigh', 'To', 'number', $pconfig['latencyhigh'], ['placeholder' => $dpinger_default['latencyhigh']]));
$group->setHelp('Low and high thresholds for latency in milliseconds.
	Default is %d/%d.', [$dpinger_default['latencylow'], $dpinger_default['latencyhigh']]);
$section->add($group);
$group = new Form_Group('Packet Loss thresholds');
$group->add(new Form_Input('losslow', 'From', 'number', $pconfig['losslow'], ['placeholder' => $dpinger_default['losslow']]));
$group->add(new Form_Input('losshigh', 'To', 'number', $pconfig['losshigh'], ['placeholder' => $dpinger_default['losshigh']]));
$group->setHelp('Low and high thresholds for packet loss in %%.
	Default is %d/%d.', [$dpinger_default['losslow'], $dpinger_default['losshigh']]);
$section->add($group);
$section->addInput(new Form_Input('interval', 'Probe Interval', 'number', $pconfig['interval'], ['placeholder' => $dpinger_default['interval'], 'max' => 86400]))->setHelp('How often an ICMP probe will be sent in milliseconds. Default is %d. ' . 'NOTE: The quality graph is averaged over seconds, not intervals, so as ' . 'the probe interval is increased the accuracy of the quality graph is ' . 'decreased.', [$dpinger_default['interval']]);
$section->addInput(new Form_Input('loss_interval', 'Loss Interval', 'number', $pconfig['loss_interval'], ['placeholder' => $dpinger_default['loss_interval']]))->setHelp('Time interval in milliseconds before packets are treated as lost. ' . 'Default is %d.', [$dpinger_default['loss_interval']]);
$group = new Form_Group('Time Period');
$group->add(new Form_Input('time_period', null, 'number', $pconfig['time_period'], ['placeholder' => $dpinger_default['time_period']]));
$group->setHelp('Time period in milliseconds over which results are averaged. Default is %d.', [$dpinger_default['time_period']]);
$section->add($group);
$group = new Form_Group('Alert interval');
$group->add(new Form_Input('alert_interval', null, 'number', $pconfig['alert_interval'], ['placeholder' => $dpinger_default['alert_interval']]));
$group->setHelp('Time interval in milliseconds between checking for an alert condition. Default is %d.', [$dpinger_default['alert_interval']]);
$section->add($group);
$section->addInput(new Form_StaticText(gettext('Additional information'), '<span class="help-block">' . gettext('The time period over which results are averaged must be at least twice ' . 'the probe interval, otherwise the averaging would only "average" over a single probe.') . '<br/><br/>' . gettext('The alert interval must be greater than or equal to the probe interval. ' . 'There is no point checking for alerts more often than probes are done.') . '<br/><br/>' . gettext('The loss interval must be greater than or equal to the high latency threshold. ' . 'Otherwise high latency packets would always be considered as lost.') . '<br/><br/>' . gettext('Choose a combination of parameters to suit your needs. ' . 'For example, a short probe interval will give more probes and (hopefully) ' . 'a statistically more stable average. A higher loss interval will allow the ' . 'system to wait longer for probes on high-latency links, and thus allow a ' . 'better estimate of high-latency versus loss.') . '</span>'));
$section->addInput(new Form_Checkbox('nonlocalgateway', 'Use non-local gateway', 'Use non-local gateway through interface specific route.', $pconfig['nonlocalgateway']))->setHelp('This will allow use of a gateway outside of this interface\'s subnet. This is usually indicative of a configuration error, but is required for some scenarios.');
$form->add($section);
print $form;
include "foot.inc";
Exemplo n.º 17
0
    $group->add(new Form_IpAddress($type, $name . ' Address', $pconfig[$type]))->addMask($type . 'mask', $pconfig[$type . 'mask'])->setPattern('[a-zA-Z0-9_.:]+');
    $section->add($group);
    if ($type == 'src') {
        $section->addInput(new Form_Button('btnsrctoggle', '', null, 'fa-cog'))->setAttribute('type', 'button')->addClass('btn-info btn-sm')->setHelp('The <b>Source Port Range</b> for a connection is typically random ' . 'and almost never equal to the destination port. ' . 'In most cases this setting must remain at its default value, <b>any</b>.');
    }
    $portValues = ['' => gettext('(other)'), 'any' => gettext('any')];
    foreach ($wkports as $port => $portName) {
        $portValues[$port] = $portName . ' (' . $port . ')';
    }
    $group = new Form_Group($name . ' Port Range');
    $group->addClass($type . 'portrange');
    $group->add(new Form_Select($type . 'beginport', $name . ' port begin', $pconfig[$type . 'beginport'], $portValues))->setHelp('From');
    $group->add(new Form_Input($type . 'beginport_cust', null, 'text', isset($portValues[$pconfig[$type . 'beginport']]) ? null : $pconfig[$type . 'beginport']))->setHelp('Custom');
    $group->add(new Form_Select($type . 'endport', $name . ' port end', $pconfig[$type . 'endport'], $portValues))->setHelp('To');
    $group->add(new Form_Input($type . 'endport_cust', null, 'text', isset($portValues[$pconfig[$type . 'endport']]) ? null : $pconfig[$type . 'endport']))->setHelp('Custom');
    $group->setHelp(sprintf('Specify the %s port or port range for this rule. The "To" field may be left empty if only filtering a single port.', strtolower($name)));
    $group->addClass($type == 'src' ? 'srcprtr' : 'dstprtr');
    $section->add($group);
    $form->add($section);
}
$section = new Form_Section('Extra Options');
$section->addInput(new Form_Checkbox('log', 'Log', 'Log packets that are handled by this rule', $pconfig['log']))->setHelp('Hint: the firewall has limited local log space. Don\'t turn on logging ' . 'for everything. If doing a lot of logging, consider using a remote ' . 'syslog server (see the <a href="status_logs_settings.php">Status: System Logs: ' . 'Settings</a> page).');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('A description may be entered here for administrative reference.');
$btnadv = new Form_Button('btnadvopts', 'Display Advanced', null, 'fa-cog');
$btnadv->setAttribute('type', 'button')->addClass('btn-info btn-sm');
$section->addInput(new Form_StaticText('Advanced Options', $btnadv));
$form->add($section);
$section = new Form_Section('Advanced Options');
$section->addClass('advanced-options');
$section->addInput(new Form_Select('os', 'Source OS', empty($pconfig['os']) ? '' : $pconfig['os'], ['' => gettext('Any')] + array_combine($ostypes, $ostypes)))->setHelp('Note: this only works for TCP rules. General OS choice matches all subtypes.');
$section->addInput(new Form_Select('dscp', 'Diffserv Code Point', $pconfig['dscp'], ["" => ''] + array_combine($firewall_rules_dscp_types, $firewall_rules_dscp_types)));
$mymac = `/usr/sbin/arp -an | grep '('{$ip}')' | head -n 1 | cut -d" " -f4`;
$mymac = str_replace("\n", "", $mymac);
include "head.inc";
if ($input_errors) {
    print_input_errors($input_errors);
}
$form = new Form();
$section = new Form_Section('Edit MAC address rules');
$section->addInput(new Form_Select('action', 'Action', strtolower($pconfig['action']), array('pass' => gettext('Pass'), 'block' => gettext('Block'))))->setHelp('Choose what to do with packets coming from this MAC address.');
$macaddress = new Form_Input('mac', 'MAC Address', 'text', $pconfig['mac'], ['placeholder' => 'xx:xx:xx:xx:xx:xx']);
$btnmymac = new Form_Button('btnmymac', 'Copy My MAC');
$btnmymac->removeClass('btn-primary')->addClass('btn-success btn-sm');
$group = new Form_Group('MAC controls');
$group->add($macaddress);
$group->add($btnmymac);
$group->setHelp('MAC address (6 hex octets separated by colons)');
$section->add($group);
$section->addInput(new Form_Input('bw_up', 'Bandwidth up', 'text', $pconfig['bw_up']))->setHelp('Enter an upload limit to be enforced on this MAC in Kbit/s');
$section->addInput(new Form_Input('bw_down', 'Bandwidth down', 'text', $pconfig['bw_down']))->setHelp('Enter a download limit to be enforced on this MAC in Kbit/s');
$section->addInput(new Form_Input('zone', null, 'hidden', $cpzone));
if (isset($id) && $a_passthrumacs[$id]) {
    $section->addInput(new Form_Input('id', null, 'hidden', $id));
}
if (isset($pconfig['username']) && $pconfig['username']) {
    $section->addInput(new Form_Input('username', null, 'hidden', $pconfig['username']));
}
$form->add($section);
print $form;
?>

<script type="text/javascript">
Exemplo n.º 19
0
    $section->add($group);
    if ($type == 'src') {
        $section->addInput(new Form_Button('btnsrcadv', 'Show advanced'))->removeClass('btn-primary');
    }
    $portValues = ['' => '(other)', 'any' => 'any'];
    foreach ($wkports as $port => $portName) {
        $portValues[$port] = $portName . ' (' . $port . ')';
    }
    $group = new Form_Group($name . ' port range');
    $group->addClass($type . 'portrange');
    $group->add(new Form_Select($type . 'beginport', $name . ' port begin', $pconfig[$type . 'beginport'], $portValues))->setHelp('From');
    $group->add(new Form_Input($type . 'beginport_cust', null, 'text', isset($portValues[$pconfig[$type . 'beginport']]) ? null : $pconfig[$type . 'beginport']))->setHelp('Custom');
    $group->add(new Form_Select($type . 'endport', $name . ' port end', $pconfig[$type . 'endport'], $portValues))->setHelp('To');
    $group->add(new Form_Input($type . 'endport_cust', null, 'text', isset($portValues[$pconfig[$type . 'endport']]) ? null : $pconfig[$type . 'endport']))->setHelp('Custom');
    if ($type == 'src') {
        $group->setHelp('Specify the source port or port range for this rule. This is ' . 'usually random and almost never equal to the destination port range (and ' . 'should usually be <b>any</b>). You can leave the "To" field ' . 'empty if you only want to filter a single port.');
    } else {
        $group->setHelp('Specify the destination port or port range for this rule. ' . 'You can leave the "To" field empty if you only want to filter a ' . 'single port.');
    }
    $group->addClass($type == 'src' ? 'srcprtr' : 'dstprtr');
    $section->add($group);
    $form->add($section);
}
$section = new Form_Section('Extra options');
$section->addInput(new Form_Checkbox('log', 'Log', 'Log packets that are handled by this rule', $pconfig['log']))->setHelp('Hint: the firewall has limited local log space. Don\'t turn on logging ' . 'for everything. If you want to do a lot of logging, consider using a remote ' . 'syslog server (see the <a href="diag_logs_settings.php">Diagnostics: System logs: ' . 'Settings</a> page).');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('You may enter a description here for your reference.');
$btnadvanced = new Form_Button('toggle-advanced', 'Advanced options');
$btnadvanced->removeClass('btn-primary')->addClass('btn-info');
$section->addInput(new Form_StaticText(null, $btnadvanced));
$form->add($section);
$section = new Form_Section('Advanced options');
Exemplo n.º 20
0
    $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) {
        $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filterfieldsarray);
    } else {
        $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filtertext, $interfacefilter);
    }
    ?>
$section = new Form_Section('Schedule Information');
$input = new Form_Input('name', 'Schedule Name', 'text', $pconfig['name']);
$input->setHelp(is_schedule_inuse($pconfig['name']) != true ? 'The name of the schedule may only consist of the characters "a-z, A-Z, 0-9 and _".' : 'This schedule is in use so the name may not be modified!');
if (is_schedule_inuse($pconfig['name']) == true) {
    $input->setReadonly();
}
$section->addInput($input);
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('A description may be entered here for administrative reference (not parsed). ');
$section->addInput(new Form_Select('monthsel', 'Month', null, build_month_list()));
$section->addInput(new Form_StaticText('Date', build_date_table()));
$group = new Form_Group('Time');
$group->add(new Form_Select('starttimehour', null, null, array_combine(range(0, 23, 1), range(0, 23, 1))))->setHelp('Start Hrs');
$group->add(new Form_Select('starttimemin', null, null, array('00' => '00', '15' => '15', '30' => '30', '45' => '45', '59' => '59')))->setHelp('Start Mins');
$group->add(new Form_Select('stoptimehour', null, '23', array_combine(range(0, 23, 1), range(0, 23, 1))))->setHelp('Stop Hrs');
$group->add(new Form_Select('stoptimemin', null, '59', array('00' => '00', '15' => '15', '30' => '30', '45' => '45', '59' => '59')))->setHelp('Stop Mins');
$group->setHelp('Select the time range for the day(s) selected on the Month(s) above. A full day is 0:00-23:59.');
$section->add($group);
$section->addInput(new Form_Input('timerangedescr', 'Time range description', 'text', $pconfig['timerangedescr']))->setHelp('A description may be entered here for administrative reference (not parsed). ');
$group = new Form_Group(null);
$group->add(new Form_Button('btnaddtime', 'Add Time', null, 'fa-plus'))->setAttribute('type', 'button')->addClass('btn-success btn-sm');
$group->add(new Form_Button('btnclrsel', 'Clear selection', null, 'fa-undo'))->setAttribute('type', 'button')->addClass('btn-info btn-sm');
$section->add($group);
if (isset($id) && $a_schedules[$id]) {
    $section->addInput(new Form_Input('id', null, 'hidden', $id));
}
$form->add($section);
$section = new Form_Section('Configured Ranges');
$counter = 0;
if ($getSchedule) {
    $maxrows = count($pconfig['timerange']) - 1;
    foreach ($pconfig['timerange'] as $timerange) {
Exemplo n.º 22
0
}
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('A description may be entered here for administrative reference (not parsed).');
$form->add($section);
$section = new Form_Section('Phase 1 Proposal (Authentication)');
$section->addInput(new Form_Select('authentication_method', 'Authentication Method', $pconfig['authentication_method'], build_auth_method_list()))->setHelp('Must match the setting chosen on the remote side.');
$section->addInput(new Form_Select('mode', 'Negotiation mode', $pconfig['mode'], array("main" => gettext("Main"), "aggressive" => gettext("Aggressive"))))->setHelp('Aggressive is more flexible, but less secure.');
$group = new Form_Group('My identifier');
$group->add(new Form_Select('myid_type', null, $pconfig['myid_type'], build_myid_list()));
$group->add(new Form_Input('myid_data', null, 'text', $pconfig['myid_data']));
$section->add($group);
$group = new Form_Group('Peer identifier');
$group->addClass('peeridgroup');
$group->add(new Form_Select('peerid_type', null, $pconfig['peerid_type'], build_peerid_list()));
$group->add(new Form_Input('peerid_data', null, 'text', $pconfig['peerid_data']));
if ($pconfig['mobile']) {
    $group->setHelp('This is known as the "group" setting on some VPN client implementations');
}
$section->add($group);
$section->addInput(new Form_Input('pskey', 'Pre-Shared Key', 'text', $pconfig['pskey']))->setHelp('Enter the Pre-Shared Key string.');
$section->addInput(new Form_Select('certref', 'My Certificate', $pconfig['certref'], build_cert_list()))->setHelp('Select a certificate previously configured in the Certificate Manager.');
$section->addInput(new Form_Select('caref', 'Peer Certificate Authority', $pconfig['caref'], build_ca_list()))->setHelp('Select a certificate authority previously configured in the Certificate Manager.');
$form->add($section);
$section = new Form_Section('Phase 1 Proposal (Algorithms)');
$group = new Form_Group('Encryption Algorithm');
$group->add(new Form_Select('ealgo', null, $pconfig['ealgo']['name'], build_eal_list()));
$group->add(new Form_Select('ealgo_keylen', null, $pconfig['ealgo_keylen'], array()));
$section->add($group);
$section->addInput(new Form_Select('halgo', 'Hash Algorithm', $pconfig['halgo'], $p1_halgos))->setHelp('Must match the setting chosen on the remote side.');
$section->addInput(new Form_Select('dhgroup', 'DH Group', $pconfig['dhgroup'], $p1_dhgroups))->setHelp('Must match the setting chosen on the remote side.');
$section->addInput(new Form_Input('lifetime', 'Lifetime (Seconds)', 'number', $pconfig['lifetime']));
$form->add($section);
Exemplo n.º 23
0
$section->addInput(new Form_Input('initstr', 'Init string', 'text', $pconfig['initstr']))->setHelp('Enter the modem initialization string here. Do NOT include the "AT" string at the beginning of the command. ' . 'Many modern USB 3G modems don\'t need an initialization string.');
$section->addInput(new Form_Input('connect-timeout', 'Connection Timeout', 'text', $pconfig['connect-timeout']))->setHelp('Enter timeout in seconds for connection to be established (sec.) Default is 45 sec.');
$section->addInput(new Form_Checkbox('uptime', 'Uptime logging', 'Enable persistent logging of connection uptime. ', isset($pconfig['uptime'])))->setHelp(sprintf('Causes cumulative uptime to be recorded and displayed on the %sStatus->Interfaces%s page.', '<a href="status_interfaces.php">', '</a>'));
$group = new Form_Group('Service name');
$group->addClass('pppoe');
$group->add(new Form_Input('provider', null, 'text', $pconfig['provider']));
$group->add(new Form_Checkbox('null_service', null, 'Configure NULL service name', $pconfig['null_service']));
$group->setHelp('This field can usually be left empty. Service name will not be configured if this field is empty. ' . 'Check the "Configure NULL" box to configure a blank Service name.');
$section->add($group);
$section->addInput(new Form_Select('pppoe-reset-type', 'Periodic Reset', $pconfig['pppoe-reset-type'], array('' => gettext('Disabled'), 'custom' => gettext('Custom'), 'preset' => gettext('Pre-set'))))->addClass('pppoe')->setHelp('Select a reset timing type');
$group = new Form_Group('Reset Date/Time');
$group->addClass('pppoe-reset-date');
$group->add(new Form_Input('pppoe_resethour', null, 'text', $pconfig['pppoe_resethour']))->setHelp('Hour');
$group->add(new Form_Input('pppoe_resetminute', null, 'text', $pconfig['pppoe_resetminute']))->setHelp('Minute');
$group->add(new Form_Input('pppoe_resetdate', null, 'text', $pconfig['pppoe_resetdate'], ['placeholder' => 'mm/dd/yyyy']))->setHelp('Specific date');
$group->setHelp('Leaving the date field empty will cause the reset to be executed each day at the time specified in the minutes and hour fields. ');
$section->add($group);
$group = new Form_Group('Reset frequency');
$group->addClass('pppoe-reset-cron');
$group->add(new Form_Checkbox('pppoe_pr_preset_val', null, 'Monthly (0 0 1 * *)', $pconfig['pppoe_monthly'], 'monthly'))->displayAsRadio();
$group->add(new Form_Checkbox('pppoe_pr_preset_val', null, 'Weekly (0 0 * * 0)', $pconfig['pppoe_weekly'], 'weekly'))->displayAsRadio();
$group->add(new Form_Checkbox('pppoe_pr_preset_val', null, 'Daily (0 0 * * *)', $pconfig['pppoe_daily'], 'daily'))->displayAsRadio();
$group->add(new Form_Checkbox('pppoe_pr_preset_val', null, 'Hourly (0 * * * *)', $pconfig['pppoe_hourly'], 'hourly'))->displayAsRadio();
$section->add($group);
$btnadv = new Form_Button('btnadvopts', 'Display Advanced', null, 'fa-cog');
$btnadv->setAttribute('type', 'button')->addClass('btn-info btn-sm');
$section->addInput(new Form_StaticText('Advanced options', $btnadv));
$form->add($section);
$section = new Form_Section('Advanced Configuration');
$section->addClass('adnlopts');
$section->addInput(new Form_Checkbox('ondemand', 'Dial On Demand', 'Enable Dial-on-Demand mode. ', $pconfig['ondemand']))->setHelp('Causes the interface to operate in dial-on-demand mode. Do NOT enable if the link is to remain continuously connected. ' . 'The interface is configured, but the actual connection of the link is delayed until qualifying outgoing traffic is detected.');
Exemplo n.º 24
0
function filter_form_vpn()
{
    global $filter_active, $rawfilter, $filterfieldsarray, $filtertext, $filterlogentries_qty, $nentries, $Include_Act, $interfacefilter;
    global $logfile;
    global $system_logs_filter_form_hidden;
    if ($filter_active) {
        $panel_state = 'in';
        $panel_body_state = SEC_OPEN;
    } else {
        if ($system_logs_filter_form_hidden) {
            $panel_state = 'out';
            $panel_body_state = SEC_OPEN;
        } else {
            $panel_state = 'in';
            $panel_body_state = SEC_CLOSED;
        }
    }
    if (!$rawfilter) {
        // Advanced log filter form
        $form = new Form(false);
        $form->setAttribute('id', 'filter-form')->addClass('collapse ' . $panel_state);
        $section = new Form_Section('Advanced Log Filter', 'filter-panel', COLLAPSIBLE | $panel_body_state);
        if ($logfile == "vpn") {
            $group = new Form_Group('');
            $group->add(new Form_Input('filterlogentries_time', null, 'text', $filterfieldsarray['time']))->setWidth(3)->setHelp('Time');
            $group->add(new Form_Input('filterlogentries_action', null, 'text', $filterfieldsarray['action']))->setWidth(3)->setHelp('Action');
            $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('filterlogentries_user', null, 'text', $filterfieldsarray['user']))->setWidth(3)->setHelp('User');
            $group->add(new Form_Input('filterlogentries_ip_address', null, 'text', $filterfieldsarray['ip_address']))->setWidth(4)->setHelp('IP Address');
        } else {
            $group = new Form_Group('');
            $group->add(new Form_Input('filterlogentries_time', null, 'text', $filterfieldsarray['time']))->setWidth(3)->setHelp('Time');
            $group->add(new Form_Input('filterlogentries_type', null, 'text', $filterfieldsarray['type']))->setWidth(2)->setHelp('Type');
            $group->add(new Form_Input('filterlogentries_pid', null, 'text', $filterfieldsarray['pid']))->setWidth(2)->setHelp('PID');
            $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('filterlogentries_message', null, 'text', $filterfieldsarray['message']))->setWidth(7)->setHelp('Log Message');
        }
        $btnsubmit = new Form_Button('filterlogentries_submit', ' ' . gettext('Apply Filter'), null, 'fa-filter');
    } else {
        // Simple log filter form
        $form = new Form(false);
        $form->setAttribute('id', 'filter-form')->addClass('collapse ' . $panel_state);
        $section = new Form_Section('Log Filter', 'filter-panel', COLLAPSIBLE | $panel_body_state);
        $group = new Form_Group('');
        $group->add(new Form_Input('filtertext', null, 'text', $filtertext))->setWidth(6)->setHelp('Filter Expression');
        $group->add(new Form_Input('filterlogentries_qty', null, 'number', $filterlogentries_qty, ['placeholder' => $nentries]))->setWidth(2)->setHelp('Quantity');
        $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;
}
Exemplo n.º 25
0
$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']));
$form->add($section);
print $form;
?>

<div id="infoblock">
	<?php 
echo print_info_box(gettext("Proxy ARP and Other type Virtual IPs cannot be bound to by anything running on the firewall, such as IPsec, OpenVPN, etc.  Use a CARP or IP Alias type address for these types.") . '<br />' . sprintf(gettext("For more information on CARP and the above values, visit the OpenBSD %s"), '<a href="http://www.openbsd.org/faq/pf/carp.html">CARP FAQ</a>.'), info);
?>
</div>
Exemplo n.º 26
0
$section->addInput(new Form_Checkbox('gpsflag3', null, 'Enable kernel PPS clock discipline (default: enabled).', $pconfig['flag3']));
$section->addInput(new Form_Checkbox('gpsflag4', null, 'Obscure location in timestamp (default: unobscured).', $pconfig['flag4']));
$section->addInput(new Form_Checkbox('gpssubsec', null, 'Log the sub-second fraction of the received time stamp (default: Not logged).', $pconfig['subsec']))->setHelp('Enabling this will rapidly fill the log, but is useful for tuning Fudge time 2.');
$section->addInput(new Form_Input('gpsrefid', 'Clock ID', 'text', $pconfig['refid'], ['placeholder' => '1 to 4 characters']))->setHelp('This may be used to change the GPS Clock ID (default: GPS).');
// Statistics logging section
$btnadvgps = new Form_Button('btnadvgps', 'Advanced');
$btnadvgps->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText('GPS Initialization', $btnadvgps . '&nbsp' . 'Show GPS Initialization commands'));
$section->addInput(new Form_Textarea('gpsinitcmd', null, $pconfig['initcmd']))->setHelp('Commands entered here will be sent to the GPS during initialization. Please read and understand your GPS documentation before making any changes here');
$group = new Form_Group('NMEA Checksum Calculator');
$group->add(new Form_Input('nmeastring', null));
$btncalc = new Form_Button('btncalc', 'Calculate');
$btncalc->removeClass('btn-primary')->addClass('btn-success btn-sm');
$group->add($btncalc);
$group->add(new Form_Input('result', null, 'text', null, ['placeholder' => 'Result']));
$group->setHelp('Enter the text between &quot;$&quot; and &quot;*&quot; of a NMEA command string:');
$group->addClass('calculator');
$section->add($group);
$form->add($section);
print $form;
?>

<script>
//<![CDATA[
events.push(function(){

	function NMEAChecksum(cmd) {
		// Compute the checksum by XORing all the character values in the string.
		var checksum = 0;

		for(var i = 0; i < cmd.length; i++) {
Exemplo n.º 27
0
$tab_array = array();
$tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php");
$tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php");
$tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php");
$tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php");
$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
display_top_tabs($tab_array);
?>
<div id="container"><?php 
$form = new Form();
$section = new Form_Section('WebConfigurator');
$group = new Form_Group('Protocol');
$group->add(new Form_Checkbox('webguiproto', 'Protocol', 'HTTP', $pconfig['webguiproto'] == 'http', 'http'))->displayAsRadio();
$group->add(new Form_Checkbox('webguiproto', 'Protocol', 'HTTPS', $pconfig['webguiproto'] == 'https', 'https'))->displayAsRadio();
$group->setHelp($certs_available ? '' : 'No Certificates have been defined. You must ' . '<a href="system_certmanager.php">' . gettext("Create or Import") . '</a> ' . 'a Certificate before SSL can be enabled.');
$section->add($group);
$values = array();
foreach ($a_cert as $cert) {
    $values[$cert['refid']] = $cert['descr'];
}
$section->addInput($input = new Form_Select('ssl-certref', 'SSL Certificate', $pconfig['ssl-certref'], $values));
$section->addInput(new Form_Input('webguiport', 'TCP port', 'number', $config['system']['webgui']['port'], ['min' => 1, 'max' => 65535]))->setHelp('Enter a custom port number for the webConfigurator ' . 'above if you want to override the default (80 for HTTP, 443 ' . 'for HTTPS). Changes will take effect immediately after save.');
$section->addInput(new Form_Input('max_procs', 'Max Processes', 'number', $pconfig['max_procs']))->setHelp('Enter the number of webConfigurator processes you ' . 'want to run. This defaults to 2. Increasing this will allow more ' . 'users/browsers to access the GUI concurrently.');
$section->addInput(new Form_Checkbox('disablehttpredirect', 'WebGUI redirect', 'Disable webConfigurator redirect rule', $pconfig['disablehttpredirect']))->setHelp('When this is unchecked, access to the webConfigurator ' . 'is always permitted even on port 80, regardless of the listening port configured. ' . 'Check this box to disable this automatically added redirect rule.');
$section->addInput(new Form_Checkbox('loginautocomplete', 'WebGUI Login Autocomplete', 'Enable webConfigurator login autocomplete', $pconfig['loginautocomplete']))->setHelp('When this is checked, login credentials for the webConfigurator may ' . 'be saved by the browser. While convenient, some security standards require this ' . 'to be disabled. Check this box to enable autocomplete on the login form so that ' . 'browsers will prompt to save credentials (NOTE: Some browsers do not respect ' . 'this option).');
$section->addInput(new Form_Checkbox('quietlogin', 'WebGUI login messages', 'Disable logging of webConfigurator successful logins', $pconfig['quietlogin']))->setHelp('When this is checked, successful logins to the webConfigurator will ' . 'not be logged.');
if ($config['interfaces']['lan']) {
    $lockout_interface = "LAN";
} else {
    $lockout_interface = "WAN";
Exemplo n.º 28
0
$section->addInput(new Form_Checkbox('radiussecenable', null, 'Use backup RADIUS server', $pconfig['radiussecenable']))->setHelp('If primary server fails all requests will be sent via backup server');
$section->addInput(new Form_IpAddress('radius_nasip', 'NAS IP Address', $pconfig['radius_nasip']))->setHelp('RADIUS server NAS IP Address');
$section->addInput(new Form_Input('radius_acct_update', 'RADIUS Accounting Update', 'text', $pconfig['radius_acct_update']))->setHelp('RADIUS accounting update period in seconds');
$section->addInput(new Form_Checkbox('radiusissueips', 'Radius Issued IPs', 'Issue IP Addresses via RADIUS server', $pconfig['radiusissueips']));
$group = new Form_Group('RADIUS server Primary');
$group->add(new Form_IpAddress('radiusserver', null, $pconfig['radiusserver']))->setHelp('IP Address');
$group->add(new Form_Input('radiusserverport', null, 'text', $pconfig['radiusserverport']))->setHelp('Authentication port');
$group->add(new Form_Input('radiusserveracctport', null, 'text', $pconfig['radiusserveracctport']))->setHelp('Accounting port (optional)');
$group->setHelp('Standard ports are 1812 (authentication) and 1813 (accounting)');
$section->add($group);
$section->addPassword(new Form_Input('radiussecret', 'RADIUS primary shared secret', 'password', $pconfig['radiussecret']))->setHelp('Enter the shared secret that will be used to authenticate to the RADIUS server.');
$group = new Form_Group('RADIUS server Secondary');
$group->add(new Form_IpAddress('radiusserver2', null, $pconfig['radiusserver2']))->setHelp('IP Address');
$group->add(new Form_Input('radiusserver2port', null, 'text', $pconfig['radiusserver2port']))->setHelp('Authentication port');
$group->add(new Form_Input('radiusserver2acctport', null, 'text', $pconfig['radiusserver2acctport']))->setHelp('Accounting port (optional)');
$group->setHelp('Standard ports are 1812 (authentication) and 1813 (accounting)');
$section->add($group);
$section->addPassword(new Form_Input('radiussecret2', 'RADIUS secondary shared secret', 'password', $pconfig['radiussecret2']))->setHelp('Enter the shared secret that will be used to authenticate to the backup RADIUS server.');
$counter = 0;
$numrows = count($item) - 1;
$usernames = $pconfig['username'];
//DEBUG
//$usernames = 'sbeaver:TXlQYXNzd2Q=:192.168.1.1 smith:TXlQYXNzd2Q=:192.168.2.1 sjones:TXlQYXNzd2Q=:192.168.3.1 salpha:TXlQYXNzd2Q=:192.168.4.1';
if ($usernames == "") {
    $usernames = '::';
}
if ($usernames != "") {
    $item = explode(" ", $usernames);
    $numrows = count($item) - 1;
    foreach ($item as $ww) {
        $wws = explode(":", $ww);
Exemplo n.º 29
0
if ($netboot_enabled) {
    $section->addInput(new Form_Input('filename', 'Netboot filename', 'text', $pconfig['filename']))->setHelp('Name of the file that should be loaded when this host boots off of the network, overrides setting on main page.');
    $section->addInput(new Form_Input('rootpath', 'Root Path', 'text', $pconfig['rootpath']))->setHelp('Enter the root-path-string, overrides setting on main page.');
}
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('You may enter a description here for your reference (not parsed).');
$section->addInput(new Form_Checkbox('arp_table_static_entry', 'ARP Table Static Entry', 'Create an ARP Table Static Entry for this MAC & IP Address pair.', $pconfig['arp_table_static_entry']));
$group = new Form_Group('WINS Servers');
$group->add(new Form_Input('wins1', null, 'text', $pconfig['wins1'], ['placeholder' => 'WINS 1']));
$group->add(new Form_Input('wins2', null, 'text', $pconfig['wins2'], ['placeholder' => 'WINS 2']));
$section->add($group);
$group = new Form_Group('DNS Servers');
$group->add(new Form_Input('dns1', null, 'text', $pconfig['dns1'], ['placeholder' => 'DNS 1']));
$group->add(new Form_Input('dns2', null, 'text', $pconfig['dns2'], ['placeholder' => 'DNS 2']));
$group->add(new Form_Input('dns3', null, 'text', $pconfig['dns3'], ['placeholder' => 'DNS 3']));
$group->add(new Form_Input('dns4', null, 'text', $pconfig['dns4'], ['placeholder' => 'DNS 4']));
$group->setHelp('Note: leave blank to use the system default DNS servers - this interface\'s IP if DNS Forwarder or Resolver is enabled, otherwise the servers configured on the General page.');
$section->add($group);
$section->addInput(new Form_Input('gateway', 'Gateway', 'text', $pconfig['gateway']))->setHelp('The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network.');
$section->addInput(new Form_Input('domain', 'Domain name', 'text', $pconfig['domain']))->setHelp('The default is to use the domain name of this system as the default domain name provided by DHCP. You may specify an alternate domain name here. ');
$section->addInput(new Form_Input('domainsearchlist', 'Domain search list', 'text', $pconfig['domainsearchlist']))->setHelp('The DHCP server can optionally provide a domain search list. Use the semicolon character as separator');
$section->addInput(new Form_Input('deftime', 'Default lease time (Seconds)', 'text', $pconfig['deftime']))->setHelp('Used for clients that do not ask for a specific expiration time. The default is 7200 seconds.');
$section->addInput(new Form_Input('maxtime', 'Maximum lease time (Seconds)', 'text', $pconfig['maxtime']))->setHelp('This is the maximum lease time for clients that ask for a specific expiration time. The default is 86400 seconds.');
$btndyndns = new Form_Button('btndyndns', 'Advanced');
$btndyndns->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText('Dynamic DNS', $btndyndns . '&nbsp;' . 'Show dynamic DNS settings'));
$section->addInput(new Form_Checkbox('ddnsupdate', 'DHCP Registration', 'Enable registration of DHCP client names in DNS.', $pconfig['ddnsupdate']));
$section->addInput(new Form_Input('ddnsdomain', 'DDNS Domain', 'text', $pconfig['ddnsdomain']))->setHelp('Leave blank to disable dynamic DNS registration. Enter the dynamic DNS domain which will be used to register client names in the DNS server.');
$section->addInput(new Form_IpAddress('ddnsdomainprimary', 'DDNS Server IP', $pconfig['ddnsdomainprimary']))->setHelp('Enter the primary domain name server IP address for the dynamic domain name.');
$section->addInput(new Form_Input('ddnsdomainkeyname', 'DDNS Domain Key name', 'text', $pconfig['ddnsdomainkeyname']))->setHelp('Enter the dynamic DNS domain key name which will be used to register client names in the DNS server.');
$section->addInput(new Form_Input('ddnsdomainkey', 'DDNS Domain Key secret', 'text', $pconfig['ddnsdomainkey']))->setHelp('Enter the dynamic DNS domain key secret which will be used to register client names in the DNS server.');
$btnntp = new Form_Button('btnntp', 'Advanced');
Exemplo n.º 30
0
    if (empty($result)) {
        $input_errors[] = "Host \"" . $host . "\" did not respond or could not be resolved.";
    }
}
include 'head.inc';
if ($input_errors) {
    print_input_errors($input_errors);
}
require_once 'classes/Form.class.php';
$form = new Form('Ping');
$section = new Form_Section('Ping');
$section->addInput(new Form_Input('host', 'Hostname', 'text', $host, ['placeholder' => 'Hostname to ping']));
$group = new Form_Group('IP Protocol');
$group->add(new Form_Checkbox('ipproto', null, 'IPv4', 'ipv6' != $ipproto, 'ipv4'))->displayAsRadio();
$group->add(new Form_Checkbox('ipproto', null, 'IPv6', 'ipv6' == $ipproto, 'ipv6'))->displayAsRadio();
$group->setHelp('Select the protocol to use');
$section->add($group);
$section->addInput(new Form_Select('sourceip', 'Source address', $pconfig['source'], create_sourceaddresslist()))->setHelp('Select source address for the ping');
$section->addInput(new Form_Select('count', 'Maximum number of pings', $count, array_combine(range(1, MAX_COUNT), range(1, MAX_COUNT))))->setHelp('Select the maximum number pings');
$form->add($section);
print $form;
if ($do_ping && !empty($result) && !$input_errors) {
    ?>
	<div class="panel panel-default">
		<div class="panel-heading">
			<h2 class="panel-title">Results</h2>
		</div>

		<div class="panel-body">
			<pre><?php 
    echo $result;