Commit 17568c17 authored by Franco Fichtner's avatar Franco Fichtner

www: various whitespace cleanups (2/2)

parent 042cbf2c
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
/* /*
* To change this template, choose Tools | Templates * To change this template, choose Tools | Templates
* and open the template in the editor. * and open the template in the editor.
* *
...@@ -74,7 +74,7 @@ if ($filter == "local") { ...@@ -74,7 +74,7 @@ if ($filter == "local") {
//get the sort method //get the sort method
$sort = $_GET['sort']; $sort = $_GET['sort'];
if ($sort == "out") if ($sort == "out")
{$sort_method = "-T";} {$sort_method = "-T";}
else else
{$sort_method = "-R";} {$sort_method = "-R";}
......
...@@ -98,20 +98,20 @@ include("head.inc"); ...@@ -98,20 +98,20 @@ include("head.inc");
<body> <body>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<section class="col-xs-12"> <section class="col-xs-12">
<?php if ($savemsg) print_info_box($savemsg); ?> <?php if ($savemsg) print_info_box($savemsg); ?>
<?PHP if ($carp_detected_problems) print_info_box(gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "<br />" . gettext("Check link status on all interfaces with configured CARP VIPs.")); ?> <?PHP if ($carp_detected_problems) print_info_box(gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "<br />" . gettext("Check link status on all interfaces with configured CARP VIPs.")); ?>
<div class="content-box"> <div class="content-box">
<form action="<?=$_SERVER['REQUEST_URI'];?>" method="post"> <form action="<?=$_SERVER['REQUEST_URI'];?>" method="post">
<?php <?php
$carpcount = 0; $carpcount = 0;
...@@ -138,10 +138,10 @@ include("head.inc"); ...@@ -138,10 +138,10 @@ include("head.inc");
} }
} }
?> ?>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-sort sortable"> <table class="table table-striped table-sort sortable">
<tr> <tr>
<td class="listhdrr" align="center"><?=gettext("CARP Interface"); ?></td> <td class="listhdrr" align="center"><?=gettext("CARP Interface"); ?></td>
<td class="listhdrr" align="center"><?=gettext("Virtual IP"); ?></td> <td class="listhdrr" align="center"><?=gettext("Virtual IP"); ?></td>
...@@ -150,8 +150,8 @@ include("head.inc"); ...@@ -150,8 +150,8 @@ include("head.inc");
<?php <?php
if ($carpcount == 0) { if ($carpcount == 0) {
echo "</table></div></form><center><br />" . gettext("Could not locate any defined CARP interfaces."); echo "</table></div></form><center><br />" . gettext("Could not locate any defined CARP interfaces.");
} }
elseif(is_array($config['virtualip']['vip'])) { elseif(is_array($config['virtualip']['vip'])) {
foreach($config['virtualip']['vip'] as $carp) { foreach($config['virtualip']['vip'] as $carp) {
...@@ -186,9 +186,9 @@ include("head.inc"); ...@@ -186,9 +186,9 @@ include("head.inc");
} }
?> ?>
</table> </table>
</div> </div>
<div class="col-xs-12"> <div class="col-xs-12">
<p class="vexpl"> <p class="vexpl">
<span class="red"><strong><?=gettext("Note"); ?>:</strong></span> <span class="red"><strong><?=gettext("Note"); ?>:</strong></span>
...@@ -203,11 +203,11 @@ include("head.inc"); ...@@ -203,11 +203,11 @@ include("head.inc");
echo "</pre>"; echo "</pre>";
?> ?>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -95,7 +95,7 @@ class MainTable { ...@@ -95,7 +95,7 @@ class MainTable {
} }
echo " <td width=\"{$this->width[$this->columns - 1]}%\" class=\"listhdr\">{$this->headers[$this->columns - 1]}</td>\n"; echo " <td width=\"{$this->width[$this->columns - 1]}%\" class=\"listhdr\">{$this->headers[$this->columns - 1]}</td>\n";
echo " <td width=\"10%\" class=\"list\">\n"; echo " <td width=\"10%\" class=\"list\">\n";
echo " </td>\n"; echo " </td>\n";
echo "</tr>\n"; echo "</tr>\n";
...@@ -134,24 +134,24 @@ class MainTable { ...@@ -134,24 +134,24 @@ class MainTable {
} }
private function display_footer() { private function display_footer() {
global $g; global $g;
} }
private function display_buttons($row) { private function display_buttons($row) {
if ($this->buttons['move']) if ($this->buttons['move'])
echo $this->display_button('move', $row); echo $this->display_button('move', $row);
if ($this->buttons['edit']) if ($this->buttons['edit'])
echo $this->display_button('edit', $row); echo $this->display_button('edit', $row);
if ($this->buttons['del']) if ($this->buttons['del'])
echo $this->display_button('del', $row); echo $this->display_button('del', $row);
if ($this->buttons['dup']) if ($this->buttons['dup'])
echo $this->display_button('dup', $row); echo $this->display_button('dup', $row);
} }
private function display_button($button, $row) { private function display_button($button, $row) {
global $g; global $g;
switch ($button) { switch ($button) {
case "move": { case "move": {
echo "<button name=\"move_{$row}\" type=\"submit\" title=\"Move selected entries before this entry\" onmouseover=\"fr_insline({$row}, true)\" onmouseout=\"fr_insline({$row}, false)\" class=\"btn btn-default btn-xs\"><span class=\"glyphicon glyphicon-arrow-left\"></span></button>"; echo "<button name=\"move_{$row}\" type=\"submit\" title=\"Move selected entries before this entry\" onmouseover=\"fr_insline({$row}, true)\" onmouseout=\"fr_insline({$row}, false)\" class=\"btn btn-default btn-xs\"><span class=\"glyphicon glyphicon-arrow-left\"></span></button>";
...@@ -170,9 +170,9 @@ class MainTable { ...@@ -170,9 +170,9 @@ class MainTable {
break; break;
} }
} }
} }
} }
?> ?>
\ No newline at end of file
...@@ -58,7 +58,7 @@ function upload_crash_report($files) { ...@@ -58,7 +58,7 @@ function upload_crash_report($files) {
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
curl_setopt($ch, CURLOPT_URL, $g['crashreporterurl']); curl_setopt($ch, CURLOPT_URL, $g['crashreporterurl']);
curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch); $response = curl_exec($ch);
return $response; return $response;
} }
...@@ -91,11 +91,11 @@ exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors); ...@@ -91,11 +91,11 @@ exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors);
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<form action="crash_reporter.php" method="post"> <form action="crash_reporter.php" method="post">
<div class="col-xs-12"> <div class="col-xs-12">
...@@ -145,7 +145,7 @@ exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors); ...@@ -145,7 +145,7 @@ exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors);
$crash_reports .= file_get_contents($cf); $crash_reports .= file_get_contents($cf);
} }
} }
} else { } else {
echo "Could not locate any crash data."; echo "Could not locate any crash data.";
} }
output_crash_reporter_html($crash_reports); output_crash_reporter_html($crash_reports);
...@@ -158,5 +158,5 @@ exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors); ...@@ -158,5 +158,5 @@ exec("/usr/bin/grep -vi warning /tmp/PHP_errors.log", $php_errors);
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -340,5 +340,3 @@ include("head.inc"); ...@@ -340,5 +340,3 @@ include("head.inc");
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
...@@ -65,7 +65,7 @@ if(stristr($retval, "error") == true) ...@@ -65,7 +65,7 @@ if(stristr($retval, "error") == true)
include("head.inc"); ?> include("head.inc"); ?>
<body link="#000000" vlink="#000000" alink="#000000"> <body link="#000000" vlink="#000000" alink="#000000">
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
......
...@@ -50,7 +50,7 @@ if($_POST['action']) { ...@@ -50,7 +50,7 @@ if($_POST['action']) {
echo "|1|" . gettext("Failed to read file") . ".|"; echo "|1|" . gettext("Failed to read file") . ".|";
} else { } else {
$data = base64_encode($data); $data = base64_encode($data);
echo "|0|{$_POST['file']}|{$data}|"; echo "|0|{$_POST['file']}|{$data}|";
} }
} }
exit; exit;
...@@ -86,14 +86,14 @@ require("head.inc"); ...@@ -86,14 +86,14 @@ require("head.inc");
?> ?>
<body> <body>
<?php <?php
outputJavaScriptFileInline("filebrowser/browser.js"); outputJavaScriptFileInline("filebrowser/browser.js");
outputJavaScriptFileInline("javascript/base64.js"); outputJavaScriptFileInline("javascript/base64.js");
include("fbegin.inc"); include("fbegin.inc");
?> ?>
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
function loadFile() { function loadFile() {
jQuery("#fileStatus").html("<?=gettext("Loading file"); ?> ..."); jQuery("#fileStatus").html("<?=gettext("Loading file"); ?> ...");
...@@ -129,10 +129,10 @@ include("fbegin.inc"); ...@@ -129,10 +129,10 @@ include("fbegin.inc");
function saveFile(file) { function saveFile(file) {
jQuery("#fileStatus").html("<?=gettext("Saving file"); ?> ..."); jQuery("#fileStatus").html("<?=gettext("Saving file"); ?> ...");
jQuery("#fileStatusBox").show(500); jQuery("#fileStatusBox").show(500);
var fileContent = Base64.encode(jQuery("#fileContent").val()); var fileContent = Base64.encode(jQuery("#fileContent").val());
fileContent = fileContent.replace(/\+/g,"%2B"); fileContent = fileContent.replace(/\+/g,"%2B");
jQuery.ajax( jQuery.ajax(
"<?=$_SERVER['SCRIPT_NAME'];?>", { "<?=$_SERVER['SCRIPT_NAME'];?>", {
type: "post", type: "post",
...@@ -153,46 +153,46 @@ include("fbegin.inc"); ...@@ -153,46 +153,46 @@ include("fbegin.inc");
<div class="row"> <div class="row">
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<div class="content-box-head container-fluid"> <div class="content-box-head container-fluid">
<!-- file status box --> <!-- file status box -->
<div style="display:none; background:#eeeeee;" id="fileStatusBox"> <div style="display:none; background:#eeeeee;" id="fileStatusBox">
<div class="vexpl" style="padding-left:15px;"> <div class="vexpl" style="padding-left:15px;">
<strong id="fileStatus"></strong> <strong id="fileStatus"></strong>
</div> </div>
</div> </div>
</div> </div>
<!-- control buttons --> <!-- control buttons -->
<div class="content-box-main "> <div class="content-box-main ">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped __nomb"> <table class="table table-striped __nomb">
<tbody> <tbody>
<tr> <tr>
<td><?=gettext("Save / Load from path"); ?>:</td> <td><?=gettext("Save / Load from path"); ?>:</td>
<td><input type="text" class="form-control file" id="fbTarget" size="45" /></td> <td><input type="text" class="form-control file" id="fbTarget" size="45" /></td>
</tr> </tr>
<tr> <tr>
<td>&nbsp;</td> <td>&nbsp;</td>
<td> <td>
<div class="btn-group"> <div class="btn-group">
<input type="button" class="btn btn-primary" onclick="loadFile();" value="<?=gettext('Load');?>" /> <input type="button" class="btn btn-primary" onclick="loadFile();" value="<?=gettext('Load');?>" />
<input type="button" class="btn btn-default" id="fbOpen" value="<?=gettext('Browse');?>" /> <input type="button" class="btn btn-default" id="fbOpen" value="<?=gettext('Browse');?>" />
<input type="button" class="btn btn-default" onclick="saveFile();" value="<?=gettext('Save');?>" /> <input type="button" class="btn btn-default" onclick="saveFile();" value="<?=gettext('Save');?>" />
</div> </div>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
<!-- file browser window, is hidden by default --> <!-- file browser window, is hidden by default -->
<div id="fbBrowser" style="display:none; background-color:#ffffff; border: 1px solid #cccccc; padding: 10px;"></div> <div id="fbBrowser" style="display:none; background-color:#ffffff; border: 1px solid #cccccc; padding: 10px;"></div>
<!-- file viewer/editor --> <!-- file viewer/editor -->
<div style="background:#eeeeee;" id="fileOutput"> <div style="background:#eeeeee;" id="fileOutput">
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
window.onload=function(){ window.onload=function(){
...@@ -202,9 +202,9 @@ include("fbegin.inc"); ...@@ -202,9 +202,9 @@ include("fbegin.inc");
</script> </script>
<textarea id="fileContent" name="fileContent" style="display:none; width: 100%; max-width:100%;" rows="30" cols=""></textarea> <textarea id="fileContent" name="fileContent" style="display:none; width: 100%; max-width:100%;" rows="30" cols=""></textarea>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</section> </section>
...@@ -215,7 +215,7 @@ include("fbegin.inc"); ...@@ -215,7 +215,7 @@ include("fbegin.inc");
function() { function() {
jQuery("#fbTarget").focus(); jQuery("#fbTarget").focus();
} }
); );
...@@ -230,4 +230,4 @@ include("fbegin.inc"); ...@@ -230,4 +230,4 @@ include("fbegin.inc");
//]]> //]]>
</script> </script>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* $Id$ */ /* $Id$ */
/* /*
Copyright (C) 2014 - Deciso B.V. Copyright (C) 2014 - Deciso B.V.
Exec+ v1.02-000 - Copyright 2001-2003 Exec+ v1.02-000 - Copyright 2001-2003
Created by technologEase (http://www.technologEase.com) Created by technologEase (http://www.technologEase.com)
All rights reserved. All rights reserved.
...@@ -185,23 +185,23 @@ if (isBlank( $_POST['txtRecallBuffer'] )) { ...@@ -185,23 +185,23 @@ if (isBlank( $_POST['txtRecallBuffer'] )) {
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<form action="<?=$_SERVER['REQUEST_URI'];?>" method="post" enctype="multipart/form-data" name="frmExecPlus" onsubmit="return frmExecPlus_onSubmit( this );"> <form action="<?=$_SERVER['REQUEST_URI'];?>" method="post" enctype="multipart/form-data" name="frmExecPlus" onsubmit="return frmExecPlus_onSubmit( this );">
<?php if ($ulmsg) echo "<p><strong>" . $ulmsg . "</strong></p>\n"; ?> <?php if ($ulmsg) echo "<p><strong>" . $ulmsg . "</strong></p>\n"; ?>
<?php if (!isBlank($_POST['txtCommand']) || !isBlank($_POST['txtPHPCommand'])):?> <?php if (!isBlank($_POST['txtCommand']) || !isBlank($_POST['txtPHPCommand'])):?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<header class="content-box-head container-fluid"> <header class="content-box-head container-fluid">
<h3><?=gettext("Execute result"); ?></h3> <h3><?=gettext("Execute result"); ?></h3>
</header> </header>
<div class="content-box-main col-xs-12"> <div class="content-box-main col-xs-12">
<?php <?php
if (!isBlank($_POST['txtCommand'])) { if (!isBlank($_POST['txtCommand'])) {
puts("<pre>"); puts("<pre>");
puts("\$ " . htmlspecialchars($_POST['txtCommand'])); puts("\$ " . htmlspecialchars($_POST['txtCommand']));
...@@ -227,27 +227,27 @@ if (!isBlank($_POST['txtPHPCommand'])) { ...@@ -227,27 +227,27 @@ if (!isBlank($_POST['txtPHPCommand'])) {
</div> </div>
</section> </section>
<? endif; ?> <? endif; ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<header class="content-box-head container-fluid"> <header class="content-box-head container-fluid">
<h3><?=gettext("Execute Shell command"); ?></h3> <h3><?=gettext("Execute Shell command"); ?></h3>
</header> </header>
<div class="content-box-main"> <div class="content-box-main">
<?php if (isBlank($_POST['txtCommand'])): ?> <?php if (isBlank($_POST['txtCommand'])): ?>
<p class="text-danger container-fluid"><strong><?=gettext("Note: this function is unsupported. Use it " . <p class="text-danger container-fluid"><strong><?=gettext("Note: this function is unsupported. Use it " .
"on your own risk"); ?>!</strong></p> "on your own risk"); ?>!</strong></p>
<?php endif; ?> <?php endif; ?>
<table class="table table-striped __nomb"> <table class="table table-striped __nomb">
<tbody> <tbody>
<tr> <tr>
<td width="150"><?=gettext("Command"); ?>:</td> <td width="150"><?=gettext("Command"); ?>:</td>
<td><input id="txtCommand" name="txtCommand" type="text" class="form-control" size="80" value="<?=htmlspecialchars($_POST['txtCommand']);?>" /></td> <td><input id="txtCommand" name="txtCommand" type="text" class="form-control" size="80" value="<?=htmlspecialchars($_POST['txtCommand']);?>" /></td>
</tr> </tr>
<tr> <tr>
<td>&nbsp;&nbsp;&nbsp;</td> <td>&nbsp;&nbsp;&nbsp;</td>
<td> <td>
<input type="hidden" name="txtRecallBuffer" value="<?=htmlspecialchars($_POST['txtRecallBuffer']) ?>" /> <input type="hidden" name="txtRecallBuffer" value="<?=htmlspecialchars($_POST['txtRecallBuffer']) ?>" />
...@@ -256,106 +256,106 @@ if (!isBlank($_POST['txtPHPCommand'])) { ...@@ -256,106 +256,106 @@ if (!isBlank($_POST['txtPHPCommand'])) {
<input type="button" class="btn" name="btnRecallNext" value=">" onclick="btnRecall_onClick( this.form, 1 );" /> <input type="button" class="btn" name="btnRecallNext" value=">" onclick="btnRecall_onClick( this.form, 1 );" />
<input type="button" class="btn" value="<?=gettext("Clear"); ?>" onclick="return Reset_onClick( this.form );" /> <input type="button" class="btn" value="<?=gettext("Clear"); ?>" onclick="return Reset_onClick( this.form );" />
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<header class="content-box-head container-fluid"> <header class="content-box-head container-fluid">
<h3><?=gettext("Download"); ?></h3> <h3><?=gettext("Download"); ?></h3>
</header> </header>
<div class="content-box-main "> <div class="content-box-main ">
<table class="table table-striped __nomb"> <table class="table table-striped __nomb">
<tbody> <tbody>
<tr> <tr>
<td width="150"><?=gettext("File to download"); ?>:</td> <td width="150"><?=gettext("File to download"); ?>:</td>
<td><input name="dlPath" type="text" class="form-control file" id="dlPath" size="50" /></td> <td><input name="dlPath" type="text" class="form-control file" id="dlPath" size="50" /></td>
</tr> </tr>
<tr> <tr>
<td valign="top">&nbsp;</td> <td valign="top">&nbsp;</td>
<td valign="top"> <td valign="top">
<input name="submit" type="submit" class="btn btn-primary" id="download" value="<?=gettext("Download"); ?>" /> <input name="submit" type="submit" class="btn btn-primary" id="download" value="<?=gettext("Download"); ?>" />
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<header class="content-box-head container-fluid"> <header class="content-box-head container-fluid">
<h3><?=gettext("Upload"); ?></h3> <h3><?=gettext("Upload"); ?></h3>
</header> </header>
<div class="content-box-main"> <div class="content-box-main">
<table class="table table-striped __nomb"> <table class="table table-striped __nomb">
<tbody> <tbody>
<tr> <tr>
<td width="150"><?=gettext("File to upload"); ?>:</td> <td width="150"><?=gettext("File to upload"); ?>:</td>
<td><input name="ulfile" type="file" class="formfld file" id="ulfile" /></td> <td><input name="ulfile" type="file" class="formfld file" id="ulfile" /></td>
</tr> </tr>
<tr> <tr>
<td valign="top">&nbsp;</td> <td valign="top">&nbsp;</td>
<td valign="top"> <td valign="top">
<input name="submit" type="submit" class="btn btn-primary" id="upload" value="<?=gettext("Upload"); ?>" /> <input name="submit" type="submit" class="btn btn-primary" id="upload" value="<?=gettext("Upload"); ?>" />
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</section> </section>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box">
<header class="content-box-head container-fluid"> <header class="content-box-head container-fluid">
<h3><?=gettext("PHP Execute"); ?></h3> <h3><?=gettext("PHP Execute"); ?></h3>
</header> </header>
<div class="content-box-main col-xs-12"> <div class="content-box-main col-xs-12">
<textarea id="txtPHPCommand" name="txtPHPCommand" rows="9" cols="80"><?=htmlspecialchars($_POST['txtPHPCommand']);?></textarea> <textarea id="txtPHPCommand" name="txtPHPCommand" rows="9" cols="80"><?=htmlspecialchars($_POST['txtPHPCommand']);?></textarea>
<br /> <br />
<input type="submit" class="btn btn-primary" value="<?=gettext("Execute"); ?>" /> <input type="submit" class="btn btn-primary" value="<?=gettext("Execute"); ?>" />
<p><strong><?=gettext("Example"); ?>:</strong> interfaces_carp_setup();</p> <p><strong><?=gettext("Example"); ?>:</strong> interfaces_carp_setup();</p>
</div> </div>
</div> </div>
</section> </section>
</form> </form>
</div> </div>
</div> </div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
<!-- <!--
...@@ -382,7 +382,7 @@ if (!isBlank($_POST['txtPHPCommand'])) { ...@@ -382,7 +382,7 @@ if (!isBlank($_POST['txtPHPCommand'])) {
</p> </p>
</td> </td>
</tr> </tr>
</table> </table>
</form> </form>
</div> </div>
......
...@@ -75,7 +75,7 @@ function return_ext_menu($section) { ...@@ -75,7 +75,7 @@ function return_ext_menu($section) {
if($menuitem['section'] != $section) continue; if($menuitem['section'] != $section) continue;
if($menuitem['url'] <> "") { if($menuitem['url'] <> "") {
$test_url=$menuitem['url']; $test_url=$menuitem['url'];
$addresswithport = getenv("HTTP_HOST"); $addresswithport = getenv("HTTP_HOST");
$colonpos = strpos($addresswithport, ":"); $colonpos = strpos($addresswithport, ":");
if ($colonpos !== False){ if ($colonpos !== False){
//my url is actually just the IP address of the pfsense box //my url is actually just the IP address of the pfsense box
...@@ -99,20 +99,20 @@ function return_ext_menu($section) { ...@@ -99,20 +99,20 @@ function return_ext_menu($section) {
function output_menu($arrayitem, $target = null) { function output_menu($arrayitem, $target = null) {
foreach ($arrayitem as $item) { foreach ($arrayitem as $item) {
if (isAllowedPage($item[1]) || $item[1]=="/index.php?logout") { if (isAllowedPage($item[1]) || $item[1]=="/index.php?logout") {
$attr = sprintf("href=\"%s\"", htmlentities($item[1])); $attr = sprintf("href=\"%s\"", htmlentities($item[1]));
if ($target) { if ($target) {
$attr .= sprintf(" target=\"%s\"", htmlentities($target)); $attr .= sprintf(" target=\"%s\"", htmlentities($target));
} }
$class = "list-group-item"; $class = "list-group-item";
$check = substr($item[1],1,-4); $check = substr($item[1],1,-4);
if (stripos($_SERVER['PHP_SELF'], $check) !== false) { if (stripos($_SERVER['PHP_SELF'], $check) !== false) {
$class .= " active"; $class .= " active";
} }
if ($item['class']) { if ($item['class']) {
$class .= " {$item['class']}"; $class .= " {$item['class']}";
} }
...@@ -130,27 +130,27 @@ function output_menu($arrayitem, $target = null) { ...@@ -130,27 +130,27 @@ function output_menu($arrayitem, $target = null) {
function active_menu($arrayitem, $pagename) { function active_menu($arrayitem, $pagename) {
$pagename = "/".ltrim($pagename,"/"); $pagename = "/".ltrim($pagename,"/");
foreach ($arrayitem as $item) { foreach ($arrayitem as $item) {
$check = substr($item[1],1,-4); $check = substr($item[1],1,-4);
if (stripos($pagename, $check) !== false) { if (stripos($pagename, $check) !== false) {
return true; return true;
} }
} }
return false; return false;
} }
function active_main_menu() { function active_main_menu() {
$options = func_get_args(); $options = func_get_args();
foreach ($options as $uri) { foreach ($options as $uri) {
if (substr($_SERVER['PHP_SELF'], 0, strlen($uri)) == $uri) { if (substr($_SERVER['PHP_SELF'], 0, strlen($uri)) == $uri) {
return true; return true;
} }
} }
return false; return false;
} }
...@@ -352,14 +352,14 @@ if(is_subsystem_dirty('packagelock')) { ...@@ -352,14 +352,14 @@ if(is_subsystem_dirty('packagelock')) {
<header class="page-head"> <header class="page-head">
<nav class="navbar navbar-default" role="navigation"> <nav class="navbar navbar-default" role="navigation">
<div class="container-fluid"> <div class="container-fluid">
<div class="navbar-header"> <div class="navbar-header">
<a class="navbar-brand" href="/"> <a class="navbar-brand" href="/">
<img class="brand-logo" src="/themes/<?=$g['theme'];?>/assets/images/default-logo.png" height="30" width="150"/> <img class="brand-logo" src="/themes/<?=$g['theme'];?>/assets/images/default-logo.png" height="30" width="150"/>
<img class="brand-icon" src="/themes/<?=$g['theme'];?>/assets/images/icon-logo.png" height="30" width="29"/> <img class="brand-icon" src="/themes/<?=$g['theme'];?>/assets/images/icon-logo.png" height="30" width="29"/>
</a> </a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navigation"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navigation">
<span class="sr-only">Toggle navigation</span> <span class="sr-only">Toggle navigation</span>
...@@ -368,113 +368,113 @@ if(is_subsystem_dirty('packagelock')) { ...@@ -368,113 +368,113 @@ if(is_subsystem_dirty('packagelock')) {
<span class="icon-bar"></span> <span class="icon-bar"></span>
</button> </button>
</div> </div>
<div class="collapse navbar-collapse"> <div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right"> <ul class="nav navbar-nav navbar-right">
<li id="menu_messages"> <li id="menu_messages">
<?php <?php
echo get_menu_messages(); echo get_menu_messages();
?> ?>
</li> </li>
<?php <?php
echo '<li>'.get_shortcut_main_link($shortcut_section, false).'</li>'; echo '<li>'.get_shortcut_main_link($shortcut_section, false).'</li>';
echo '<li>'.get_shortcut_status_link($shortcut_section, false).'</li>'; echo '<li>'.get_shortcut_status_link($shortcut_section, false).'</li>';
echo '<li>'.get_shortcut_log_link($shortcut_section, false).'</li>'; echo '<li>'.get_shortcut_log_link($shortcut_section, false).'</li>';
?> ?>
<?php if(! $g['disablehelpicon']): ?> <?php if(! $g['disablehelpicon']): ?>
<li><a href="<?php echo $helpurl; ?>" target="_blank" title="<?php echo gettext("Help for items on this page"); ?>">Help</a></li> <li><a href="<?php echo $helpurl; ?>" target="_blank" title="<?php echo gettext("Help for items on this page"); ?>">Help</a></li>
<?php endif; ?> <?php endif; ?>
<li class="active"><a href="/index.php?logout">Logout</a></li> <li class="active"><a href="/index.php?logout">Logout</a></li>
</ul> </ul>
</div> </div>
</div> </div>
</nav> </nav>
</header> </header>
<main class="page-content col-sm-10 col-sm-push-2 "> <main class="page-content col-sm-10 col-sm-push-2 ">
<aside id="navigation" class="page-side col-xs-12 col-sm-2 hidden-xs"> <aside id="navigation" class="page-side col-xs-12 col-sm-2 hidden-xs">
<div class="row"> <div class="row">
<nav class="page-side-nav" role="navigation"> <nav class="page-side-nav" role="navigation">
<div class="list-group" id="mainmenu"> <div class="list-group" id="mainmenu">
<?php $active = active_main_menu("/system"); ?> <?php $active = active_main_menu("/system"); ?>
<a href="#system" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-dashboard __iconspacer"></span><?php echo gettext("System"); ?></a> <a href="#system" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-dashboard __iconspacer"></span><?php echo gettext("System"); ?></a>
<div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="system"> <div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="system">
<?php <?php
output_menu($system_menu); output_menu($system_menu);
?> ?>
</div> </div>
<?php $active = active_main_menu("/interface"); ?> <?php $active = active_main_menu("/interface"); ?>
<a href="#interfaces" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-wrench __iconspacer"></span><?php echo gettext("Interfaces"); ?></a> <a href="#interfaces" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-wrench __iconspacer"></span><?php echo gettext("Interfaces"); ?></a>
<div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="interfaces"> <div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="interfaces">
<?php <?php
output_menu($interfaces_menu); output_menu($interfaces_menu);
?> ?>
</div> </div>
<?php $active = active_main_menu("/firewall"); ?> <?php $active = active_main_menu("/firewall"); ?>
<a href="#firewall" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-fire __iconspacer"></span><?php echo gettext("Firewall"); ?></a> <a href="#firewall" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-fire __iconspacer"></span><?php echo gettext("Firewall"); ?></a>
<div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="firewall"> <div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="firewall">
<?php <?php
output_menu($firewall_menu); output_menu($firewall_menu);
?> ?>
</div> </div>
<?php $active = active_main_menu("/service", "/load_balancer"); ?> <?php $active = active_main_menu("/service", "/load_balancer"); ?>
<a href="#services" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-cog __iconspacer"></span><?php echo gettext("Services"); ?></a> <a href="#services" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-cog __iconspacer"></span><?php echo gettext("Services"); ?></a>
<div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="services"> <div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="services">
<?php <?php
output_menu($services_menu); output_menu($services_menu);
?> ?>
</div> </div>
<?php $active = active_main_menu("/vpn"); ?> <?php $active = active_main_menu("/vpn"); ?>
<a href="#vpn" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-lock __iconspacer"></span><?php echo gettext("VPN"); ?></a> <a href="#vpn" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-lock __iconspacer"></span><?php echo gettext("VPN"); ?></a>
<div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="vpn"> <div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="vpn">
<?php <?php
output_menu($vpn_menu); output_menu($vpn_menu);
?> ?>
</div> </div>
<?php $active = active_main_menu("/status"); ?> <?php $active = active_main_menu("/status"); ?>
<a href="#statusmenu" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-tasks __iconspacer"></span><?php echo gettext("Status"); ?></a> <a href="#statusmenu" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-tasks __iconspacer"></span><?php echo gettext("Status"); ?></a>
<div class="collapse <?php if (active_menu($status_menu, $pagename)):?>active-menu in<? endif; ?>" id="statusmenu"> <div class="collapse <?php if (active_menu($status_menu, $pagename)):?>active-menu in<? endif; ?>" id="statusmenu">
<?php <?php
output_menu($status_menu); output_menu($status_menu);
?> ?>
</div> </div>
<?php $active = active_main_menu("/diag"); ?> <?php $active = active_main_menu("/diag"); ?>
<a href="#diagnostics" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-stats __iconspacer"></span><?php echo gettext("Diagnostics"); ?></a> <a href="#diagnostics" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-stats __iconspacer"></span><?php echo gettext("Diagnostics"); ?></a>
<div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="diagnostics"> <div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="diagnostics">
<?php <?php
output_menu($diagnostics_menu); output_menu($diagnostics_menu);
?> ?>
</div> </div>
<?php if(! $g['disablehelpmenu']): ?> <?php if(! $g['disablehelpmenu']): ?>
<?php $active = active_main_menu("/help"); ?> <?php $active = active_main_menu("/help"); ?>
<a href="#help" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-question-sign __iconspacer"></span><?php echo gettext("Help"); ?></a> <a href="#help" class="list-group-item <?php if ($active):?>active-menu-title<? endif; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="glyphicon glyphicon-question-sign __iconspacer"></span><?php echo gettext("Help"); ?></a>
<div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="help"> <div class="collapse <?php if ($active):?>active-menu in<? endif; ?>" id="help">
<?php <?php
output_menu($help_menu, "_blank"); output_menu($help_menu, "_blank");
...@@ -482,25 +482,25 @@ if(is_subsystem_dirty('packagelock')) { ...@@ -482,25 +482,25 @@ if(is_subsystem_dirty('packagelock')) {
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
</nav> </nav>
</div> </div>
</aside> </aside>
<div class="row"> <div class="row">
<header class="page-content-head"> <header class="page-content-head">
<div class="container-fluid"> <div class="container-fluid">
<form action="<?=$_SERVER['REQUEST_URI'];?>" method="post"> <form action="<?=$_SERVER['REQUEST_URI'];?>" method="post">
<ul class="list-inline"> <ul class="list-inline">
<li class="__mb"><h1><?=genhtmltitle($pgtitle);?></h1></li> <li class="__mb"><h1><?=genhtmltitle($pgtitle);?></h1></li>
<li class="btn-group-container"> <li class="btn-group-container">
<?php <?php
if (!$hide_service_status && !empty($shortcuts[$shortcut_section]['service'])) { if (!$hide_service_status && !empty($shortcuts[$shortcut_section]['service'])) {
$ssvc = array(); $ssvc = array();
switch ($shortcut_section) { switch ($shortcut_section) {
...@@ -512,31 +512,31 @@ if(is_subsystem_dirty('packagelock')) { ...@@ -512,31 +512,31 @@ if(is_subsystem_dirty('packagelock')) {
break; break;
default: default:
$ssvc = find_service_by_name($shortcuts[$shortcut_section]['service']); $ssvc = find_service_by_name($shortcuts[$shortcut_section]['service']);
} }
if (!empty($ssvc)) { if (!empty($ssvc)) {
echo get_service_status_icon($ssvc, false); echo get_service_status_icon($ssvc, false);
echo get_service_control_links($ssvc, false); echo get_service_control_links($ssvc, false);
} }
} }
?> ?>
<? if (!empty($main_buttons)): foreach ($main_buttons as $button): ?> <? if (!empty($main_buttons)): foreach ($main_buttons as $button): ?>
<a href="<?=$button['href'];?>" class="btn btn-primary"><span class="glyphicon glyphicon-plus-sign __iconspacer"></span><?=$button['label'];?></a> <a href="<?=$button['href'];?>" class="btn btn-primary"><span class="glyphicon glyphicon-plus-sign __iconspacer"></span><?=$button['label'];?></a>
<? endforeach; endif; ?> <? endforeach; endif; ?>
<? if (isset($widgetfiles)): ?> <? if (isset($widgetfiles)): ?>
<a href="#" id="updatepref" style="display:none" onclick="return updatePref();" class="btn btn-primary"><?=gettext("Save Settings");?></a> <a href="#" id="updatepref" style="display:none" onclick="return updatePref();" class="btn btn-primary"><?=gettext("Save Settings");?></a>
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal_widgets"><span class="glyphicon glyphicon-plus-sign __iconspacer"></span>Add widget</button> <button type="button" class="btn btn-default" data-toggle="modal" data-target="#modal_widgets"><span class="glyphicon glyphicon-plus-sign __iconspacer"></span>Add widget</button>
<? endif; ?> <? endif; ?>
<!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal_widgets"><span class="glyphicon glyphicon-plus-sign __iconspacer"></span>Add widget</button> --> <!-- <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modal_widgets"><span class="glyphicon glyphicon-plus-sign __iconspacer"></span>Add widget</button> -->
</li> </li>
</ul> </ul>
</form> </form>
</div> </div>
</header> </header>
\ No newline at end of file
<?php include("foot.inc"); exit; ?> <?php include("foot.inc"); exit; ?>
\ No newline at end of file
<footer class="page-foot col-sm-push-2"> <footer class="page-foot col-sm-push-2">
<div class="container-fluid"> <div class="container-fluid">
<a target="_blank" href="<?=$g['product_website_footer']?>" class="redlnk"><?=$g['product_name']?></a> is &copy; <a target="_blank" href="<?=$g['product_website_footer']?>" class="redlnk"><?=$g['product_name']?></a> is &copy;
<?=$g['product_copyright_years']?> by <a href="<?=$g['product_copyright_url']?>" class="tblnk"><?=$g['product_copyright']?></a> All Rights Reserved. <?=$g['product_copyright_years']?> by <a href="<?=$g['product_copyright_url']?>" class="tblnk"><?=$g['product_copyright']?></a> All Rights Reserved.
[<a href="/license.php" class="tblnk">view license</a>] [<a href="/license.php" class="tblnk">view license</a>]
</div> </div>
</footer> </footer>
</div> </div>
<!-- /row--> <!-- /row-->
</main> </main>
<?php if (isset($widgetfiles)): <?php if (isset($widgetfiles)):
$widgetfiles_add = $widgetfiles; $widgetfiles_add = $widgetfiles;
sort($widgetfiles_add); sort($widgetfiles_add);
?> ?>
<div class="modal fade" id="modal_widgets" tabindex="-1" role="dialog" aria-labelledby="modal_widgets_label" aria-hidden="true"> <div class="modal fade" id="modal_widgets" tabindex="-1" role="dialog" aria-labelledby="modal_widgets_label" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<h4 class="modal-title" id="modal_widgets_label"><?=gettext("Available Widgets"); ?></h4> <h4 class="modal-title" id="modal_widgets_label"><?=gettext("Available Widgets"); ?></h4>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
<?php <?php
foreach($widgetfiles_add as $widget): foreach($widgetfiles_add as $widget):
if(!stristr($widget, "widget.php")) if(!stristr($widget, "widget.php"))
continue; continue;
...@@ -43,16 +43,16 @@ ...@@ -43,16 +43,16 @@
$widgettitlelink = $widgetname . "_title_link"; $widgettitlelink = $widgetname . "_title_link";
if ($$widgettitle != ""): if ($$widgettitle != ""):
?> ?>
<tr><td style="cursor: pointer;" onclick='return addWidget("<?php echo $widgetname; ?>")'><?php echo $$widgettitle; ?></td></tr> <tr><td style="cursor: pointer;" onclick='return addWidget("<?php echo $widgetname; ?>")'><?php echo $$widgettitle; ?></td></tr>
<?php elseif ($nicename != ""): ?> <?php elseif ($nicename != ""): ?>
<tr><td style="cursor: pointer;" onclick='return addWidget("<?php echo $widgetname; ?>")'><?php echo $nicename; ?></td></tr> <tr><td style="cursor: pointer;" onclick='return addWidget("<?php echo $widgetname; ?>")'><?php echo $nicename; ?></td></tr>
<?php endif; endforeach; ?> <?php endif; endforeach; ?>
</table> </table>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div> </div>
...@@ -60,6 +60,6 @@ ...@@ -60,6 +60,6 @@
</div><!-- /modal-dialog --> </div><!-- /modal-dialog -->
</div><!-- /modal --> </div><!-- /modal -->
<?php endif; ?> <?php endif; ?>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -47,4 +47,4 @@ include_once("includes/functions.inc.php"); ...@@ -47,4 +47,4 @@ include_once("includes/functions.inc.php");
echo get_stats(); echo get_stats();
?> ?>
\ No newline at end of file
...@@ -2,21 +2,21 @@ ...@@ -2,21 +2,21 @@
/* /*
graph.php graph.php
part of m0n0wall (http://m0n0.ch/wall) part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2004-2006 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net> Copyright (C) 2004-2006 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
and Jonathan Watt <jwatt@jwatt.org>. and Jonathan Watt <jwatt@jwatt.org>.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, 1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
...@@ -98,7 +98,7 @@ $fetch_link = "ifstats.php?if=" . htmlspecialchars($ifnum); ...@@ -98,7 +98,7 @@ $fetch_link = "ifstats.php?if=" . htmlspecialchars($ifnum);
if(file_exists("/usr/local/www/themes/{$g['theme']}/graph.php")) { if(file_exists("/usr/local/www/themes/{$g['theme']}/graph.php")) {
$themetxt = file_get_contents("/usr/local/www/themes/{$g['theme']}/graph.php"); $themetxt = file_get_contents("/usr/local/www/themes/{$g['theme']}/graph.php");
eval($themetxt); eval($themetxt);
} }
/********* Graph DATA **************/ /********* Graph DATA **************/
print('<?xml version="1.0" ?>' . "\n");?> print('<?xml version="1.0" ?>' . "\n");?>
...@@ -243,15 +243,15 @@ function plot_data(obj) { ...@@ -243,15 +243,15 @@ function plot_data(obj) {
last_ifout = ifout; last_ifout = ifout;
var graphTimerId = 0; var graphTimerId = 0;
switch (plot_in.length) { switch (plot_in.length) {
case 0: case 0:
SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'visible'); SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'visible');
plot_in[0] = diff_ifin / diff_ugmt; plot_in[0] = diff_ifin / diff_ugmt;
plot_out[0] = diff_ifout / diff_ugmt; plot_out[0] = diff_ifout / diff_ugmt;
setTimeout('fetch_data()',<?=1000*($time_interval + $init_delay)?>); setTimeout('fetch_data()',<?=1000*($time_interval + $init_delay)?>);
return; return;
case 1: case 1:
SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'hidden'); SVGDoc.getElementById("collect_initial").setAttributeNS(null, 'visibility', 'hidden');
break; break;
case max_num_points: case max_num_points:
// shift plot to left if the maximum number of plot points has been reached // shift plot to left if the maximum number of plot points has been reached
var i = 0; var i = 0;
...@@ -314,7 +314,7 @@ function plot_data(obj) { ...@@ -314,7 +314,7 @@ function plot_data(obj) {
rmax *= 1.25; rmax *= 1.25;
else else
rmax *= 2; rmax *= 2;
if (i == 8) if (i == 8)
rmax *= 1.024; rmax *= 1.024;
} }
......
...@@ -2,21 +2,21 @@ ...@@ -2,21 +2,21 @@
/* /*
$Id$ $Id$
part of m0n0wall (http://m0n0.ch/wall) part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net> Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
and Jonathan Watt <jwatt@jwatt.org>. and Jonathan Watt <jwatt@jwatt.org>.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met: modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, 1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright 2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution. documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
/* Include authentication routines */ /* Include authentication routines */
/* THIS MUST BE ABOVE ALL OTHER CODE */ /* THIS MUST BE ABOVE ALL OTHER CODE */
if(!$nocsrf) { if(!$nocsrf) {
function csrf_startup() { function csrf_startup() {
csrf_conf('rewrite-js', '/csrf/csrf-magic.js'); csrf_conf('rewrite-js', '/csrf/csrf-magic.js');
$timeout_minutes = isset($config['system']['webgui']['session_timeout']) ? $config['system']['webgui']['session_timeout'] : 240; $timeout_minutes = isset($config['system']['webgui']['session_timeout']) ? $config['system']['webgui']['session_timeout'] : 240;
...@@ -267,8 +267,8 @@ function print_input_errors($input_errors) { ...@@ -267,8 +267,8 @@ function print_input_errors($input_errors) {
echo '<div class="col-xs-12"><div class="alert alert-danger alert-dismissible" role="alert"> echo '<div class="col-xs-12"><div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button> <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
'; ';
echo "<p>" . gettext("The following input errors were detected:") . "</p>\n<ul>"; echo "<p>" . gettext("The following input errors were detected:") . "</p>\n<ul>";
foreach ($input_errors as $ierr) { foreach ($input_errors as $ierr) {
echo "<li>" . htmlspecialchars($ierr) . "</li>"; echo "<li>" . htmlspecialchars($ierr) . "</li>";
} }
...@@ -335,10 +335,10 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und ...@@ -335,10 +335,10 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und
global $g; global $g;
if(stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) { if(stristr($msg, "apply") != false || stristr($msg, "save") != false || stristr($msg, "create") != false) {
$savebutton .= "<input class=\"btn btn-default\" type=\"button\" value=\"". gettext("Undo") . "\" onclick=\"document.location='{$undo}'\" />"; $savebutton .= "<input class=\"btn btn-default\" type=\"button\" value=\"". gettext("Undo") . "\" onclick=\"document.location='{$undo}'\" />";
$savebutton .= "<input class=\"btn btn-default\" name=\"{$name}\" type=\"submit\" class=\"formbtn\" id=\"${name}\" value=\"{$value}\" />"; $savebutton .= "<input class=\"btn btn-default\" name=\"{$name}\" type=\"submit\" class=\"formbtn\" id=\"${name}\" value=\"{$value}\" />";
if($_POST['if']) if($_POST['if'])
$savebutton .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />"; $savebutton .= "<input type=\"hidden\" name=\"if\" value=\"" . htmlspecialchars($_POST['if']) . "\" />";
} }
...@@ -361,11 +361,11 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und ...@@ -361,11 +361,11 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und
if(!$savebutton) { if(!$savebutton) {
$savebutton = "<input class=\"btn btn-default\" value=\"" . gettext("Close") . "\" type=\"button\" onclick=\"$('#redboxtable').hide();\" />"; $savebutton = "<input class=\"btn btn-default\" value=\"" . gettext("Close") . "\" type=\"button\" onclick=\"$('#redboxtable').hide();\" />";
} }
$url = $_SERVER['REQUEST_URI']; $url = $_SERVER['REQUEST_URI'];
echo <<<EOFnp echo <<<EOFnp
<div class="col-xs-12" id="redboxtable"><form action="{$url}" method="post"> <div class="col-xs-12" id="redboxtable"><form action="{$url}" method="post">
<div class="alert alert-warning" summary="red box table"> <div class="alert alert-warning" summary="red box table">
<p>{$msg}<br /><br /></p> <p>{$msg}<br /><br /></p>
...@@ -374,7 +374,7 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und ...@@ -374,7 +374,7 @@ function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $und
{$undobutton} {$undobutton}
</div> </div>
</div> </div>
</form></div> </form></div>
EOFnp; EOFnp;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment