+
+
-
-
-
+
+
\ No newline at end of file
diff --git a/usr/local/www/green_dot.jpg b/usr/local/www/green_dot.jpg
deleted file mode 100755
index 9df0abf6a3..0000000000
Binary files a/usr/local/www/green_dot.jpg and /dev/null differ
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index 62de6077e7..5e351f6584 100644
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -97,15 +97,15 @@ if(!$ignorefirmwarelock) {
/* Reserved table names to avoid colision */
$reserved_table_names = array(
- "bogons",
- "bogonsv6",
- "negate_networks",
- "snort2c",
- "sshlockout",
- "tonatsubnets",
- "virusprot",
- "vpn_networks",
- "webConfiguratorlockout"
+ "bogons",
+ "bogonsv6",
+ "negate_networks",
+ "snort2c",
+ "sshlockout",
+ "tonatsubnets",
+ "virusprot",
+ "vpn_networks",
+ "webConfiguratorlockout"
);
$firewall_rules_dscp_types = array("af11",
@@ -275,9 +275,9 @@ function print_input_errors($input_errors) {
-
+
EOF;
- echo "" . gettext("The following input errors were detected:") . "
\n";
+ echo "" . gettext("The following input errors were detected:") . "
\n";
foreach ($input_errors as $ierr) {
echo "" . htmlspecialchars($ierr) . " ";
}
@@ -312,63 +312,15 @@ function print_info_box_np($msg, $name="apply",$value="", $showapply=false) {
$nifty_background = "#FFF";
if(stristr($msg, gettext("apply")) != false || stristr($msg, gettext("save")) != false || stristr($msg, gettext("create")) != false || $showapply) {
- $savebutton = "";
- $savebutton .= " ";
+ $dismiss = "alert-dismissible";
+ $button = ''.$name.' ';
+
if($_POST['if'])
$savebutton .= " ";
- $savebutton.=" ";
- }
- $nifty_redbox = "#990000";
- $nifty_blackbox = "#000000";
-
- $themename = $g['theme'];
-
- if(file_exists("/usr/local/www/themes/{$themename}/tabcontrols.php")) {
- $toeval = file_get_contents("/usr/local/www/themes/{$themename}/tabcontrols.php");
- eval($toeval);
- }
-
- if(file_exists("/usr/local/www/themes/{$themename}/infobox.php")) {
- $toeval = file_get_contents("/usr/local/www/themes/{$themename}/infobox.php");
- eval($toeval);
- }
-
- if(!$savebutton) {
- $savebutton = " ";
- }
-
- echo <<
-
-
-
-
-
-
-
-
-
- {$msg}
-
- {$savebutton}
-
-
-
-
-
-
-
-
-EOFnp;
+ } else
+ $button = '× ';
+ echo ''.$msg.'
';
}
function print_info_box_np_undo($msg, $name="apply",$value="Apply changes", $undo) {
@@ -950,7 +902,7 @@ function echo_array($array,$return_me=false){
* NAME
* display_top_tabs - display tabs with rounded edges
* INPUTS
- * $text - array of tabs
+ * $text - array of tabs
* RESULT
* null
******/
diff --git a/usr/local/www/head.inc b/usr/local/www/head.inc
index 2cd7add846..7c319d482d 100755
--- a/usr/local/www/head.inc
+++ b/usr/local/www/head.inc
@@ -3,8 +3,6 @@
pfSense_MODULE: header
*/
-$g['theme'] = get_current_theme();
-
$pagetitle = gentitle( $pgtitle );
if (isset($config['system']['webgui']['pagenamefirst']))
@@ -12,105 +10,23 @@ if (isset($config['system']['webgui']['pagenamefirst']))
else
$tabtitle = $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pagetitle;
?>
-
-
+
+
-
-
-
-
- ";
- else:
- echo " ";
- endif;
- ?>
-
-
- "; ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- \n"; ?>
+
+ = $tabtitle ?>
+
\n";
- echo "\t\n";
- }
- echo "\t\n";
- echo "\t\n";
- echo "\t\n";
- echo "\t\n";
- if(file_exists("{$g['www_path']}/javascript/global.js"))
- echo "\t\n";
- /*
- * Find all javascript files that need to be included
- * for this page ... from the arrays ... :)
- * Coded by: Erik Kristensen
- */
-
- $dir = trim(basename($_SERVER["SCRIPT_FILENAME"], '.php'));
- $path = "{$g['www_path']}/javascript/" . $dir . "/";
- if (is_dir($path)) {
- if ($dh = opendir($path)) {
- while (($file = readdir($dh)) !== false) {
- if (is_dir($file))
- continue;
- echo "\t\n";
- }
- closedir($dh);
- }
- }
-
-if (!isset($closehead))
- echo "";
-
/* If this page is being remotely managed then do not allow the loading of the contents. */
-if($config['remote_managed_pages']['item']) {
+if ($config['remote_managed_pages']['item']) {
foreach($config['remote_managed_pages']['item'] as $rmp) {
- if($rmp == $_SERVER['SCRIPT_NAME']) {
+ if ($rmp == $_SERVER['SCRIPT_NAME']) {
include("fbegin.inc");
print_info_box_np("This page is currently being managed by a remote machine.");
include("fend.inc");
exit;
}
- }
+ }
}
-?>
+?>
\ No newline at end of file
diff --git a/usr/local/www/headjs.php b/usr/local/www/headjs.php
index 6a9e2fb8d9..a14806ffc7 100644
--- a/usr/local/www/headjs.php
+++ b/usr/local/www/headjs.php
@@ -1,29 +1,29 @@
<\/div>\";
- jQuery('#submit').before(to_insert);
- }
- }
-
- function submit_form(e){
- // debugging helper
- //alert(Form.serialize($('iform')));
+ function init() {
+ if(jQuery('#submit') && ! noAjaxOnSubmit) {
+ // debugging helper
+ //alert('adding observe event for submit button');
+
+ jQuery(\"#submit\").click(submit_form);
+ jQuery('#submit').click(function() {return false;});
+ var to_insert = \"<\/div>\";
+ jQuery('#submit').before(to_insert);
+ }
+ }
+
+ function submit_form(e){
+ // debugging helper
+ //alert(Form.serialize($('iform')));
- if(jQuery('#inputerrors'))
- jQuery('#inputerrors').html('
Loading...<\/i><\/b><\/center>');
-
- /* dsh: Introduced because pkg_edit tries to set some hidden fields
- * if executing submit's onclick event. The click gets deleted
- * by Ajax. Hence using onkeydown instead.
- */
- if(jQuery('#submit').prop('keydown')) {
- jQuery('#submit').keydown();
- jQuery('#submit').css('visibility','hidden');
- }
- if(jQuery('#cancelbutton'))
- jQuery('#cancelbutton').css('visibility','hidden');
- jQuery('#loading').css('visibility','visible');
- // submit the form using Ajax
- }
-
- function formSubmitted(resp) {
- var responseText = resp.responseText;
-
- // debugging helper
- // alert(responseText);
-
- if(responseText.indexOf('html') > 0) {
- /* somehow we have been fed an html page! */
- //alert('Somehow we have been fed an html page! Forwarding to /.');
- document.location.href = '/';
- }
-
- eval(responseText);
- }
-
- /* this function will be called if an HTTP error will be triggered */
- function formFailure(resp) {
- showajaxmessage(resp.responseText);
- if(jQuery('#submit'))
- jQuery('#submit').css('visibility','visible');
+ if(jQuery('#inputerrors'))
+ jQuery('#inputerrors').html(' Loading...<\/i><\/b><\/center>');
+
+ /* dsh: Introduced because pkg_edit tries to set some hidden fields
+ * if executing submit's onclick event. The click gets deleted
+ * by Ajax. Hence using onkeydown instead.
+ */
+ if(jQuery('#submit').prop('keydown')) {
+ jQuery('#submit').keydown();
+ jQuery('#submit').css('visibility','hidden');
+ }
if(jQuery('#cancelbutton'))
- jQuery('#cancelbutton').css('visibility','visible');
+ jQuery('#cancelbutton').css('visibility','hidden');
+ jQuery('#loading').css('visibility','visible');
+ // submit the form using Ajax
+ }
+
+ function formSubmitted(resp) {
+ var responseText = resp.responseText;
+
+ // debugging helper
+ // alert(responseText);
+
+ if(responseText.indexOf('html') > 0) {
+ /* somehow we have been fed an html page! */
+ //alert('Somehow we have been fed an html page! Forwarding to /.');
+ document.location.href = '/';
+ }
+
+ eval(responseText);
+ }
+
+ /* this function will be called if an HTTP error will be triggered */
+ function formFailure(resp) {
+ showajaxmessage(resp.responseText);
+ if(jQuery('#submit'))
+ jQuery('#submit').css('visibility','visible');
+ if(jQuery('#cancelbutton'))
+ jQuery('#cancelbutton').css('visibility','visible');
if(jQuery('#loading'))
- jQuery('#loading').css('visibility','hidden');
+ jQuery('#loading').css('visibility','hidden');
- }
-
- function showajaxmessage(message) {
- var message_html;
+ }
+
+ function showajaxmessage(message) {
+ var message_html;
- if (message == '') {
- NiftyCheck();
- Rounded(\"div#redbox\",\"all\",\"#FFF\",\"#990000\",\"smooth\");
- Rounded(\"td#blackbox\",\"all\",\"#FFF\",\"#000000\",\"smooth\");
+ if (message == '') {
+ NiftyCheck();
+ Rounded(\"div#redbox\",\"all\",\"#FFF\",\"#990000\",\"smooth\");
+ Rounded(\"td#blackbox\",\"all\",\"#FFF\",\"#000000\",\"smooth\");
- if(jQuery('#submit'))
- jQuery('#submit').css('visibility','visible');
- if(jQuery('#cancelbutton'))
- jQuery('#cancelbutton').css('visibility','visible');
- if(jQuery('#loading'))
- jQuery('#loading').css('visibility','hidden');
+ if(jQuery('#submit'))
+ jQuery('#submit').css('visibility','visible');
+ if(jQuery('#cancelbutton'))
+ jQuery('#cancelbutton').css('visibility','visible');
+ if(jQuery('#loading'))
+ jQuery('#loading').css('visibility','hidden');
- return;
- }
+ return;
+ }
- message_html = '';
- message_html += '';
- message_html += '
';
- message_html += ' ';
- message_html += '<\/td> ';
- message_html += '' + message + '<\/b><\/font><\/td>';
+ message_html = '';
+ message_html += '';
+ message_html += '
';
+ message_html += ' ';
+ message_html += '<\/td> ';
+ message_html += '' + message + '<\/b><\/font><\/td>';
- if(message.indexOf('apply') > 0) {
- message_html += ' ';
- message_html += ' ';
- message_html += '<\/td>';
- }
+ if(message.indexOf('apply') > 0) {
+ message_html += ' ';
+ message_html += ' ';
+ message_html += '<\/td>';
+ }
- message_html += '<\/tr><\/table><\/div><\/td><\/table> ';
- jQuery('#inputerrors').html(message_html);
+ message_html += '<\/tr><\/table><\/div><\/td><\/table> ';
+ jQuery('#inputerrors').html(message_html);
- NiftyCheck();
- Rounded(\"div#redbox\",\"all\",\"#FFF\",\"#990000\",\"smooth\");
- Rounded(\"td#blackbox\",\"all\",\"#FFF\",\"#000000\",\"smooth\");
+ NiftyCheck();
+ Rounded(\"div#redbox\",\"all\",\"#FFF\",\"#990000\",\"smooth\");
+ Rounded(\"td#blackbox\",\"all\",\"#FFF\",\"#000000\",\"smooth\");
- if(jQuery('#submit'))
- jQuery('#submit').css('visibility','visible');
- if(jQuery('#cancelbutton'))
- jQuery('#cancelbutton').css('visibility','visible');
- if(jQuery('#loading'))
- jQuery('#loading').css('visibility','hidden');
- if(jQuery('#inputerrors'))
- window.scrollTo(0, 0);
- }
+ if(jQuery('#submit'))
+ jQuery('#submit').css('visibility','visible');
+ if(jQuery('#cancelbutton'))
+ jQuery('#cancelbutton').css('visibility','visible');
+ if(jQuery('#loading'))
+ jQuery('#loading').css('visibility','hidden');
+ if(jQuery('#inputerrors'))
+ window.scrollTo(0, 0);
+ }
";
return $headjs;
diff --git a/usr/local/www/index.php b/usr/local/www/index.php
index 7041b72ee4..93ac7fbbe1 100644
--- a/usr/local/www/index.php
+++ b/usr/local/www/index.php
@@ -2,7 +2,7 @@
/* $Id$ */
/*
index.php
- Copyright (C) 2013-2014 Electric Sheep Fencing, LP
+ Copyright (C) 2013-2014 Electric Sheep Fencing, LP
Copyright (C) 2004-2012 Scott Ullrich
All rights reserved.
@@ -14,11 +14,11 @@
modification, are permitted provided that the following conditions are met:
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
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
@@ -87,181 +87,141 @@ if($g['disablecrashreporter'] != true) {
}
##build list of widgets
-$directory = "/usr/local/www/widgets/widgets/";
-$dirhandle = opendir($directory);
-$filename = "";
-$widgetnames = array();
-$widgetfiles = array();
-$widgetlist = array();
-
-while (false !== ($filename = readdir($dirhandle))) {
- $periodpos = strpos($filename, ".");
- /* Ignore files not ending in .php */
- if (substr($filename, -4, 4) != ".php")
- continue;
- $widgetname = substr($filename, 0, $periodpos);
- $widgetnames[] = $widgetname;
- if ($widgetname != "system_information")
- $widgetfiles[] = $filename;
+foreach (glob("/usr/local/www/widgets/widgets/*.widget.php") as $file)
+{
+ list($name, $ext) = explode('.widget.php', basename($file), 2);
+ $widgets[ $name ] = array('name' => ucwords(str_replace('_', ' ', $name)));
}
-##sort widgets alphabetically
-sort($widgetfiles);
-
##insert the system information widget as first, so as to be displayed first
-array_unshift($widgetfiles, "system_information.widget.php");
+unset($widgets['system_information']);
+$widgets = array_merge(array('system_information' => array('name' => 'System Information')), $widgets);
##if no config entry found, initialize config entry
if (!is_array($config['widgets'])) {
$config['widgets'] = array();
}
- if ($_POST && $_POST['submit']) {
- $config['widgets']['sequence'] = $_POST['sequence'];
+if ($_POST && $_POST['submit']) {
+ $config['widgets']['sequence'] = $_POST['sequence'];
- foreach ($widgetnames as $widget){
- if ($_POST[$widget . '-config']){
- $config['widgets'][$widget . '-config'] = $_POST[$widget . '-config'];
- }
- }
-
- write_config(gettext("Widget configuration has been changed."));
- header("Location: index.php");
- exit;
- }
-
- ## Load Functions Files
- require_once('includes/functions.inc.php');
-
- ## Check to see if we have a swap space,
- ## if true, display, if false, hide it ...
- if(file_exists("/usr/sbin/swapinfo")) {
- $swapinfo = `/usr/sbin/swapinfo`;
- if(stristr($swapinfo,'%') == true) $showswap=true;
- }
-
- ## User recently restored his config.
- ## If packages are installed lets resync
- if(file_exists('/conf/needs_package_sync')) {
- if($config['installedpackages'] <> '' && is_array($config['installedpackages']['package'])) {
- if($g['platform'] == "pfSense" || $g['platform'] == "nanobsd") {
- ## If the user has logged into webGUI quickly while the system is booting then do not redirect them to
- ## the package reinstall page. That is about to be done by the boot script anyway.
- ## The code in fbegin.inc will put up a notice to the user.
- if (!platform_booting()) {
- header('Location: pkg_mgr_install.php?mode=reinstallall');
- exit;
- }
- }
- } else {
- conf_mount_rw();
- @unlink('/conf/needs_package_sync');
- conf_mount_ro();
+ foreach($widgets as $widgetname => $widgetconfig){
+ if ($_POST[$widgetname . '-config']){
+ $config['widgets'][$widgetname . '-config'] = $_POST[$name . '-config'];
}
}
- ## If it is the first time webConfigurator has been
- ## accessed since initial install show this stuff.
- if(file_exists('/conf/trigger_initial_wizard')) {
- echo <<
-
+ write_config(gettext("Widget configuration has been changed."));
+ header("Location: index.php");
+ exit;
+}
+
+## Load Functions Files
+require_once('includes/functions.inc.php');
+
+## Check to see if we have a swap space,
+## if true, display, if false, hide it ...
+if(file_exists("/usr/sbin/swapinfo")) {
+ $swapinfo = `/usr/sbin/swapinfo`;
+ if(stristr($swapinfo,'%') == true) $showswap=true;
+}
+
+## User recently restored his config.
+## If packages are installed lets resync
+if(file_exists('/conf/needs_package_sync')) {
+ if($config['installedpackages'] <> '' && is_array($config['installedpackages']['package'])) {
+ if($g['platform'] == "pfSense" || $g['platform'] == "nanobsd") {
+ ## If the user has logged into webGUI quickly while the system is booting then do not redirect them to
+ ## the package reinstall page. That is about to be done by the boot script anyway.
+ ## The code in fbegin.inc will put up a notice to the user.
+ if (!platform_booting()) {
+ header('Location: pkg_mgr_install.php?mode=reinstallall');
+ exit;
+ }
+ }
+ } else {
+ conf_mount_rw();
+ @unlink('/conf/needs_package_sync');
+ conf_mount_ro();
+ }
+}
+
+## If it is the first time webConfigurator has been
+## accessed since initial install show this stuff.
+if(file_exists('/conf/trigger_initial_wizard')) {
+?>
+
+
+
{$g['product_name']}.localdomain - {$g['product_name']} first time setup
-
-
-
-
+
+
+
+
+
+
=sprintf(gettext("Welcome to %s!\n"),$g['product_name'])?>
+
=gettext("One moment while we start the initial setup wizard.")?>
+
=gettext("Embedded platform users: Please be patient, the wizard takes a little longer to run than the normal GUI.")?>
+
=sprintf(gettext("To bypass the wizard, click on the %s logo on the initial page."),$g['product_name'])?>
+
+
+
+
+\n";
-
- if(file_exists("/usr/local/www/themes/{$g['theme']}/wizard.css"))
- echo " \n";
- else
- echo " ";
-
- echo "