Example #1
0
$section->addInput(new Form_Select('n_l2tp_units', 'Number of L2TP users', $pconfig['n_l2tp_units'], array_combine(range(1, 255, 1), range(1, 255, 1))));
$section->addPassword(new Form_Input('secret', 'Secret', 'password', $pconfig['secret']))->setHelp('Specify optional secret shared between peers. Required on some devices/setups.');
$section->addInput(new Form_Select('paporchap', 'Authentication type', $pconfig['paporchap'], array('chap' => 'CHAP', 'chap-msv2' => 'MS-CHAPv2', 'pap' => 'PAP')))->setHelp('Specifies the protocol to use for authentication.');
$section->addInput(new Form_Input('l2tp_dns1', 'Primary L2TM DNS server', 'text', $pconfig['l2tp_dns1']));
$section->addInput(new Form_Input('l2tp_dns2', 'Secondary L2TM DNS server', 'text', $pconfig['l2tp_dns2']));
$form->add($section);
$section = new Form_Section("RADIUS");
$section->addClass('toggle-l2tp-enable');
$section->addInput(new Form_Checkbox('radiusenable', 'Enable', 'Use a RADIUS server for authentication', $pconfig['radiusenable']))->setHelp('When set, all users will be authenticated using the RADIUS server specified below. The local user database will not be used.');
$section->addInput(new Form_Checkbox('radacct_enable', 'Accounting', 'Enable RADIUS accounting', $pconfig['radacct_enable']))->setHelp('Sends accounting packets to the RADIUS server.');
$section->addInput(new Form_IpAddress('radiusserver', 'Server', $pconfig['radiusserver']))->setHelp('Enter the IP address of the RADIUS server.');
$section->addPassword(new Form_Input('radiussecret', 'Secret', 'password', $pconfig['radiussecret']))->setHelp('Enter the shared secret that will be used to authenticate to the RADIUS server.');
$section->addInput(new Form_Checkbox('radiusissueips', 'RADIUS issued IPs', 'Issue IP Addresses via RADIUS server.', $pconfig['radiusissueips']));
$form->add($section);
print $form;
print_info_box(gettext("Don't forget to add a firewall rule to permit traffic from L2TP clients!"), info);
?>

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

	function setL2TP () {
		hide = ! $('#mode').prop('checked');

		hideClass('toggle-l2tp-enable', hide);
	}

	function setRADIUS () {
		hide = ! $('#radiusenable').prop('checked');
$shortcut_section = "captiveportal-vouchers";
include "head.inc";
$tab_array = array();
$tab_array[] = array(gettext("Active Users"), false, "status_captiveportal.php?zone={$cpzone}");
$tab_array[] = array(gettext("Active Vouchers"), false, "status_captiveportal_vouchers.php?zone={$cpzone}");
$tab_array[] = array(gettext("Voucher Rolls"), false, "status_captiveportal_voucher_rolls.php?zone={$cpzone}");
$tab_array[] = array(gettext("Test Vouchers"), true, "status_captiveportal_test.php?zone={$cpzone}");
$tab_array[] = array(gettext("Expire Vouchers"), false, "status_captiveportal_expire.php?zone={$cpzone}");
display_top_tabs($tab_array);
require_once 'classes/Form.class.php';
$form = new Form();
$section = new Form_Section('Test Vouchers');
$section->addInput(new Form_Textarea('vouchers', 'Vouchers', $_POST['vouchers']))->setHelp('Enter multiple vouchers separated by space or newline. The remaining time, if valid, will be shown for each voucher.');
$section->addInput(new Form_Input('zone', null, 'hidden', $cpzone));
$form->add($section);
print $form;
if ($_POST) {
    if ($_POST['vouchers']) {
        $test_results = voucher_auth($_POST['vouchers'], 1);
        $output = "";
        foreach ($test_results as $result) {
            if (strpos($result, " good ") || strpos($result, " granted ")) {
                $output .= '<font color="green">' . htmlspecialchars($result) . '</font>' . '<br />';
            } else {
                $output .= '<font color="red">' . htmlspecialchars($result) . '</font>' . '<br />';
            }
        }
        print_info_box($output);
    }
}
include "foot.inc";
Example #3
0
    echo $i;
    ?>
"></a>
					</td>
				</tr>
<?php 
    $i++;
}
?>
			</tbody>
		</table>
	</div>
</div>

<nav class="action-buttons">
	<a href="services_unbound_domainoverride_edit.php" class="btn btn-sm btn-success">
		<i class="fa fa-plus icon-embed-btn"></i>
		<?php 
echo gettext('Add');
?>
	</a>
</nav>

<div class="infoblock">
	<?php 
echo print_info_box(sprintf(gettext("If the DNS Resolver is enabled, the DHCP" . " service (if enabled) will automatically serve the LAN IP" . " address as a DNS server to DHCP clients so they will use" . " the DNS Resolver. If Forwarding is enabled, the DNS Resolver will use the DNS servers" . " entered in %sSystem: General setup%s" . " or those obtained via DHCP or PPP on WAN if &quot;Allow" . " DNS server list to be overridden by DHCP/PPP on WAN&quot;" . " is checked."), '<a href="system.php">', '</a>'), 'info', false);
?>
</div>

<?php 
include "foot.inc";
Example #4
0
		</button>
		<button type="submit" id="order-store" name="order-store" class="btn btn-primary btn-sm" disabled title="<?php 
echo gettext('Save mapping order');
?>
">
			<i class="fa fa-save icon-embed-btn"></i>
			<?php 
echo gettext("Save");
?>
		</button>
	</nav>
</form>

<div class="infoblock">
<?php 
echo print_info_box(gettext('Depending on the way your WAN connection is setup, you may also need a ') . '<a href="firewall_virtual_ip.php">' . gettext("Virtual IP.") . '</a>' . '<br />' . gettext('If you add a 1:1 NAT entry for any of the interface IPs on this system, ' . 'it will make this system inaccessible on that IP address. i.e. if ' . 'you use your WAN IP address, any services on this system (IPsec, OpenVPN server, etc.) ' . 'using the WAN IP address will no longer function.'), 'info', false);
?>

</div>

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

	// Make rules sortable
	$('table tbody.user-entries').sortable({
		cursor: 'grabbing',
		update: function(event, ui) {
			$('#order-store').removeAttr('disabled');
			dirty = true;
		}
        echo $i;
        ?>
" onclick="return confirm('<?php 
        echo gettext("Are you sure you want to delete this virtual server?");
        ?>
')"></a>
						</td>
					</tr>
<?php 
        $i++;
    }
} else {
    ?>
						<tr>
							<td	 colspan="8"> <?php 
    print_info_box(gettext('No virtual servers have been configured'));
    ?>
							</td>
						</tr> <?php 
}
?>
				</tbody>
			</table>
		</div>
	</div>
</form>

<nav class="action-buttons" style="margin-top: 10px;">
	<a href="load_balancer_virtual_server_edit.php" class="btn btn-success btn-sm">
		<i class="fa fa-plus" style="font-size:15px; vertical-align: middle; margin-right: 6px;"></i>
		<?php 
Example #6
0
	</section>
	<meta http-equiv="refresh" content="3;url=wizard.php">
	<?php 
    exit;
}
?>

<section class="page-content-main">
	<div class="container-fluid">

        <div class="row">

				<?php 
$crash_report = get_crash_report();
if ($crash_report != '') {
    print_info_box($crash_report);
}
$totalwidgets = count($widgetfiles);
$halftotal = $totalwidgets / 2 - 2;
$widgetcounter = 0;
$directory = "/usr/local/www/widgets/widgets/";
$printed = false;
$firstprint = false;
foreach ($widgetlist as $widget) {
    if (!stristr($widget, "widget.php")) {
        continue;
    }
    $periodpos = strpos($widget, ".");
    $widgetname = substr($widget, 0, $periodpos);
    if ($widgetname != "") {
        $nicename = $widgetname;
$group->add(new Form_Select('advbase', 'Base', $pconfig['advbase'], array_combine(range(1, 254, 1), range(1, 254, 1))))->setHelp('Base');
$group->add(new Form_Select('advskew', 'Skew', $pconfig['advskew'], array_combine(range(0, 254, 1), range(0, 254, 1))))->setHelp('Skew');
$group->setHelp('The frequency that this machine will advertise. 0 means usually master. Otherwise the lowest combination of both values in the cluster determines the master.');
$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).');
if (isset($id) && $a_vip[$id]) {
    $section->addInput(new Form_Input('id', null, 'hidden', $id));
}
$section->addInput(new Form_Input('uniqid', null, 'hidden', $pconfig['uniqid']));
$form->add($section);
print $form;
?>

<div id="infoblock">
	<?php 
echo print_info_box(gettext("Proxy ARP and Other type Virtual IPs cannot be bound to by anything running on the firewall, such as IPsec, OpenVPN, etc.  Use a CARP or IP Alias type address for these types.") . '<br />' . sprintf(gettext("For more information on CARP and the above values, visit the OpenBSD %s"), '<a href="http://www.openbsd.org/faq/pf/carp.html">CARP FAQ</a>.'), info);
?>
</div>

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

	// Hides the <div> in which the specified checkbox lives so that the checkbox, its label and help text are hidden
	function hideCheckbox(id, hide) {
		if (hide) {
			$('#' + id).parent().parent().parent('div').addClass('hidden');
		} else {
			$('#' + id).parent().parent().parent('div').removeClass('hidden');
		}
	}
	<?php 
    echo $directionicons['both'] . ' = ' . sprintf(gettext('All connections %sto or from%s are allowed'), '<u>', '</u>');
} else {
    ?>
		</tbody>
	</table>
<?php 
}
?>
</div>

