コード例 #1
0
ファイル: interfaces.php プロジェクト: simudream/pfsense
$section->addClass('pppoe');
$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');
コード例 #2
0
$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']));
$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);
コード例 #3
0
ファイル: services_snmp.php プロジェクト: nwholloway/pfsense
$form->add($section);
$section = new Form_Section('SNMP Traps Enable');
$section->addInput(new Form_Checkbox('trapenable', 'Enable', 'Enable the SNMP Trap and its controls', $pconfig['trapenable']))->toggles('.toggle-traps');
$form->add($section);
$section = new Form_Section('SNMP Trap Settings');
if ($pconfig['trapenable']) {
    $section->addClass('toggle-traps', 'in');
} else {
    $section->addClass('toggle-traps', 'collapse');
}
$section->addInput(new Form_Input('trapserver', 'Trap server', 'text', $pconfig['trapserver']))->setHelp('Enter the trap server name');
$section->addInput(new Form_Input('trapserverport', 'Trap Server Port', 'text', $pconfig['trapserverport'] ? $pconfig['trapserverport'] : '162'))->setHelp('Enter the port to send the traps to (default 162)');
$section->addInput(new Form_Input('trapstring', 'SNMP Trap String', 'text', $pconfig['trapstring']));
$form->add($section);
$section = new Form_Section('SNMP Modules');
$group = new Form_MultiCheckboxGroup('SNMP modules');
$group->add(new Form_MultiCheckbox('mibii', null, 'MibII', $pconfig['mibii']));
$group->add(new Form_MultiCheckbox('netgraph', null, 'Netgraph', $pconfig['netgraph']));
$group->add(new Form_MultiCheckbox('pf', null, 'PF', $pconfig['pf']));
$group->add(new Form_MultiCheckbox('hostres', null, 'Host Resources', $pconfig['hostres']));
$group->add(new Form_MultiCheckbox('ucd', null, 'UCD', $pconfig['ucd']));
$group->add(new Form_MultiCheckbox('regex', null, 'Regex', $pconfig['regex']));
$section->add($group);
$form->add($section);
$section = new Form_Section('Interface Binding');
$section->addInput(new Form_Select('bindip', 'Bind Interface', $pconfig['bindip'], build_iplist()));
$form->add($section);
print $form;
?>

<script type="text/javascript">
コード例 #4
0
 $authcfg['ldap_port'] = $_REQUEST['port'];
 $authcfg['ldap_basedn'] = $_REQUEST['basedn'];
 $authcfg['host'] = $_REQUEST['host'];
 $authcfg['ldap_scope'] = $_REQUEST['scope'];
 $authcfg['ldap_binddn'] = $_REQUEST['binddn'];
 $authcfg['ldap_bindpw'] = $_REQUEST['bindpw'];
 $authcfg['ldap_urltype'] = $_REQUEST['urltype'];
 $authcfg['ldap_protver'] = $_REQUEST['proto'];
 $authcfg['ldap_authcn'] = explode(";", $_REQUEST['authcn']);
 $authcfg['ldap_caref'] = $_REQUEST['cert'];
 $ous = ldap_get_user_ous(true, $authcfg);
 if (empty($ous)) {
     print '<span class="text-danger">Could not connect to the LDAP server. Please check the LDAP configuration.</span>';
 } else {
     $modal = new Modal("Select LDAP containers for authentication", "containers", true);
     $group = new Form_MultiCheckboxGroup('Containers');
     if (is_array($ous)) {
         $idx = 0;
         foreach ($ous as $ou) {
             $group->add(new Form_MultiCheckbox('ou' . $idx, '', $ou, in_array($ou, $authcfg['ldap_authcn']), $ou));
             $idx++;
         }
     }
     $modal->add($group);
     // Create a "Save button"
     $btnsv = new Form_Button('svcontbtn', 'Save', null, 'fa-save');
     $btnsv->removeClass("btn-default)")->addClass("btn-primary");
     $modal->addInput(new Form_StaticText('', $btnsv));
     print $modal;
 }
 exit;
