$section->addInput(new Form_Input('pppoe_username', 'Username', 'text', $pconfig['pppoe_username'])); $section->addInput(new Form_Input('pppoe_password', 'Password', 'password', $pconfig['pppoe_password'])); $section->addInput(new Form_Input('provider', 'Service name', 'text', $pconfig['provider']))->setHelp('This field can usually be left empty'); $section->addInput(new Form_Checkbox('pppoe_dialondemand', 'Dial on demand', 'Enable Dial-On-Demand mode ', $pconfig['pppoe_dialondemand'], 'enable')); $section->addInput(new Form_Input('pppoe_idletimeout', 'Idle timeout', 'number', $pconfig['pppoe_idletimeout'], [min => 0]))->setHelp('If no qualifying outgoing packets are transmitted for the specified number of seconds, the connection is brought down. ' . 'An idle timeout of zero disables this feature.'); $section->addInput(new Form_Select('pppoe-reset-type', 'Periodic reset', $pconfig['pppoe-reset-type'], ['' => 'Disabled', 'custom' => 'Custom', 'preset' => 'Pre-set']))->setHelp('Select a reset timing type'); $group = new Form_Group('Custom reset'); $group->addClass('pppoecustom'); $group->add(new Form_Input('pppoe_resethour', null, 'number', $pconfig['pppoe_resethour'], [min => 0, max => 23]))->setHelp('Hour (0-23)'); $group->add(new Form_Input('pppoe_resetminute', null, 'number', $pconfig['pppoe_resetminute'], [min => 0, max => 59]))->setHelp('Minutes (0-59)'); // ToDo: Need a date-picker here $group->add(new Form_Input('pppoe_resetdate', null, 'text', $pconfig['pppoe_resetdate']))->setHelp('Specific date (mm/dd/yyyy)'); $group->setHelp('If you leave the date field empty, the reset will be executed each day at the time you specified using the minutes and hour field'); $section->add($group); $group = new Form_MultiCheckboxGroup('cron based reset'); $group->addClass('pppoepreset'); $group->add(new Form_MultiCheckbox('pppoe_pr_preset_val', null, 'Reset at each month ("0 0 1 * *")', $pconfig['pppoe_monthly'], 'monthly'))->displayAsRadio(); $group->add(new Form_MultiCheckbox('pppoe_pr_preset_val', null, 'Reset at each week ("0 0 * * 0")', $pconfig['pppoe_weekly'], 'weekly'))->displayAsRadio(); $group->add(new Form_MultiCheckbox('pppoe_pr_preset_val', null, 'Reset at each day ("0 0 * * *")', $pconfig['pppoe_daily'], 'daily'))->displayAsRadio(); $group->add(new Form_MultiCheckbox('pppoe_pr_preset_val', null, 'Reset at each hour ("0 * * * *")', $pconfig['pppoe_hourly'], 'hourly'))->displayAsRadio(); $section->add($group); if (isset($pconfig['pppid'])) { $section->addInput(new Form_StaticText('Advanced and MLPPP', '<a href="/interfaces_ppps_edit.php?id=' . htmlspecialchars($pconfig['pppid']) . '" class="navlnk">Click here for additional PPPoE configuration options. Save first if you made changes.</a>')); } else { $section->addInput(new Form_StaticText('Advanced and MLPPP', '<a href="/interfaces_ppps_edit.php" class="navlnk">Click here for additional PPPoE configuration options and for MLPPP configuration.</a>')); } $form->add($section); // PPTP & L2TP Configuration section $section = new Form_Section('PPTP/L2TP Configuration'); $section->addClass('pptp'); $section->addInput(new Form_Input('pptp_username', 'Username', 'text', $pconfig['pptp_username']));
$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'])); $group->add(new Form_MultiCheckbox('vpn', null, 'VPN (PPTP, IPsec, OpenVPN) events', $pconfig['vpn'])); $group->add(new Form_MultiCheckbox('apinger', null, 'Gateway Monitor events', $pconfig['apinger'])); $group->add(new Form_MultiCheckbox('relayd', null, 'Server Load Balancer events', $pconfig['relayd'])); $group->add(new Form_MultiCheckbox('hostapd', null, 'Wireless events', $pconfig['hostapd'])); // Ugly hack to prevent the "Toggle all" button from being automatically created $group->add(new Form_MultiCheckbox('notoggleall', null, 'No toggle all', $pconfig['hostapd']))->displayAsRadio(); $group->setHelp('Syslog sends UDP datagrams to port 514 on the specified remote ' . 'syslog server, unless another port is specified. Be sure to set syslogd on ' . 'the remote server to accept syslog messages from pfSense.'); $section->add($group); $form->add($section); print $form;