<nav class="action-buttons">
	<a href="services_captiveportal_hostname_edit.php?zone=<?php 
echo $cpzone;
?>
&amp;act=add" class="btn btn-success btn-sm">
		<i class="fa fa-plus icon-embed-btn"></i>
		<?php 
echo gettext("Add");
?>
	</a>
</nav>

<div class="infoblock">
	<?php 
echo print_info_box($notestr);
?>
</div>

<?php 
include "foot.inc";
Example #9
0
$i = 0;
foreach ($iflist as $ifent => $ifname) {
    $oc = $config['interfaces'][$ifent];
    if (is_array($config['dhcpd'][$ifent]) && !isset($config['dhcpd'][$ifent]['enable']) && !is_ipaddrv4($oc['ipaddr']) || !is_array($config['dhcpd'][$ifent]) && !is_ipaddrv4($oc['ipaddr'])) {
        continue;
    }
    if ($ifent == $if) {
        $active = true;
    } else {
        $active = false;
    }
    $tab_array[] = array($ifname, $active, "services_dhcp.php?if={$ifent}");
    $tabscounter++;
}
if ($tabscounter == 0) {
    print_info_box(gettext("The DHCP Server can only be enabled on interfaces configured with a static IPv4 address. This system has none."));
    include "foot.inc";
    exit;
}
display_top_tabs($tab_array);
// This form uses a non-standard submit button name
$form = new Form(new Form_Button('submit', gettext("Save")));
$section = new Form_Section('General Options');
if (!is_numeric($pool) && !($act == "newpool")) {
    $section->addInput(new Form_Checkbox('enable', 'Enable', sprintf(gettext("Enable DHCP server on %s interface"), htmlspecialchars($iflist[$if])), $pconfig['enable']));
} else {
    $section->addInput(new Form_StaticText(null, '<div class="alert alert-info"> Editing Pool-Specific Options. To return to the Interface, click its tab above. </div>'));
}
$section->addInput(new Form_Checkbox('denyunknown', 'Deny unknown clients', 'Only the clients defined below will get DHCP leases from this server.', $pconfig['denyunknown']));
$section->addInput(new Form_Checkbox('nonak', 'Ignore denied clients', 'Denied clients will be ignored rather than rejected.', $pconfig['nonak']));
if (is_numeric($pool) || $act == "newpool") {
Example #10
0
?>
</span></a></li>
			</ul>
		</td>
	</tr>
	<tr>
		<td class="tabcont">
			<form action="interfaces_vlan.php" method="post">
				<?php 
if (!empty($input_errors)) {
    print_input_errors($input_errors);
}
?>
				<?php 
if (file_exists($d_sysrebootreqd_path)) {
    print_info_box(get_std_save_message(0));
}
?>
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td width="20%" class="listhdrlr"><?php 
echo gettext("Virtual interface");
?>
</td>
						<td width="20%" class="listhdrr"><?php 
echo gettext("Physical interface");
?>
</td>
						<td width="5%" class="listhdrr"><?php 
echo gettext("VLAN tag");
?>
Example #11
0
        echo htmlspecialchars($sp['src']);
        ?>
 -&gt; <?php 
        echo htmlspecialchars($sp['dst']);
        ?>
					</td>
				</tr>
<?php 
    }
    ?>
			</tbody>
		</table>
	</div>
<?php 
} else {
    print_info_box(gettext('No IPsec security policies configured.'));
}
if (ipsec_enabled()) {
    ?>
<div class="infoblock">
<?php 
} else {
    ?>
<div class="infoblock blockopen">
<?php 
}
print_info_box(sprintf(gettext('You can configure IPsec %1$shere%2$s'), '<a href="vpn_ipsec.php">', '</a>'), 'info', false);
?>
</div>
<?php 
include "foot.inc";
Example #12
0
					<?php 
        echo gettext("Confirm");
        ?>
				</button>
<?php 
    }
    ?>
			</div>
		</div>
	</div>
<?php 
}
?>
	<div id="unable" style="display: none">
		<?php 
echo print_info_box(gettext("Unable to retrieve system versions."), 'danger');
?>
	</div>
