?> </td> <td> <select name="sourceip" class="form-control"> <option value=""><?php echo gettext('Default (any)'); ?> </option> <?php foreach (get_possible_traffic_source_addresses(false) as $sip) { ?> <option value="<?php echo $sip['value']; ?> " <?php echo !link_interface_to_bridge($sip['value']) && $sip['value'] == $pconfig['sourceip'] ? "selected=\"selected\"" : ""; ?> > <?php echo htmlspecialchars($sip['name']); ?> </option> <?php } ?> </select> <div class="hidden" for="help_for_sourceip"> <?php echo gettext("This option will allow the logging daemon to bind to a single IP address, rather than all IP addresses."); ?> <?php
<tr> <td width="22%" valign="top" class="vncellreq"><?php echo gettext("Interface"); ?> </td> <td width="78%" class="vtable"> <select name="interface" class="formfld"> <?php $interfaces = get_configured_interface_with_descr(); foreach ($interfaces as $iface => $ifacename) { ?> <option value="<?php echo $iface; ?> " <?php if (!link_interface_to_bridge($iface) && $iface == $interface) { echo "selected"; } ?> > <?php echo htmlspecialchars($ifacename); ?> </option> <?php } ?> </select> </td> </tr> <tr>
</select> </td> </tr> <tr> <td width="22%" valign="top" class="vncell"><?php echo gettext("Source Address"); ?> </td> <td width="78%" class="vtable"> <select name="sourceip" class="formselect"> <option value="">Any</option> <?php $sourceips = get_possible_traffic_source_addresses(true); foreach ($sourceips as $sipvalue => $sipname) { $selected = ""; if (!link_interface_to_bridge($sipvalue) && $sipvalue == $sourceip) { $selected = "selected=\"selected\""; } ?> <option value="<?php echo $sipvalue; ?> " <?php echo $selected; ?> > <?php echo htmlspecialchars($sipname); ?> </option> <?php
$section->addInput(new Form_Input('nentries', 'GUI Log Entries', 'text', $pconfig['nentries'], ['placeholder' => '']))->setHelp('This is only the number of log entries displayed in the GUI. It does not affect how many entries are contained in the actual log files.'); $section->addInput(new Form_Input('logfilesize', 'Log file size (Bytes)', 'text', $pconfig['logfilesize'], ['placeholder' => 'Bytes']))->setHelp($logfilesizeHelp); $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 you uncheck this option. 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 you check this option. 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_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 main system log'); $section->addInput(new Form_Checkbox('rawfilter', 'Raw Logs', 'Show raw filter logs)', $pconfig['rawfilter']))->setHelp(gettext('If this is checked, filter logs are shown as generated by the packet filter, without any formatting. This will reveal more detailed information, but it is more difficult to read')); $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'); $section->addInput(new Form_Checkbox('disablelocallogging', 'Local Logging', $g['platform'] == $g['product_name'] ? "Disable writing log files to the local disk" : "Disable writing log files to the local RAM disk", $pconfig['disablelocallogging'])); $section->addInput(new Form_Button('resetlogs', 'Reset Log Files'))->addClass('btn-danger btn-xs')->setHelp('Clears all local log files and reinitializes them as empty logs. This also restarts the DHCP daemon. Use the Save button first if you have made any setting changes.'); $form->add($section); $section = new Form_Section('Remote Logging Options'); $section->addClass('toggle-remote'); $section->addInput(new Form_Checkbox('enable', 'Enable Remote Logging', 'Send log messages to remote syslog server', $pconfig['enable'])); $section->addInput(new Form_Select('sourceip', 'Source Address', link_interface_to_bridge($pconfig['sourceip']) ? null : $pconfig['sourceip'], ["" => gettext("Default (any)")] + get_possible_traffic_source_addresses(false)))->setHelp($remoteloghelp); $section->addInput(new Form_Select('ipproto', 'IP Protocol', $ipproto, array('ipv4' => 'IPv4', 'ipv6' => 'IPv6')))->setHelp('This option is only used when a non-default address is chosen as the source above. ' . 'This option only expresses a preference; If an IP address of the selected type is not found on the chosen interface, the other type will be tried.'); // Group collapses/appears based on 'enable' checkbox above $group = new Form_Group('Remote log servers'); $group->addClass('remotelogging'); $group->add(new Form_Input('remoteserver', 'Server 1', 'text', $pconfig['remoteserver'], ['placeholder' => 'IP[:port]'])); $group->add(new Form_Input('remoteserver2', 'Server 2', 'text', $pconfig['remoteserver2'], ['placeholder' => 'IP[:port]'])); $group->add(new Form_Input('remoteserver3', 'Server 3', 'text', $pconfig['remoteserver3'], ['placeholder' => 'IP[:port]'])); $section->add($group); $group = new Form_MultiCheckboxGroup('Remote Syslog Contents'); $group->addClass('remotelogging'); $group->add(new Form_MultiCheckbox('logall', null, 'Everything', $pconfig['logall'])); $group->add(new Form_MultiCheckbox('system', null, 'System Events', $pconfig['system'])); $group->add(new Form_MultiCheckbox('filter', null, 'Firewall Events', $pconfig['filter'])); $group->add(new Form_MultiCheckbox('dhcp', null, 'DHCP service events', $pconfig['dhcp'])); $group->add(new Form_MultiCheckbox('portalauth', null, 'Portal Auth events', $pconfig['portalauth']));
$pconfig = $_POST; /* input validation */ if ($_POST['enable']) { $reqdfields = explode(" ", "zone cinterface"); $reqdfieldsn = array(gettext("Zone name"), gettext("Interface")); if (isset($_POST['auth_method']) && $_POST['auth_method'] == "radius") { $reqdfields[] = "radius_protocol"; $reqdfieldsn[] = gettext("RADIUS Protocol"); $reqdfields[] = "radiusip"; $reqdfieldsn[] = gettext("Primary RADIUS server IP address"); } do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); /* make sure no interfaces are bridged or used on other zones */ if (is_array($_POST['cinterface'])) { foreach ($pconfig['cinterface'] as $cpbrif) { if (link_interface_to_bridge($cpbrif)) { $input_errors[] = sprintf(gettext("The captive portal cannot be used on interface %s since it is part of a bridge."), $cpbrif); } foreach ($a_cp as $cpkey => $cp) { if ($cpkey != $cpzone || empty($cpzone)) { if (in_array($cpbrif, explode(",", $cp['interface']))) { $input_errors[] = sprintf(gettext("The captive portal cannot be used on interface %s since it is used already on %s instance."), $cpbrif, $cp['zone']); } } } } } if ($_POST['httpslogin_enable']) { if (!$_POST['certref']) { $input_errors[] = gettext("Certificate must be specified for HTTPS login."); }
?> <div class="infoblock blockopen"> <?php print_info_box(gettext('This service can be used to wake up (power on) computers by sending special "Magic Packets".') . '<br />' . gettext('The NIC in the computer that is to be woken up must support Wake on LAN and must be properly configured (WOL cable, BIOS settings).'), 'info', false); ?> </div> <?php if ($input_errors) { print_input_errors($input_errors); } if ($savemsg) { print_info_box($savemsg, $class); } $form = new Form('Send'); $section = new Form_Section('Wake on LAN'); $section->addInput(new Form_Select('interface', 'Interface', link_interface_to_bridge($if) ? null : $if, get_configured_interface_with_descr()))->setHelp('Choose which interface the host to be woken up is connected to.'); $section->addInput(new Form_Input('mac', 'MAC address', 'text', $mac))->setHelp(gettext('Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx')); $form->add($section); print $form; ?> <div class="panel panel-default"> <div class="panel-heading"> <h2 class="panel-title"><?php echo gettext("Wake on LAN devices"); ?> </h2> </div> <div class="panel-body"> <p><?php
$wolent = array(); $wolent['interface'] = $_POST['interface']; $wolent['mac'] = $_POST['mac']; $wolent['descr'] = $_POST['descr']; if (isset($id) && $a_wol[$id]) { $a_wol[$id] = $wolent; } else { $a_wol[] = $wolent; } wol_sort(); write_config(); header("Location: services_wol.php"); exit; } } $pgtitle = array(gettext("Services"), gettext("Wake on LAN"), gettext("Edit")); include "head.inc"; if ($input_errors) { print_input_errors($input_errors); } $form = new Form(); if (isset($id) && $a_wol[$id]) { $form->addGlobal(new Form_Input('id', null, 'hidden', $id)); } $section = new Form_Section('Edit WOL entry'); $section->addInput(new Form_Select('interface', 'Interface', link_interface_to_bridge($pconfig['interface']) ? null : $pconfig['interface'], get_configured_interface_with_descr()))->setHelp('Choose which interface this host is connected to.'); $section->addInput(new Form_Input('mac', 'MAC address', 'text', $pconfig['mac']))->setHelp(gettext('Enter a MAC address in the following format: xx:xx:xx:xx:xx:xx')); $section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp(gettext('You may enter a description here for your reference (not parsed).')); $form->add($section); print $form; include "foot.inc";
<tr> <td width="22%" valign="top" class="vncell"><?php echo gettext("Source Address"); ?> </td> <td width="78%" class="vtable"> <select name="sourceip" class="form-control"> <option value=""><?php echo gettext('Default (any)'); ?> </option> <?php $sourceips = get_possible_traffic_source_addresses(false); foreach ($sourceips as $sip) { $selected = ""; if (!link_interface_to_bridge($sip['value']) && $sip['value'] == $pconfig['sourceip']) { $selected = 'selected="selected"'; } ?> <option value="<?php echo $sip['value']; ?> " <?php echo $selected; ?> > <?php echo htmlspecialchars($sip['name']); ?> </option> <?php
if (!is_array($config['dhcpdv6'][$if]['staticmap'])) { $config['dhcpdv6'][$if]['staticmap'] = array(); } $a_maps =& $config['dhcpdv6'][$if]['staticmap']; } $ifcfgip = get_interface_ipv6($if); $ifcfgsn = get_interface_subnetv6($if); /* set the enabled flag which will tell us if DHCP relay is enabled * on any interface. We will use this to disable DHCP server since * the two are not compatible with each other. */ $dhcrelay_enabled = false; $dhcrelaycfg = $config['dhcrelay6']; if (is_array($dhcrelaycfg)) { foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) { if (isset($dhcrelayifconf['enable']) && isset($iflist[$dhcrelayif]) && !link_interface_to_bridge($dhcrelayif)) { $dhcrelay_enabled = true; } } } if ($_POST) { unset($input_errors); $old_dhcpdv6_enable = $pconfig['enable'] == true; $new_dhcpdv6_enable = $_POST['enable'] ? true : false; $dhcpdv6_enable_changed = $old_dhcpdv6_enable != $new_dhcpdv6_enable; $pconfig = $_POST; $numberoptions = array(); for ($x = 0; $x < 99; $x++) { if (isset($_POST["number{$x}"]) && ctype_digit($_POST["number{$x}"])) { $numbervalue = array(); $numbervalue['number'] = htmlspecialchars($_POST["number{$x}"]);
<tr> <td width="22%" valign="top" class="vncellreq"><?php echo gettext("Interface"); ?> </td> <td width="78%" class="vtable"> <select name="interface" class="formfld"> <?php $interfaces = get_configured_interface_with_descr(); foreach ($interfaces as $iface => $ifacename) { ?> <option value="<?php echo $iface; ?> " <?php if (!link_interface_to_bridge($iface) && $iface == $pconfig['interface']) { echo "selected=\"selected\""; } ?> > <?php echo htmlspecialchars($ifacename); ?> </option> <?php } ?> </select> <br /> <span class="vexpl"><?php echo gettext("Choose which interface this host is connected to.");
?> </td> <td> <select name="sourceip" class="selectpicker" data-size="5" data-live-search="true"> <option value=""><?php echo gettext('Any'); ?> </option> <?php foreach (get_possible_traffic_source_addresses(true) as $sip) { ?> <option value="<?php echo $sip['value']; ?> " <?php echo !link_interface_to_bridge($sip['value']) && $sip['value'] == $sourceip ? "selected=\"selected\"" : ""; ?> > <?php echo htmlspecialchars($sip['name']); ?> </option> <?php } ?> </select> </td> </tr> <tr> <td> </td> <td><input name="Submit" type="submit" class="btn btn-primary" value="<?php
} $pconfig = array(); $pconfig['name'] = "ntpd"; $pconfig['description'] = gettext("NTP clock sync"); $services[] = $pconfig; if (isset($config['captiveportal']['enable'])) { $pconfig = array(); $pconfig['name'] = "captiveportal"; $pconfig['description'] = gettext("Captive Portal"); $services[] = $pconfig; } $iflist = array(); $ifdescrs = get_configured_interface_list(); foreach ($ifdescrs as $if) { $oc = $config['interfaces'][$if]; if ($oc['if'] && !link_interface_to_bridge($if)) { $iflist[$if] = $if; } } $show_dhcprelay = false; foreach ($iflist as $if) { if (isset($config['dhcrelay'][$if]['enable'])) { $show_dhcprelay = true; } } if ($show_dhcprelay == true) { $pconfig = array(); $pconfig['name'] = "dhcrelay"; $pconfig['description'] = gettext("DHCP Relay"); $services[] = $pconfig; }
$ifcfgip = '::'; $str_help_mask = dhcpv6_pd_str_help($ifcfgsn); } else { $ifcfgip = get_interface_ipv6($if); $ifcfgsn = get_interface_subnetv6($if); } /* set the enabled flag which will tell us if DHCP relay is enabled * on any interface. We will use this to disable DHCP server since * the two are not compatible with each other. */ $dhcrelay_enabled = false; $dhcrelaycfg = $config['dhcrelay6']; if (is_array($dhcrelaycfg) && isset($dhcrelaycfg['enable']) && isset($dhcrelaycfg['interface']) && !empty($dhcrelaycfg['interface'])) { $dhcrelayifs = explode(",", $dhcrelaycfg['interface']); foreach ($dhcrelayifs as $dhcrelayif) { if (isset($iflist[$dhcrelayif]) && !link_interface_to_bridge($dhcrelayif)) { $dhcrelay_enabled = true; break; } } } if (isset($_POST['apply'])) { $savemsg = dhcpv6_apply_changes(false); } elseif (isset($_POST['save'])) { unset($input_errors); $old_dhcpdv6_enable = $pconfig['enable'] == true; $new_dhcpdv6_enable = $_POST['enable'] ? true : false; $dhcpdv6_enable_changed = $old_dhcpdv6_enable != $new_dhcpdv6_enable; $pconfig = $_POST; $numberoptions = array(); for ($x = 0; $x < 99; $x++) {
} } write_config(); enable_rrd_graphing(); } } else { unset($delbtn); if (!empty($_POST['del'])) { $delbtn = key($_POST['del']); } if (isset($delbtn)) { $id = $delbtn; if (link_interface_to_group($id)) { $input_errors[] = gettext("The interface is part of a group. Please remove it from the group to continue"); } else { if (link_interface_to_bridge($id)) { $input_errors[] = gettext("The interface is part of a bridge. Please remove it from the bridge to continue"); } else { if (link_interface_to_gre($id)) { $input_errors[] = gettext("The interface is part of a gre tunnel. Please delete the tunnel to continue"); } else { if (link_interface_to_gif($id)) { $input_errors[] = gettext("The interface is part of a gif tunnel. Please delete the tunnel to continue"); } else { unset($config['interfaces'][$id]['enable']); $realid = get_real_interface($id); interface_bring_down($id); /* down the interface */ unset($config['interfaces'][$id]); /* delete the specified OPTn or LAN*/ if (is_array($config['dhcpd']) && is_array($config['dhcpd'][$id])) {
?> </td> </tr> <tr> <td width="22%" valign="top" class="vncell"><?php echo gettext("Source Address"); ?> </td> <td width="78%" class="vtable"> <select name="sourceip" class="formselect"> <option value="">Default (any)</option> <?php $sourceips = get_possible_traffic_source_addresses(false); foreach ($sourceips as $sipvalue => $sipname) { $selected = ""; if (!link_interface_to_bridge($sipvalue) && $sipvalue == $pconfig['sourceip']) { $selected = 'selected="selected"'; } ?> <option value="<?php echo $sipvalue; ?> " <?php echo $selected; ?> > <?php echo htmlspecialchars($sipname); ?> </option> <?php
</tr> <tr> <td><?=gettext("IP Protocol"); ?></td> <td><select name="ipproto" class="form-control"> <option value="ipv4" <?php if ($ipproto == "ipv4") echo "selected=\"selected\"" ?>>IPv4</option> <option value="ipv6" <?php if ($ipproto == "ipv6") echo "selected=\"selected\"" ?>>IPv6</option> </select></td> </tr> <tr> <td><?=gettext("Source Address"); ?></td> <td><select name="sourceip" class="form-control"> <option value="">Any</option> <?php $sourceips = get_possible_traffic_source_addresses(true); foreach ($sourceips as $sip): $selected = ""; if (!link_interface_to_bridge($sip['value']) && ($sip['value'] == $sourceip)) $selected = "selected=\"selected\""; ?> <option value="<?=$sip['value'];?>" <?=$selected;?>> <?=htmlspecialchars($sip['name']);?> </option> <?php endforeach; ?> </select></td> </tr> <tr> <td><?=gettext("Maximum number of hops");?></td> <td><select name="ttl" class="form-control" id="ttl"> <?php for ($i = 1; $i <= MAX_TTL; $i++): ?> <option value="<?=$i;?>" <?php if ($i == $ttl) echo "selected=\"selected\""; ?>><?=$i;?></option> <?php endfor; ?> </select></td>
$ifcfgip = get_interface_ipv6($if); $ifcfgsn = get_interface_subnetv6($if); /* set the enabled flag which will tell us if DHCP relay is enabled * on any interface. We will use this to disable DHCP server since * the two are not compatible with each other. */ $dhcrelay_enabled = false; $dhcrelaycfg = $config['dhcrelay6']; if(is_array($dhcrelaycfg)) { foreach ($dhcrelaycfg as $dhcrelayif => $dhcrelayifconf) { if (isset($dhcrelayifconf['enable']) && isset($iflist[$dhcrelayif]) && (!link_interface_to_bridge($dhcrelayif))) $dhcrelay_enabled = true; } } if ($_POST) { unset($input_errors); if ($_POST['apply'] != 'Apply changes') { $old_dhcpdv6_enable = ($pconfig['enable'] == true); $new_dhcpdv6_enable = ($_POST['enable'] ? true : false); $dhcpdv6_enable_changed = ($old_dhcpdv6_enable != $new_dhcpdv6_enable); $pconfig = $_POST; } else { $dhcpdv6_enable_changed = false;