本文整理汇总了PHP中Form_Group::addClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Form_Group::addClass方法的具体用法?PHP Form_Group::addClass怎么用?PHP Form_Group::addClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form_Group
的用法示例。
在下文中一共展示了Form_Group::addClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
}
$ruleValues[$ifent] = $ifdesc . ' net';
$ruleValues[$ifent . 'ip'] = $ifdesc . ' address';
}
$group->add(new Form_Select($type . 'type', $name . ' Type', $type == 'src' ? $pconfig['src'] : $pconfig['dst'], $ruleValues));
$group->add(new Form_IpAddress($type, $name . ' Address', $pconfig[$type]))->addMask($type . 'mask', $pconfig[$type . 'mask'])->setPattern('[0-9, a-z, A-Z and .');
$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).');
示例2: options
$section->addInput(new Form_Checkbox('ntp_server_enable', 'NTP Servers', 'Provide an NTP server list to clients', $pconfig['ntp_server_enable']))->toggles('.ntpservers');
$group = new Form_Group(null);
$group->addClass('ntpservers');
$group->add(new Form_Input('ntp_server1', null, 'text', $pconfig['ntp_server1']))->setHelp('Server 1');
$group->add(new Form_Input('ntp_server2', null, 'text', $pconfig['ntp_server2']))->setHelp('Server 2');
$section->add($group);
// NTP servers - For this section we need to use Javascript hiding since there
// are nested toggles
$section->addInput(new Form_Checkbox('netbios_enable', 'NetBIOS Options', 'Enable NetBIOS over TCP/IP', $pconfig['netbios_enable']))->setHelp('If this option is not set, all NetBIOS-over-TCP/IP options (including WINS) will be disabled. ');
$section->addInput(new Form_Select('netbios_ntype', 'Node Type', $pconfig['netbios_ntype'], $netbios_nodetypes))->setHelp('Possible options: b-node (broadcasts), p-node (point-to-point name queries to a WINS server), m-node (broadcast then query name server), ' . 'and h-node (query name server, then broadcast). ');
$section->addInput(new Form_Input('netbios_scope', null, 'text', $pconfig['netbios_scope']))->setHelp('A NetBIOS Scope ID provides an extended naming service for NetBIOS over TCP/IP. ' . 'The NetBIOS scope ID isolates NetBIOS traffic on a single network to only those nodes with the same NetBIOS scope ID. ');
$section->addInput(new Form_Checkbox('wins_server_enable', 'WINS servers', 'Provide a WINS server list to clients', $pconfig['wins_server_enable']));
$group = new Form_Group(null);
$group->add(new Form_Input('wins_server1', null, 'text', $pconfig['wins_server1']))->setHelp('Server 1');
$group->add(new Form_Input('wins_server2', null, 'text', $pconfig['wins_server2']))->setHelp('Server 2');
$group->addClass('winsservers');
$section->add($group);
$section->addInput(new Form_Textarea('custom_options', 'Advanced', $pconfig['custom_options']))->setHelp('Enter any additional options you would like to add for this client specific override, separated by a semicolon. ' . '<br />' . 'EXAMPLE: push "route 10.0.0.0 255.255.255.0"; ');
// The hidden fields
$section->addInput(new Form_Input('act', null, 'hidden', $act));
if (isset($id) && $a_csc[$id]) {
$section->addInput(new Form_Input('id', null, 'hidden', $id));
}
$form->add($section);
print $form;
?>
<script type="text/javascript">
//<![CDATA[
events.push(function() {
示例3: Form
display_top_tabs($tab_array);
$form = new Form();
$section = new Form_Section('Start IPsec in debug mode based on sections selected');
foreach ($ipsec_log_cats as $cat => $desc) {
$section->addInput(new Form_Select($cat, $desc, $pconfig[$cat], $ipsec_log_sevs))->setWidth(2);
}
$section->addInput(new Form_StaticText('', ''))->setHelp('Launches IPsec in debug mode so that more verbose logs will be generated to aid in troubleshooting.');
$form->add($section);
$section = new Form_Section('IPsec Advanced Settings');
$section->addInput(new Form_Select('uniqueids', 'Configure Unique IDs as', $pconfig['uniqueids'], $ipsec_idhandling))->setHelp('Whether a particular participant ID should be kept unique, with any new IKE_SA using an ID ' . 'deemed to replace all old ones using that ID. Participant IDs normally are unique, so a new ' . 'IKE_SA using the same ID is almost invariably intended to replace an old one. ' . 'The difference between <b>no</b> and <b>never</b> is that the old IKE_SAs will be replaced when receiving an ' . 'INITIAL_CONTACT notify if the option is no but will ignore these notifies if <b>never</b> is configured. ' . 'The daemon also accepts the value <b>keep</b> to reject ' . 'new IKE_SA setups and keep the duplicate established earlier. Defaults to Yes.');
$section->addInput(new Form_Checkbox('compression', 'IP Compression', 'Enable IPCompression', $pconfig['compression']))->setHelp('IPComp compression of content is proposed on the connection.');
$section->addInput(new Form_Checkbox('enableinterfacesuse', 'Strict interface binding', 'Enable strict interface binding', $pconfig['enableinterfacesuse']))->setHelp('Enable strongSwan\'s interfaces_use option to bind specific interfaces only. This option is known to break IPsec with dynamic IP interfaces. This is not recommended at this time.');
$section->addInput(new Form_Checkbox('acceptunencryptedmainmode', 'Unencrypted payloads in IKEv1 Main Mode', 'Accept unencrypted ID and HASH payloads in IKEv1 Main Mode', $pconfig['acceptunencryptedmainmode']))->setHelp('Some implementations send the third Main Mode message unencrypted, probably to find the PSKs for the specified ID for authentication.' . 'This is very similar to Aggressive Mode, and has the same security implications: ' . 'A passive attacker can sniff the negotiated Identity, and start brute forcing the PSK using the HASH payload.' . 'It is recommended to keep this option to no, unless you know exactly what the implications are and require compatibility to such devices (for example, some SonicWall boxes).');
$section->addInput(new Form_Checkbox('maxmss_enable', 'Enable Maximum MSS', 'Enable MSS clamping on VPN traffic', $pconfig['maxmss_enable']))->toggles('.toggle-maxmss', 'collapse');
$group = new Form_Group('Maximum MSS');
$group->addClass('toggle-maxmss collapse');
if (!empty($pconfig['maxmss_enable'])) {
$group->addClass('in');
}
$group->add(new Form_Input('maxmss', 'Maximum MSS', 'text', $pconfig['maxmss'] ? $pconfig['maxmss'] : '1400'))->setHelp('Enable MSS clamping on TCP flows over VPN. ' . 'This helps overcome problems with PMTUD on IPsec VPN links. If left blank, the default value is 1400 bytes. ');
$section->add($group);
$section->addInput(new Form_Checkbox('unityplugin', 'Disable Cisco Extensions', 'Disable Unity Plugin', $pconfig['unityplugin']))->setHelp('Disable Unity Plugin which provides Cisco Extension support as Split-Include, Split-Exclude, Split-Dns, ...');
$section->addInput(new Form_Checkbox('strictcrlpolicy', 'Strict CRL Checking', 'Enable strict Certificate Revocation List checking', $pconfig['strictcrlpolicy']))->setHelp('Check this to require availability of a fresh CRL for peer authentication based on RSA signatures to succeed.');
$section->addInput(new Form_Checkbox('makebeforebreak', 'Make before Break', 'Initiate IKEv2 reauthentication with a make-before-break', $pconfig['makebeforebreak']))->setHelp('instead of a break-before-make scheme. Make-before-break uses overlapping IKE and CHILD_SA during reauthentication ' . 'by first recreating all new SAs before deleting the old ones. This behavior can be beneficial to avoid connectivity gaps ' . 'during reauthentication, but requires support for overlapping SAs by the peer');
$section->addInput(new Form_Checkbox('autoexcludelanaddress', 'Auto-exclude LAN address', 'Enable bypass for LAN interface IP', !$pconfig['noshuntlaninterfaces']))->setHelp('Exclude traffic from LAN subnet to LAN IP address from IPsec.');
$form->add($section);
print $form;
?>
<?php
include "foot.inc";
示例4: htmlspecialchars
}
$section->addInput(new Form_Checkbox('wins_server_enable', 'WINS Servers', 'Provide a WINS server list to clients', $pconfig['wins_server_enable']))->toggles('.toggle-wins_server_enable');
for ($i = 1; $i <= 2; $i++) {
$group = new Form_Group('Server #' . $i);
$group->addClass('toggle-wins_server_enable collapse');
if (!empty($pconfig['wins_server_enable'])) {
$group->addClass('in');
}
$group->add(new Form_Input('wins_server' . $i, 'Server #' . $i, 'text', htmlspecialchars($pconfig['wins_server' . $i]), array('size' => 20)));
$section->add($group);
}
$section->addInput(new Form_Checkbox('pfs_group_enable', 'Phase2 PFS Group', 'Provide the Phase2 PFS group to clients ( overrides all mobile phase2 settings )', $pconfig['pfs_group_enable']))->toggles('.toggle-pfs_group');
$group = new Form_Group('Group');
$group->addClass('toggle-pfs_group collapse');
if (!empty($pconfig['pfs_group_enable'])) {
$group->addClass('in');
}
$group->add(new Form_Select('pfs_group', 'Group', $pconfig['pfs_group'], $p2_pfskeygroups))->setWidth(2);
$section->add($group);
$section->addInput(new Form_Checkbox('login_banner_enable', 'Login Banner', 'Provide a login banner to clients', $pconfig['login_banner_enable']))->toggles('.toggle-login_banner');
$group = new Form_Group('');
$group->addClass('toggle-login_banner collapse');
if (!empty($pconfig['login_banner_enable'])) {
$group->addClass('in');
}
// TODO: should be a textarea
$group->add(new Form_Input('login_banner', '', 'text', htmlspecialchars($pconfig['login_banner'])));
$section->add($group);
$form->add($section);
print $form;
include "foot.inc";
示例5: timestamp
$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 . ' ' . '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 "$" and "*" 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++) {
checksum = checksum ^ cmd.charCodeAt(i);
示例6: array
$section->addInput(new Form_Input('ramaxrtradvinterval', 'Maximum RA interval', 'number', $pconfig['ramaxrtradvinterval'], ['min' => 4, 'max' => 1800]))->setHelp('The maximum time allowed between sending unsolicited multicast router advertisements in seconds.');
$section->addInput(new Form_Input('raadvdefaultlifetime', 'Router lifetime', 'number', $pconfig['raadvdefaultlifetime'], ['min' => 1, 'max' => 9000]))->setHelp('The lifetime associated with the default router in seconds.');
$section->addInput(new Form_StaticText('RA Subnets', $subnets_help));
if (empty($pconfig['subnets'])) {
$pconfig['subnets'] = array('0' => '/128');
}
$counter = 0;
$numrows = count($pconfig['subnets']) - 1;
foreach ($pconfig['subnets'] as $subnet) {
$address_name = "subnet_address" . $counter;
$bits_name = "subnet_bits" . $counter;
list($address, $subnet) = explode("/", $subnet);
$group = new Form_Group($counter == 0 ? 'Subnets' : '');
$group->add(new Form_IpAddress($address_name, null, $address))->addMask($bits_name, $subnet);
$group->add(new Form_Button('deleterow' . $counter, 'Delete', null, 'fa-trash'))->removeClass('btn-primary')->addClass('btn-warning');
$group->addClass('repeatable');
$section->add($group);
$counter++;
}
$section->addInput(new Form_Button('addrow', 'Add', null, 'fa-plus'))->addClass('btn-success');
$form->add($section);
$section = new Form_Section('DNS Configuration');
for ($idx = 1; $idx <= 3; $idx++) {
$section->addInput(new Form_IpAddress('radns' . $idx, 'Server ' . $idx, $pconfig['radns' . $idx]))->setPattern('[a-zA-Z0-9_.:]+')->setHelp($idx < 3 ? '' : '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->addInput(new Form_Input('radomainsearchlist', 'Domain search list', 'text', $pconfig['radomainsearchlist']))->setHelp('The RA server can optionally provide a domain search list. Use the semicolon character as separator.');
$section->addInput(new Form_Checkbox('rasamednsasdhcp6', 'Settings', 'Use same settings as DHCPv6 server', $pconfig['rasamednsasdhcp6']));
$section->addInput(new Form_Input('if', null, 'hidden', $if));
$form->add($section);
print $form;
?>
示例7: isset
return $list;
}
$section->addInput(new Form_Select('port', "Modem port", $pconfig['port'], build_port_list()));
$section->addInput(new Form_Button('btnadvppp', 'Advanced PPP', isset($pconfig['pppid']) ? 'interfaces_ppps_edit.php?id=' . htmlspecialchars($pconfig['pppid']) : 'interfaces_ppps_edit.php'))->setHelp('Create a new PPP configuration');
$form->add($section);
// PPPoE configuration
$section = new Form_Section('PPPoE Configuration');
$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>'));
示例8: array
$group = new Form_Group('Search scope');
$SSF = new Form_Select('ldap_scope', 'Level', $pconfig['ldap_scope'], $ldap_scopes);
$SSB = new Form_Input('ldap_basedn', 'Base DN', 'text', $pconfig['ldap_basedn']);
$section->addInput(new Form_StaticText('Search scope', 'Level ' . $SSF . '<br />' . 'Base DN' . $SSB));
$group = new Form_Group('Authentication containers');
$group->add(new Form_Input('ldapauthcontainers', 'Containers', 'text', $pconfig['ldap_authcn']))->setHelp('Note: Semi-Colon separated. This will be prepended to the search ' . 'base dn above or the full container path can be specified containing a dc= ' . 'component.<br/>Example: CN=Users;DC=example,DC=com or OU=Staff;OU=Freelancers');
$group->add(new Form_Button('Select', 'Select a container', null, 'fa-search'))->setAttribute('type', 'button')->addClass('btn-info');
$section->add($group);
$section->addInput(new Form_Checkbox('ldap_extended_enabled', 'Extended query', 'Enable extended query', $pconfig['ldap_extended_enabled']));
$group = new Form_Group('Query');
$group->addClass('extended');
$group->add(new Form_Input('ldap_extended_query', 'Query', 'text', $pconfig['ldap_extended_query']))->setHelp('Example: &(objectClass=inetOrgPerson)(mail=*@example.com)');
$section->add($group);
$section->addInput(new Form_Checkbox('ldap_anon', 'Bind anonymous', 'Use anonymous binds to resolve distinguished names', $pconfig['ldap_anon']));
$group = new Form_Group('Bind credentials');
$group->addClass('ldapanon');
$group->add(new Form_Input('ldap_binddn', 'User DN:', 'text', $pconfig['ldap_binddn']));
$group->add(new Form_Input('ldap_bindpw', 'Password', 'text', $pconfig['ldap_bindpw']));
$section->add($group);
if (!isset($id)) {
$template_list = array();
foreach ($ldap_templates as $option => $template) {
$template_list[$option] = $template['desc'];
}
$section->addInput(new Form_Select('ldap_tmpltype', 'Initial Template', $pconfig['ldap_template'], $template_list));
}
$section->addInput(new Form_Input('ldap_attr_user', 'User naming attribute', 'text', $pconfig['ldap_attr_user']));
$section->addInput(new Form_Input('ldap_attr_group', 'Group naming attribute', 'text', $pconfig['ldap_attr_group']));
$section->addInput(new Form_Input('ldap_attr_member', 'Group member attribute', 'text', $pconfig['ldap_attr_member']));
$section->addInput(new Form_Checkbox('ldap_rfc2307', 'RFC 2307 Groups', 'LDAP Server uses RFC 2307 style group membership', $pconfig['ldap_rfc2307']))->setHelp('RFC 2307 style group membership has members listed on the group ' . 'object rather than using groups listed on user object. Leave unchecked ' . 'for Active Directory style group membership (RFC 2307bis).');
$section->addInput(new Form_Input('ldap_attr_groupobj', 'Group Object Class', 'text', $pconfig['ldap_attr_groupobj'], ['placeholder' => 'posixGroup']))->setHelp('Object class used for groups in RFC2307 mode. ' . 'Typically "posixGroup" or "group".');
示例9: foreach
}
}
$selected = '0';
$vaddress = '';
foreach ((array) $pconfig['item'] as $item) {
$itemsplit = explode("|", $item);
if ($itemsplit[0] == $gwname) {
$selected = $itemsplit[1];
if (count($itemsplit) >= 3) {
$vaddress = $itemsplit[2];
}
break;
}
}
$group = new Form_Group(null);
$group->addClass($gateway['ipprotocol']);
$group->add(new Form_Input('gwname' . $row, 'Group Name', 'text', $gateway['name']))->setReadonly();
$tr = gettext("Tier");
$group->add(new Form_Select($gwname, 'Tier', $selected, array('0' => 'Never', '1' => $tr . ' 1', '2' => $tr . ' 2', '3' => $tr . ' 3', '4' => $tr . ' 4', '5' => $tr . ' 5')))->addClass('row')->addClass($gateway['ipprotocol']);
$group->add(new Form_Select($gwname . '_vip', 'Virtual IP', $vaddress, build_vip_list($gateway['ipprotocol'])));
$group->add(new Form_Input('description', 'Group Name', 'text', $gateway['descr']))->setWidth(3)->setReadonly();
$section->add($group);
$row++;
}
// e-o-foreach
$group = new Form_Group(null);
$group->add(new Form_StaticText('', ''))->setHelp('Gateway')->setReadonly();
$group->add(new Form_StaticText('', ''))->setHelp('Tier')->setReadonly();
$group->add(new Form_StaticText('', ''))->setHelp('Virtual IP')->setReadonly();
$group->add(new Form_StaticText('', ''))->setWidth(3)->setHelp('Description')->setReadonly();
$section->add($group);
示例10: array
$form->addGlobal(new Form_Input('friendlyiface', null, 'hidden', $pconfig['friendlyiface']));
$section = new Form_Section('Edit Gateway');
$section->addInput(new Form_Checkbox('disabled', 'Disabled', 'Disable this gateway', $pconfig['disabled']))->setHelp('Set this option to disable this gateway without removing it from the ' . 'list.');
$section->addInput(new Form_Select('interface', 'Interface', $pconfig['friendlyiface'], get_configured_interface_with_descr(false, true)))->setHelp('Choose which interface this gateway applies to.');
$section->addInput(new Form_Select('ipprotocol', 'Address Family', $pconfig['ipprotocol'], array("inet" => "IPv4", "inet6" => "IPv6")))->setHelp('Choose the Internet Protocol this gateway uses.');
$section->addInput(new Form_Input('name', 'Name', 'text', $pconfig['name']))->setHelp('Gateway name');
$egw = new Form_Input('gateway', 'Gateway', 'text', $pconfig['dynamic'] ? 'dynamic' : $pconfig['gateway']);
$egw->setHelp('Gateway IP address');
if ($pconfig['dynamic']) {
$egw->setReadonly();
}
$section->addInput($egw);
$section->addInput(new Form_Checkbox('defaultgw', 'Default Gateway', 'This will select the above gateway as the default gateway', $pconfig['defaultgw']));
$section->addInput(new Form_Checkbox('monitor_disable', 'Gateway Monitoring', 'Disable Gateway Monitoring', $pconfig['monitor_disable']))->toggles('.toggle-monitor-ip')->setHelp('This will consider this gateway as always being up');
$group = new Form_Group('Monitor IP');
$group->addClass('toggle-monitor-ip', 'collapse');
if (!$pconfig['monitor_disable']) {
$group->addClass('in');
}
$group->add(new Form_Input('monitor', null, 'text', $pconfig['gateway'] == $pconfig['monitor'] ? '' : $pconfig['monitor']))->setHelp('Enter an alternative address here to be ' . 'used to monitor the link. This is used for the quality RRD graphs as well as the ' . 'load balancer entries. Use this if the gateway does not respond to ICMP echo ' . 'requests (pings).');
$section->add($group);
$section->addInput(new Form_Checkbox('force_down', 'Force state', 'Mark Gateway as Down', $pconfig['force_down']))->setHelp('This will force this gateway to be considered Down');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('You may enter a description here for your reference (not parsed).');
// If any of the advanced options are non-default, we will not show the "Advanced" button
// and will display the advanced section
if (!(!empty($pconfig['latencylow']) || !empty($pconfig['latencyhigh']) || !empty($pconfig['losslow']) || !empty($pconfig['losshigh']) || !empty($pconfig['data_payload']) || isset($pconfig['weight']) && $pconfig['weight'] > 1 || isset($pconfig['interval']) && !($pconfig['interval'] == $dpinger_default['interval']) || isset($pconfig['loss_interval']) && !($pconfig['loss_interval'] == $dpinger_default['loss_interval']) || isset($pconfig['time_period']) && !($pconfig['time_period'] == $dpinger_default['time_period']) || isset($pconfig['alert_interval']) && !($pconfig['alert_interval'] == $dpinger_default['alert_interval']) || isset($pconfig['nonlocalgateway']) && $pconfig['nonlocalgateway'])) {
$btnadvanced = new Form_Button('toggle-advanced', 'Advanced options');
$advdflt = true;
$btnadvanced->toggles('.advanced-options')->setAttribute('type', 'button');
$btnadvanced->removeClass('btn-primary')->addClass('btn-default');
$section->addInput(new Form_StaticText(null, $btnadvanced));
示例11: download
$section->addInput(new Form_Checkbox('passthrumacadd', 'Pass-through MAC Auto Entry', 'Enable Pass-through MAC automatic additions', $pconfig['passthrumacadd']))->setHelp(sprintf('When enabled, a MAC passthrough entry is automatically added after the user has successfully authenticated. Users of that MAC address will ' . 'never have to authenticate again. To remove the passthrough MAC entry you either have to log in and remove it manually from the ' . '%s or send a POST from another system.' . 'If this is enabled, RADIUS MAC authentication cannot be used. Also, the logout window will not be shown.', '<a href="services_captiveportal_mac.php">MAC tab</a>'));
$section->addInput(new Form_Checkbox('passthrumacaddusername', null, 'Enable Pass-through MAC automatic addition with username', $pconfig['passthrumacaddusername']))->setHelp(sprintf('If enabled with the automatically MAC passthrough entry created, the username used during authentication will be saved. ' . 'To remove the passthrough MAC entry you either have to log in and remove it manually from the %s or send a POST from another system.', '<a href="services_captiveportal_mac.php">MAC tab</a>'));
$section->addInput(new Form_Checkbox('peruserbw', 'Per-user bandwidth restriction', 'Enable per-user bandwidth restriction', $pconfig['peruserbw']));
$section->addInput(new Form_Input('bwdefaultdn', 'Default download (Kbit/s)', 'number', $pconfig['bwdefaultdn']));
$section->addInput(new Form_Input('bwdefaultup', 'Default upload (Kbit/s)', 'number', $pconfig['bwdefaultup']))->setHelp('If this option is set, the captive portal will restrict each user who logs in to the specified default bandwidth. ' . 'RADIUS can override the default settings. Leave empty or set to 0 for no limit.');
$form->add($section);
$section = new Form_Section('Authentication');
$section->addClass('Authentication');
$group = new Form_Group('Authentication method');
$group->add(new Form_Checkbox('auth_method', null, 'No Authentication', $pconfig['auth_method'] == 'none', 'none'))->displayasRadio();
$group->add(new Form_Checkbox('auth_method', null, 'Local User Manager / Vouchers', $pconfig['auth_method'] == 'local', 'local'))->displayasRadio();
$group->add(new Form_Checkbox('auth_method', null, 'RADIUS Authentication', $pconfig['auth_method'] == 'radius', 'radius'))->displayasRadio();
$section->add($group);
$section->addInput(new Form_Checkbox('localauth_priv', null, 'Allow only users/groups with "Captive portal login" privilege set', $pconfig['localauth_priv']));
$group = new Form_Group('RADIUS protocol');
$group->addClass("radiusproto");
$group->add(new Form_Checkbox('radius_protocol', null, 'PAP', $pconfig['radius_protocol'] == 'PAP', 'PAP'))->displayasRadio();
$group->add(new Form_Checkbox('radius_protocol', null, 'CHAP-MD5', $pconfig['radius_protocol'] == 'CHAP_MD5', 'CHAP_MD5'))->displayasRadio();
$group->add(new Form_Checkbox('radius_protocol', null, 'MSCHAPv1', $pconfig['radius_protocol'] == 'MSCHAPv1', 'MSCHAPv1'))->displayasRadio();
$group->add(new Form_Checkbox('radius_protocol', null, 'MSCHAPv2', $pconfig['radius_protocol'] == 'MSCHAPv2', 'MSCHAPv2'))->displayasRadio();
$section->add($group);
$form->add($section);
$section = new Form_Section('Primary Authentication Source');
$section->addClass('Primary');
$group = new Form_Group('Primary RADIUS server');
$group->add(new Form_IpAddress('radiusip', null, $pconfig['radiusip']));
$group->add(new Form_Input('radiusport', null, 'number', $pconfig['radiusport']));
$group->add(new Form_Input('radiuskey', null, 'text', $pconfig['radiuskey']));
$section->add($group);
$group = new Form_Group('Secondary RADIUS server');
$group->add(new Form_IpAddress('radiusip2', null, $pconfig['radiusip2']))->setHelp('IP address of the RADIUS server to authenticate against.');
示例12: count
$section->addInput(new Form_Input('bootfile_url', 'Bootfile URL', 'text', $pconfig['bootfile_url']));
$btnadnl = new Form_Button('btnadnl', 'Advanced');
$btnadnl->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText('Additional BOOTP/DHCP Options', $btnadnl . ' ' . 'Aditional BOOTP/DHCP Options'));
$form->add($section);
$title = 'Show Additional BOOTP/DHCP Options';
if ($pconfig['numberoptions']) {
$counter = 0;
$last = count($pconfig['numberoptions']['item']) - 1;
foreach ($pconfig['numberoptions']['item'] as $item) {
$group = new Form_Group(null);
$group->add(new Form_Input('number' . $counter, null, 'text', $item['number']))->setHelp($counter == $last ? 'Number' : null);
$group->add(new Form_Input('value' . $counter, null, 'text', $item['value']))->setHelp($counter == $last ? 'Value' : null);
$btn = new Form_Button('btn' . $counter, 'Delete', 'services_dhcpv6.php?if=' . $if . '&act=delopt' . '&id=' . $counter);
$btn->removeClass('btn-primary')->addClass('btn-danger btn-xs adnlopt');
$group->addClass('adnlopt');
$group->add($btn);
$section->add($group);
$counter++;
}
}
$btnaddopt = new Form_Button('btnaddopt', 'Add Option', 'services_dhcpv6.php?if=' . $if . '&act=addopt');
$btnaddopt->removeClass('btn-primary')->addClass('btn-success btn-sm');
$section->addInput($btnaddopt);
$section->addInput(new Form_Input('if', null, 'hidden', $if));
print $form;
print_info_box(gettext('The DNS servers entered in ') . '<a href="system.php">' . gettext(' System: General setup') . '</a>' . gettext(' (or the ') . '<a href="services_dnsmasq.php"/>' . gettext('DNS forwarder') . '</a>, ' . gettext('if enabled) ') . gettext('will be assigned to clients by the DHCP server.') . '<br />' . gettext('The DHCP lease table can be viewed on the ') . '<a href="status_dhcpv6_leases.php">' . gettext('Status: DHCPv6 leases') . '</a>' . gettext(' page.'));
?>
<div class="panel panel-default">
<div class="panel-heading"><h2 class="panel-title">DHCPv6 Static Mappings for this interface.</h2></div>
示例13: array
$group->setHelp('If NAT/BINAT is required on this network specify the address to be translated');
$section->add($group);
$group = new Form_Group('Remote Network');
$group->addClass('opt_remoteid');
$group->add(new Form_Select('remoteid_type', null, $pconfig['remoteid_type'], array('address' => 'Address', 'network' => 'Network')))->setHelp('Type');
$group->add(new Form_IpAddress('remoteid_address', null, $pconfig['remoteid_address']))->setHelp('Address')->addMask(remoteid_netbits, $pconfig['remoteid_netbits'], 128, 0);
$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).');
$form->add($section);
$section = new Form_Section('Phase 2 proposal (SA/Key Exchange)');
$section->addInput(new Form_Select('proto', 'Protocol', $pconfig['proto'], $p2_protos))->setHelp('ESP is encryption, AH is authentication only.');
$i = 0;
$rows = count($p2_ealgos) - 1;
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++;
示例14: array
$group = new Form_Group('Destination');
$group->add(new Form_Checkbox('dstnot', 'Destination not', 'Invert match.', $pconfig['dstnot']))->setWidth(2);
$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'];
示例15:
}
$firstDayFound = false;
$firstprint = true;
}
$i++;
}
}
}
$group = new Form_Group('');
$group->add(new Form_Input('tempFriendlyTime' . $counter, null, 'text', $tempFriendlyTime))->setWidth(2)->setReadonly()->setHelp($counter == $maxrows ? 'Day(s)' : '');
$group->add(new Form_Input('starttime' . $counter, null, 'text', $starttime))->setWidth(2)->setReadonly()->setHelp($counter == $maxrows ? 'Start time' : '');
$group->add(new Form_Input('stoptime' . $counter, null, 'text', $stoptime))->setWidth(2)->setReadonly()->setHelp($counter == $maxrows ? 'Stop time' : '');
$group->add(new Form_Input('timedescr' . $counter, null, 'text', $timedescr))->setWidth(2)->setHelp($counter == $maxrows ? 'Description' : '');
$group->add(new Form_Button('Delete' . $counter, 'Delete', null, 'fa-trash'))->setAttribute('type', 'button')->addClass('btn-xs btn-warning');
$group->add(new Form_Input('schedule' . $counter, null, 'hidden', $tempID));
$group->addClass('schedulegrp' . $counter);
$counter++;
$section->add($group);
}
}
}
// This is just a marker that the javascript can use to insertBefore() when adding new rows
$section->addInput(new Form_Input('marker', null, 'hidden'))->addClass('noranges');
$form->add($section);
print $form;
?>
<script type="text/javascript">
//<![CDATA[
events.push(function() {