<?php 
if ($_POST) {
    if ($firmwareupdate) {
        $logfilename = $g['cf_conf_path'] . '/upgrade_log';
    } else {
        $logfilename = $g['cf_conf_path'] . '/pkg_log_' . $pkgname;
    }
}
if ($firmwareupdate) {
    $panel_heading_txt = gettext("Updating System");
    $pkg_success_txt = gettext('System update successfully completed.');
    $pkg_fail_txt = gettext('System update failed!');
    $pkg_wait_txt = gettext('Please wait while the system update completes.');
    ?>
		<tbody>
	</table>

	<?php 
    echo $directionicons['to'] . ' = ' . sprintf(gettext('All connections %sto%s the address are allowed'), '<u>', '</u>') . ', ';
    ?>
	<?php 
    echo $directionicons['from'] . ' = ' . sprintf(gettext('All connections %sfrom%s the address are allowed'), '<u>', '</u>') . ', ';
    ?>
	<?php 
    echo $directionicons['both'] . ' = ' . sprintf(gettext('All connections %sto or from%s are allowed'), '<u>', '</u>');
} else {
    ?>
		</tbody>
	</table>
<?php 
}
?>
</div>

<nav class="action-buttons">
	<a href="services_captiveportal_ip_edit.php?zone=<?php 
echo $cpzone;
?>
&amp;act=add" class="btn btn-success">Add</a>
</nav>

<?php 
print_info_box(gettext('Adding allowed IP addresses will allow IP access to/from these addresses through the captive portal without being taken to the portal page. ' . 'This can be used for a web server serving images for the portal page or a DNS server on another network, for example.'));
include "foot.inc";
Example #14
0
defCmdT("last 1000 NTP log entries", "/usr/local/sbin/clog /var/log/ntpd.log 2>&1 | tail -n 1000");
defCmdT("last 1000 OpenVPN log entries", "/usr/local/sbin/clog /var/log/openvpn.log 2>&1 | tail -n 1000");
defCmdT("last 1000 Captive Portal auth log entries", "/usr/local/sbin/clog /var/log/portalauth.log 2>&1 | tail -n 1000");
defCmdT("last 1000 PPP log entries", "/usr/local/sbin/clog /var/log/poes.log 2>&1 | tail -n 1000");
defCmdT("last 1000 relayd log entries", "/usr/local/sbin/clog /var/log/relayd.log 2>&1 | tail -n 1000");
defCmdT("last 1000 resolver log entries", "/usr/local/sbin/clog /var/log/resolver.log 2>&1 | tail -n 1000");
defCmdT("last 1000 routing log entries", "/usr/local/sbin/clog /var/log/routing.log 2>&1 | tail -n 1000");
defCmdT("last 1000 wireless log entries", "/usr/local/sbin/clog /var/log/wireless.log 2>&1 | tail -n 1000");
if (file_exists("/tmp/PHP_errors.log")) {
    defCmdT("PHP Error Log", "/bin/cat /tmp/PHP_errors.log");
}
defCmdT("System Message Buffer", "/sbin/dmesg -a");
defCmdT("System Message Buffer (Boot)", "/bin/cat /var/log/dmesg.boot");
defCmdT("sysctl values", "/sbin/sysctl -a");
defCmdT("Kernel Environment", "/bin/kenv");
defCmdT("Installed OS Packages", "/usr/sbin/pkg info");
exec("/bin/date", $dateOutput, $dateStatus);
$currentDate = $dateOutput[0];
$pgtitle = array("{$g['product_name']}", "Status");
include "head.inc";
print_info_box(gettext("Make sure all sensitive information is removed! (Passwords, etc.) before posting " . "information from this page in public places (like mailing lists).") . '<br />' . gettext("Common password fields in config.xml have been automatically redacted.") . '<br />' . gettext("When the page has finished loading, the output will be stored in {$output_file}. It may be downloaded via scp or ") . "<a href=\"/exec.php?dlPath={$output_file}\">" . gettext("Diagnostics > Command Prompt.") . '</a>');
listCmds();
execCmds();
print gettext("Saving output to archive...");
if (is_dir($output_path)) {
    mwexec("/usr/bin/tar czpf " . escapeshellarg($output_file) . " -C " . escapeshellarg(dirname($output_path)) . " " . escapeshellarg(basename($output_path)));
    unlink_if_exists("{$output_path}/*");
    @rmdir($output_path);
}
print gettext("Done.");
include "foot.inc";
Example #15
0
	</div>

	<nav class="action-buttons">
		<a class="btn btn-success btn-sm" role="button" href="interfaces_vlan_edit.php">
			<i class="fa fa-plus icon-embed-btn"></i>
			<?php 
echo gettext('Add');
?>
		</a>
	</nav>

