return $portlist;
}
$pgtitle = array(gettext("Interfaces"), gettext("Bridges"), gettext("Edit"));
$shortcut_section = "interfaces";
include "head.inc";
if ($input_errors) {
    print_input_errors($input_errors);
}
$form = new Form();
$section = new Form_Section('Bridge Configuration');
$memberslist = build_port_list($pconfig['members']);
$section->addInput(new Form_Select('members', 'Member Interfaces', $memberslist['selected'], $memberslist['list'], true))->setHelp('Interfaces participating in the bridge.');
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']));
// Advanced Additional options
$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_Input('maxaddr', 'Cache Size', 'text', $pconfig['maxaddr']))->setHelp('Set the size of the bridge address cache. The default is 2000 entries.');
$section->addInput(new Form_Input('timeout', 'Cache expire time', 'text', $pconfig['timeout']))->setHelp('Set the timeout of address cache entries to this number of seconds. If seconds is zero, then address cache entries will not be expired. The default is 1200 seconds.');
$spanlist = build_port_list($pconfig['span']);
$section->addInput(new Form_Select('span', 'Span Port', $spanlist['selected'], $spanlist['list'], true))->setHelp('Add the interface named by interface as a span port on the bridge. Span ports transmit a copy of every frame received by the bridge. ' . 'This is most useful for snooping a bridged network passively on another host connected to one of the span ports of the bridge. <br />' . '%sThe span interface cannot be part of the bridge member interfaces.%s', ['<strong>', '</strong>']);
$edgelist = build_port_list($pconfig['edge']);
$section->addInput(new Form_Select('edge', 'Edge Ports', $edgelist['selected'], $edgelist['list'], true))->setHelp('Set interface as an edge port. An edge port connects directly to end stations and cannot create bridging loops in the network; this allows it to transition straight to forwarding.');
$edgelist = build_port_list($pconfig['autoedge']);
$section->addInput(new Form_Select('autoedge', 'Auto Edge Ports', $edgelist['selected'], $edgelist['list'], true))->setHelp('Allow interface to automatically detect edge status. This is the default for all interfaces added to a bridge.' . '%sThis will disable the autoedge status of interfaces. %s', ['<strong>', '</strong>']);
$edgelist = build_port_list($pconfig['ptp']);
$section->addInput(new Form_Select('ptp', 'PTP Ports', $edgelist['selected'], $edgelist['list'], true))->setHelp('Set the interface as a point-to-point link. This is required for straight transitions to forwarding and should be enabled on a direct link to another RSTP-capable switch.');
$edgelist = build_port_list($pconfig['autoptp']);
Esempio n. 2
0
 $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)))->setAttribute('id');
 $section->addInput(new Form_StaticText('', $btntest));
 $form->add($section);
 print $form;
 // Logs
 $form = new Form(false);
 $btnview = new Form_Button('submit', 'View', null, 'fa-file-text-o');
 $btnview->addClass('btn-primary');
 $btnview->setAttribute('id');
 $section = new Form_Section('View Logs');
 $section->addInput(new Form_Input('action', null, 'hidden', 'logs'))->setAttribute('id');
 $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)))->setAttribute('id');
 $section->addInput(new Form_StaticText('', $btnview));
 $form->add($section);
 print $form;
 // Abort
 $btnabort = new Form_Button('submit', 'Abort', null, 'fa-times');
 $btnabort->addClass('btn-danger')->setAttribute('id');
 $form = new Form(false);
 $section = new Form_Section('Abort');
    }
}
// Get the MAC address
$ip = $_SERVER['REMOTE_ADDR'];
$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']));
}
$tab_array[] = array(gettext("Settings"), false, "system_usermanager_settings.php");
$tab_array[] = array(gettext("Authentication Servers"), false, "system_authservers.php");
display_top_tabs($tab_array);
$form = new Form();
if (isset($groupid)) {
    $form->addGlobal(new Form_Input('groupid', null, 'hidden', $groupid));
}
$section = new Form_Section('Add Privileges for ' . $a_group['name']);
$section->addInput(new Form_Select('sysprivs', 'Assigned privileges', $a_group['priv'], build_priv_list(), true))->addClass('multiselect')->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items.');
$section->addInput(new Form_Select('shadow', 'Shadow', null, build_priv_list(), true))->addClass('shadowselect')->setHelp('Hold down CTRL (PC)/COMMAND (Mac) key to select multiple items.');
$section->addInput(new Form_Input('filtertxt', 'Filter', 'text', null))->setHelp('Show only the choices containing this term');
$btnfilter = new Form_Button('btnfilter', 'Filter', null, 'fa-filter');
$btnfilter->setAttribute('type', 'button')->addClass('btn btn-info');
$form->addGlobal($btnfilter);
$btnclear = new Form_Button('btnclear', 'Clear', null, 'fa-times');
$btnclear->setAttribute('type', 'button')->addClass('btn btn-warning');
$form->addGlobal($btnclear);
$form->add($section);
print $form;
?>
<div class="panel panel-body alert-info col-sm-10 col-sm-offset-2" id="pdesc"><?php 
echo gettext("Select a privilege from the list above for a description");
?>
</div>

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

<?php 
// Build a list of privilege descriptions