コード例 #5
0
ファイル: system_hasync.php プロジェクト: dariomas/pfsense
foreach ($ifaces as $ifname => $iface) {
    $iflist[$ifname] = $iface;
}
include "head.inc";
require_once 'classes/Form.class.php';
$form = new Form();
$section = new Form_Section('State Synchronization Settings (pfsync)');
$section->addInput(new Form_Checkbox('pfsyncenabled', 'Synchronize states', 'pfsync transfers state insertion, update, and deletion messages between firewalls.', $pconfig['pfsyncenabled'] === 'on', 'on'))->setHelp('Each firewall sends these messages out via multicast on a specified interface, using the PFSYNC protocol (IP Protocol 240).' . ' It also listens on that interface for similar messages from other firewalls, and imports them into the local state table.<br />' . 'This setting should be enabled on all members of a failover group.<br />' . 'Clicking "Save" will force a configuration sync if it is enabled! (see Configuration Synchronization Settings below)');
$section->addInput(new Form_Select('pfsyncinterface', 'Synchorize Interface', $pconfig['pfsyncinterface'], $iflist))->setHelp('If Synchronize States is enabled this interface will be used for communication.<br />' . 'We recommend setting this to an interface other than LAN!	A dedicated interface works the best.<br />' . 'You must define a IP on each machine participating in this failover group.<br />' . 'You must have an IP assigned to the interface on any participating sync nodes.');
$section->addInput(new Form_Input('pfsyncpeerip', 'pfsync Synchronize Peer IP', 'text', $pconfig['pfsyncpeerip'], ['placeholder' => 'IP Address']))->setHelp('Setting this option will force pfsync to synchronize its state table to this IP address.  The default is directed multicast.');
$form->add($section);
$section = new Form_Section('Configuration Synchronization Settings (XMLRPC Sync)');
$section->addInput(new Form_Input('synchronizetoip', 'Synchronize Config to IP', 'text', $pconfig['synchronizetoip'], ['placeholder' => 'IP Address']))->setHelp('Enter the IP address of the firewall to which the selected configuration sections should be synchronized.<br /><br />' . 'XMLRPC sync is currently only supported over connections using the same protocol and port as this system - make sure the remote system\'s port and protocol are set accordingly!<br />' . 'Do not use the Synchronize Config to IP and password option on backup cluster members!');
$section->addInput(new Form_Input('username', 'Remote System Username', 'text', $pconfig['username']))->setHelp('Enter the webConfigurator username of the system entered above for synchronizing your configuration.<br />' . 'Do not use the Synchronize Config to IP and username option on backup cluster members!');
$section->addInput(new Form_Input('passwordfld', 'Remote System Password', 'password', $pconfig['passwordfld']))->setHelp('Enter the webConfigurator password of the system entered above for synchronizing your configuration.<br />' . 'Do not use the Synchronize Config to IP and password option on backup cluster members!');
$group = new Form_MultiCheckboxGroup('Select options to sync');
$group->add(new Form_MultiCheckbox('synchronizeusers', 'Synchronize Users and Groups', 'User manager users and groups', $pconfig['synchronizeusers'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizeauthservers', 'Synchronize Auth Servers', 'Authentication servers (e.g. LDAP, RADIUS)', $pconfig['synchronizeauthservers'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizecerts', 'Synchronize Certificates', 'Certificate Authorities, Certificates, and Certificate Revocation Lists', $pconfig['synchronizecerts'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizerules', 'Synchronize Rules', 'Firewall rules ', $pconfig['synchronizerules'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizeschedules', 'Synchronize Firewall schedules', 'Firewall schedules ', $pconfig['synchronizeschedules'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizealiases', 'Synchronize Firewall aliases', 'Firewall aliases ', $pconfig['synchronizealiases'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizenat', 'Synchronize NAT', 'NAT configuration ', $pconfig['synchronizenat'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizeipsec', 'Synchronize IPsec', 'IPsec configuration ', $pconfig['synchronizeipsec'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizeopenvpn', 'Synchronize OpenVPN', 'OpenVPN configuration ', $pconfig['synchronizeopenvpn'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizedhcpd', 'Synchronize DHCPD', 'DHCP Server settings ', $pconfig['synchronizedhcpd'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizewol', 'Synchronize Wake on LAN', 'WoL Server settings ', $pconfig['synchronizewol'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizestaticroutes', 'Synchronize Static Routes', 'Static Route configuration ', $pconfig['synchronizestaticroutes'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizelb', 'Synchronize Load Balancer', 'Load Balancer configuration ', $pconfig['synchronizelb'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizevirtualip', 'Synchronize Virtual IPs', 'Virtual IPs ', $pconfig['synchronizevirtualip'] === 'on', 'on'));
$group->add(new Form_MultiCheckbox('synchronizetrafficshaper', 'Synchronize traffic shaper (queues)', 'Traffic Shaper configuration ', $pconfig['synchronizetrafficshaper'] === 'on', 'on'));
コード例 #6
0
$section->addInput(new Form_Checkbox('disablelocallogging', 'Local Logging', "Disable writing log files to the local disk", $pconfig['disablelocallogging']));
$section->addInput(new Form_Button('resetlogs', 'Reset Log Files', null, 'fa-trash'))->addClass('btn-danger btn-sm')->setHelp('Clears all local log files and reinitializes them as empty logs. This also restarts the DHCP daemon. Use the Save button first if any setting changes have been made.');
$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('resolver', null, 'DNS Events (Resolver/unbound, Forwarder/dnsmasq, filterdns)', $pconfig['resolver']));
$group->add(new Form_MultiCheckbox('dhcp', null, 'DHCP Events (DHCP Daemon, DHCP Relay, DHCP Client)', $pconfig['dhcp']));
$group->add(new Form_MultiCheckbox('ppp', null, 'PPP Events (PPPoE WAN Client, L2TP WAN Client, PPTP WAN Client)', $pconfig['ppp']));
$group->add(new Form_MultiCheckbox('portalauth', null, 'Captive Portal Events', $pconfig['portalauth']));
$group->add(new Form_MultiCheckbox('vpn', null, 'VPN Events (IPsec, OpenVPN, L2TP, PPPoE Server)', $pconfig['vpn']));
$group->add(new Form_MultiCheckbox('dpinger', null, 'Gateway Monitor Events', $pconfig['dpinger']));
$group->add(new Form_MultiCheckbox('routing', null, 'Routing Daemon Events (RADVD, UPnP, RIP, OSPF, BGP)', $pconfig['routing']));
$group->add(new Form_MultiCheckbox('relayd', null, 'Server Load Balancer Events (relayd)', $pconfig['relayd']));
$group->add(new Form_MultiCheckbox('ntpd', null, 'Network Time Protocol Events (NTP Daemon, NTP Client)', $pconfig['ntpd']));
$group->add(new Form_MultiCheckbox('hostapd', null, 'Wireless Events (hostapd)', $pconfig['hostapd']));
$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.');