</form>

<div class="infoblock">
	<?php 
echo print_info_box(sprintf(gettext('NOTE: Not all drivers/NICs support 802.1Q ' . 'VLAN tagging properly. <br />On cards that do not explicitly support it, VLAN ' . 'tagging will still work, but the reduced MTU may cause problems.<br />See the ' . '%s handbook for information on supported cards.'), $g['product_name']), 'info', false);
?>
</div>
<script type="text/javascript">
//<![CDATA[
events.push(function() {
	// Select 'delete button' clicks, extract the id, set the hidden input values and submit
	$('[id^=del-]').click(function(event) {
		$('#act').val('del');
		$('#id').val(this.id.replace("del-", ""));
		$(this).parents('form').submit();
	});
});
//]]>
</script>
<?php 
Example #16
0
?>
/images/logo.gif"></a>
<p>
<div style="width:800px;background-color:#ffffff" id="roundme">
<?php 
if ($input_errors) {
    print_input_errors($input_errors);
}
if ($savemsg) {
    print_info_box($savemsg);
}
if ($_GET['message'] != "") {
    print_info_box(htmlspecialchars($_GET['message']));
}
if ($_POST['message'] != "") {
    print_info_box(htmlspecialchars($_POST['message']));
}
?>
<table bgcolor="#ffffff" width="95%" border="0" cellspacing="0" cellpadding="2">
    <!-- wizard goes here -->
    <tr><td>&nbsp;</td></tr>
 <tr>
	<td class="tabcont">
	<table width="100%" border="0" cellpadding="6" cellspacing="0">

    <tr><td colspan='2'><center><font size="2"><b><?php 
echo fixup_string($description);
?>
</b></font></center></td></tr><tr><td>&nbsp;</td></tr>
    <?php 
if (!$pkg['step'][$stepid]['disableheader']) {
Example #17
0
            $sform->addGlobal(new Form_Button('add', 'Add new Queue', $url))->removeClass('btn-default')->addClass('btn-success');
        }
        if ($queue) {
            $url = 'firewall_shaper.php?interface=' . $interface . '&queue=' . $queue->GetQname() . '&action=delete';
        } else {
            $url = 'firewall_shaper.php?interface=' . $interface . '&action=delete';
        }
        $sform->addGlobal(new Form_Button('delete', $queue ? 'Delete this queue' : 'Disable shaper on interface', $url))->removeClass('btn-default')->addClass('btn-danger');
    }
    print $sform;
}
?>
				</td>
			</tr>
		</tbody>
	</table>
</div>

<?php 
if ($dfltmsg) {
    ?>
<div>
	<div id="infoblock">
		<?php 
    echo print_info_box($default_shaper_msg, info);
    ?>
	</div>
</div>
<?php 
}
include "foot.inc";
Example #18
0
    $message = $retval;
}
include "head.inc";
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td>
<?php 
if ($input_errors) {
    print_input_errors($input_errors);
}
if ($message) {
    ?>
<br />
<?php 
    echo gettext("Message");
    ?>
: <?php 
    echo $message;
    ?>
<br />
<?php 
} else {
    print_info_box(gettext('This is the Easy Rule status page, mainly used to display errors when adding rules.') . ' ' . gettext('There apparently was not an error, and this page was navigated to directly without any instructions for what it should do.') . '<br /><br />' . gettext('This page is meant to be called from the block/pass buttons on the Firewall Logs page') . ', <a href="status_logs_filter.php">' . gettext("Status") . ' &gt; ' . gettext('System Logs') . ', ' . gettext('Firewall Tab') . '</a>.<br />');
}
?>
		</td>
	</tr>
</table>
<?php 
include "foot.inc";
Example #19
0
    ?>
" onclick="return confirm('<?php 
    echo gettext("Are you sure you want to delete this Q-in-Q interface?");
    ?>
')"></a>
				</td>
			</tr>
<?php 
}
?>
		</tbody>
	</table>
</div>

<nav class="action-buttons" style="margin-top: 10px;">
	<a href="interfaces_qinq_edit.php" class="btn btn-success btn-sm">
		<i class="fa fa-plus" style="font-size:15px; vertical-align: middle; margin-right: 6px;"></i>
		<?php 
echo gettext("Add");
?>
	</a>
</nav>

<div id="infoblock">
	<?php 
echo print_info_box(sprintf(gettext('Not all drivers/NICs support 802.1Q QinQ tagging properly. <br />On cards that do not explicitly support it, ' . 'QinQ tagging will still work, but the reduced MTU may cause problems.<br />' . 'See the %s handbook for information on supported cards.'), $g['product_name']), info);
?>
</div>

<?php 
include "foot.inc";
Example #20
0
    }
}
include "head.inc";
/* Display any error messages resulting from user input */
if ($input_errors) {
    print_input_errors($input_errors);
} else {
    if (!$resolved && $type) {
        print_info_box(sprintf(gettext('Host "%s" could not be resolved.'), $host), 'warning', false);
    }
}
if ($createdalias) {
    if ($alias_exists) {
        print_info_box(gettext("Alias was updated successfully."), 'success');
    } else {
        print_info_box(gettext("Alias was created successfully."), 'success');
    }
}
$form = new Form(false);
$section = new Form_Section('DNS Lookup');
$section->addInput(new Form_Input('host', 'Hostname', 'text', $host, ['placeholder' => 'Hostname to look up.']));
$form->add($section);
$form->addGlobal(new Form_Button('Submit', 'Lookup', null, 'fa-search'))->addClass('btn-primary');
if (!empty($resolved)) {
    if ($alias_exists) {
        $button_text = gettext("Update alias");
    } else {
        $button_text = gettext("Add alias");
    }
    $form->addGlobal(new Form_Button('create_alias', $button_text, null, 'fa-plus'))->removeClass('btn-primary')->addClass('btn-success');
}
Example #21
0
function body_html()
{
    global $g, $fstype, $savemsg;
    $pgtitle = array("{$g['product_name']}", gettext("Installer"));
    include "head.inc";
    echo <<<EOF
\t<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
\t<script type="text/javascript" src="/javascript/jquery-1.11.1.min.js"></script>
\t<script type="text/javascript" src="/javascript/jquery-migrate-1.2.1.min.js"></script>
\t<script type="text/javascript" src="/javascript/jquery/jquery-ui-1.11.1.min.js"></script>
\t<script type="text/javascript">
\t\tfunction getinstallerprogress() {
\t\t\turl = '/installer/installer.php';
\t\t\tpars = 'state=update_installer_status';
\t\t\tcallajax(url, pars, installcallback);
\t\t}
\t\tfunction callajax(url, pars, activitycallback) {
\t\t\tjQuery.ajax(
\t\t\t\turl,
\t\t\t\t{
\t\t\t\t\ttype: 'post',
\t\t\t\t\tdata: pars,
\t\t\t\t\tcomplete: activitycallback
\t\t\t\t});
\t\t}
\t\tfunction installcallback(transport) {
\t\t\tsetTimeout('getinstallerprogress()', 2000);
\t\t\teval(transport.responseText);
\t\t}
\t</script>
EOF;
    if ($one_two) {
        echo "<p class=\"pgtitle\">{$pgtitle}</font></p>";
    }
    if ($savemsg) {
        print_info_box($savemsg);
    }
}
Example #22
0
			</tbody>
		</table>

<script type="text/javascript">
//<![CDATA[
events.push(function() {
	$("#count").html(<?php 
    echo $rows;
    ?>
);
});
//]]>
</script>

<?php 
    if ($rows == 0) {
        print_info_box(gettext('No logs to display.'));
    }
    ?>
	</div>
</div>
<?php 
}
# Manage Log - Section/Form
if (!$system_logs_manage_log_form_hidden) {
    manage_log_section();
}
?>

<?php 
include "foot.inc";
Example #23
0
            $config['system']['nanobsd_force_rw'] = true;
        } else {
            $savemsg = gettext('Permanent read/write has been cleared successfully.');
            $class = 'alert-success';
            unset($config['system']['nanobsd_force_rw']);
        }
        write_config(gettext("Changed Permanent Read/Write Setting"));
        conf_mount_ro();
    } else {
        $savemsg = gettext('Saved r/w permanently');
        $class = 'alert-success';
    }
}
print_info_box(gettext("The options on this page are intended for use by advanced users only."));
if ($savemsg) {
    print_info_box($savemsg, $class);
}
$form = new Form(false);
$section = new Form_Section('NanoBSD Options');
$section->addInput(new Form_StaticText('Image Size', $NANOBSD_SIZE));
$slicebtn = new Form_Button('bootslice', 'Switch Slice');
$slicebtn->removeClass('btn-primary')->addClass('btn-default btn-sm');
$section->addInput(new Form_StaticText('Bootup slice', $ACTIVE_SLICE . ' ' . $slicebtn));
$refcount = refcount_read(1000);
if (is_writable("/")) {
    /* refcount_read returns -1 when shared memory section does not exist */
    /* refcount can be zero here when the user has set nanobsd_force_rw */
    /* refcount 1 is normal, so only display the count for abnormal values */
    if ($refcount == 1 || $refcount == 0 || $refcount == -1) {
        $refdisplay = "";
    } else {
Example #24
0
}
$pgtitle = array(gettext("Diagnostics"), gettext("Backup/restore"));
include "head.inc";
if ($input_errors) {
    print_input_errors($input_errors);
}
if ($savemsg) {
    print_info_box($savemsg, 'success');
}
if (is_subsystem_dirty('restore')) {
    ?>
	<br/>
	<form action="reboot.php" method="post">
		<input name="Submit" type="hidden" value="Yes" />
		<?php 
    echo print_info_box(gettext("The firewall configuration has been changed.") . "<br />" . gettext("The firewall is now rebooting."));
    ?>
		<br />
	</form>
<?php 
}
$tab_array = array();
$tab_array[] = array(gettext("Config History"), false, "diag_confbak.php");
$tab_array[] = array(gettext("Backup/Restore"), true, "diag_backup.php");
display_top_tabs($tab_array);
require_once 'classes/Form.class.php';
$form = new Form(false);
$form->setMultipartEncoding();
// Allow file uploads
$section = new Form_Section('Backup configuration');
$section->addInput(new Form_Select('backuparea', 'Backup area', '', build_area_list(false)));
Example #25
0
    ?>
</th>
					</tr>
				</thead>
				<tbody>
<?php 
    $if_queue_list = get_configured_interface_list_by_realif(false, true);
    processQueues($altqstats, 0, "");
}
?>
				</tbody>
			</table>
			<br />
			<div class="infoblock blockopen">
<?php 
print_info_box(gettext("Queue graphs take 5 seconds to sample data."), 'info', false);
?>
			</div>
		</div>
	</div>
<br/>

<script type="text/javascript">
//<![CDATA[
	function StatsShowHide(classname) {
		var firstrow = $("." + classname).first();
		if (firstrow.is(':visible')) {
			$("." + classname).hide();
		} else {
			$("." + classname).show();
		}
Example #26
0
            $sform->addGlobal(new Form_Button('add', 'Add new Queue', $url, 'fa-plus'))->addClass('btn-success');
        }
        if ($queue) {
            $url = 'firewall_shaper.php?interface=' . $interface . '&queue=' . $queue->GetQname() . '&action=delete';
        } else {
            $url = 'firewall_shaper.php?interface=' . $interface . '&action=delete';
        }
        $sform->addGlobal(new Form_Button('delete', $queue ? 'Delete this queue' : 'Disable shaper on interface', $url, 'fa-trash'))->addClass('btn-danger');
    }
    print $sform;
}
?>
				</td>
			</tr>
		</tbody>
	</table>
</div>

<?php 
if ($dfltmsg) {
    ?>
<div>
	<div class="infoblock">
		<?php 
    print_info_box($default_shaper_msg, 'info', false);
    ?>
	</div>
</div>
<?php 
}
include "foot.inc";
Example #27
0
    foreach ($a_gateways as $gateway) {
        if ($gateway['interface'] == $if && is_ipaddrv6($gateway['gateway'])) {
            $list[$gateway['name']] = $gateway['name'] . " - " . $gateway['gateway'];
        }
    }
    return $list;
}
include "head.inc";
if ($input_errors) {
    print_input_errors($input_errors);
}
if (is_subsystem_dirty('interfaces')) {
    print_info_box_np(sprintf(gettext("The %s configuration has been changed."), $wancfg['descr']) . "<br />" . gettext("You must apply the changes in order for them to take effect. Don't forget to adjust the DHCP Server range if needed after applying."));
}
if ($savemsg) {
    print_info_box($savemsg, 'success');
}
require_once 'classes/Form.class.php';
require_once 'classes/Modal.class.php';
$form = new Form(new Form_Button('Submit', gettext("Save")));
$section = new Form_Section('General configuration');
$section->addInput(new Form_Checkbox('enable', 'Enable', 'Enable interface', $pconfig['enable'], 'yes'));
$section->addInput(new Form_Input('descr', 'Description', 'text', $pconfig['descr']))->setHelp('Enter a description (name) for the interface here.');
$section->addInput(new Form_Select('type', 'IPv4 Configuration Type', $pconfig['type'], $types4));
$section->addInput(new Form_Select('type6', 'IPv6 Configuration Type', $pconfig['type6'], $types6));
$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');
$btnmymac->removeClass('btn-primary')->addClass('btn-success btn-sm');
$group = new Form_Group('MAC controls');
$group->add($macaddress);
// $group->add($btnmymac);
$optionlist = array();
$iflist = get_configured_interface_with_descr();
foreach ($iflist as $ifnam => $ifdescr) {
    $optionlist[$ifnam] = $ifdescr;
}
$section->addInput(new Form_Select('interface', 'Interface', $pconfig['interface'], $optionlist));
$section->addInput(new Form_Input('host', 'Hostname', 'text', $pconfig['host']))->setHelp('Fully qualified hostname of the host to be updated');
$section->addInput(new Form_Input('ttl', 'TTL (seconds)', 'number', $pconfig['ttl']));
$section->addInput(new Form_Input('keyname', 'Key name', 'text', $pconfig['keyname']))->setHelp('This must match the setting on the DNS server.');
$group = new Form_Group('Key Type');
$group->add(new Form_Checkbox('keytype', 'Key Type', 'Zone', $pconfig['keytype'] == 'zone', 'zone'))->displayAsRadio();
$group->add(new Form_Checkbox('keytype', 'Key Type', 'Host', $pconfig['keytype'] == 'host', 'host'))->displayAsRadio();
$group->add(new Form_Checkbox('keytype', 'Key Type', 'User', $pconfig['keytype'] == 'user', 'user'))->displayAsRadio();
$section->add($group);
$section->addInput(new Form_Input('keydata', 'Key', 'text', $pconfig['keydata']))->setHelp('Paste an HMAC-MD5 key here.');
$section->addInput(new Form_Input('server', 'Server', 'text', $pconfig['server']));
$section->addInput(new Form_Checkbox('usetcp', 'Protocol', 'Use TCP instead of UDP', $pconfig['usetcp']));
$section->addInput(new Form_Checkbox('usepublicip', 'Use public IP', 'If the interface IP is private, attempt to fetch and use the public IP instead.', $pconfig['usepublicip']));
$group = new Form_Group('Record Type');
$group->add(new Form_Checkbox('recordtype', 'Record Type', 'A (IPv4)', $pconfig['recordtype'] == 'A', 'A'))->displayAsRadio();
$group->add(new Form_Checkbox('recordtype', 'Record Type', 'AAAA (IPv6)', $pconfig['recordtype'] == 'AAAA', 'AAAA'))->displayAsRadio();
$group->add(new Form_Checkbox('recordtype', 'Record Type', 'Both', $pconfig['recordtype'] == 'both', 'both'))->displayAsRadio();
$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).');
if (isset($id) && $a_rfc2136[$id]) {
    $section->addInput(new Form_Input('id', null, 'hidden', $id));
}
$form->add($section);
print $form;
print_info_box(sprintf('You must configure a DNS server in %sSystem: ' . 'General setup %sor allow the DNS server list to be overridden ' . 'by DHCP/PPP on WAN for dynamic DNS updates to work.', '<a href="system.php">', '</a>'));
include "foot.inc";
Example #29
0
foreach ($ciflist as $interface => $ifdescr) {
    if (is_interface_wireless(get_real_interface($interface))) {
        $enabled = false;
        if ($if == $interface) {
            $enabled = true;
        }
        $tab_array[] = array(gettext("Status") . " ({$ifdescr})", $enabled, "status_wireless.php?if={$interface}");
    }
}
$rwlif = get_real_interface($if);
if ($_POST['rescanwifi'] != "") {
    mwexec_bg("/sbin/ifconfig {$rwlif} scan 2>&1");
    $savemsg = gettext("Rescan has been initiated in the background. Refresh this page in 10 seconds to see the results.");
}
if ($savemsg) {
    print_info_box($savemsg);
}
display_top_tabs($tab_array);
?>
</td></tr>
<tr><td>
<div id="mainarea" class="tabcont">
<input type="hidden" name="if" id="if" value="<?php 
echo htmlspecialchars($if);
?>
">
<b><input type="submit" name="rescanwifi" id="rescanwifi" value="Rescan"></b><br /><br />
<b><?php 
echo gettext("Nearby access points or ad-hoc peers");
?>
</b>
Example #30
0
        $grouping = false;
    }
    #increment counter
    $i++;
}
// e-o-foreach field described in the XML
$form->add($section);
$form->addGlobal(new Form_Input('id', null, 'hidden', $id));
// If we created an advanced section, add it (and a button) to the form here
if (!empty($advanced)) {
    $form->addGlobal(new Form_Button('showadv', 'Show advanced options'))->removeClass('btn-primary')->addClass('btn-default');
    $form->add($advanced);
}
print $form;
if ($pkg['note'] != "") {
    print_info_box($pkg['note'], 'info');
}
if ($pkg['custom_php_after_form_command']) {
    eval($pkg['custom_php_after_form_command']);
}
if ($pkg['fields']['field'] != "") {
    ?>
<script type="text/javascript">
//<![CDATA[
	events.push(function() {

	// Hide the advanced section
	var advanced_visible = false;

	// Hide on page load
	$('.advancedoptions').hide();