diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-11-28 12:43:51 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-11-28 12:43:51 -0200 |
commit | 16d6c1df8c5b110c9fd7a5e9238d03b820ed2445 (patch) | |
tree | 8998f21489549aa4741e55a7e224fc90733a2e74 /etc/inc | |
parent | 5acce70485914b0f79df3a675c21d39a0079b89e (diff) | |
download | pfsense-16d6c1df8c5b110c9fd7a5e9238d03b820ed2445.zip pfsense-16d6c1df8c5b110c9fd7a5e9238d03b820ed2445.tar.gz |
Add a parameter on platform_booting to help detect if it's on GUI on console and use it in appropriate places, it fixes #4049
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/config.inc | 2 | ||||
-rw-r--r-- | etc/inc/config.lib.inc | 6 | ||||
-rw-r--r-- | etc/inc/globals.inc | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index a562c6f..cf5b77f 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -86,7 +86,7 @@ if(file_exists("/debugging")) { $g['debug'] = true; } -if(platform_booting() && php_sapi_name() != 'fpm-fcgi') { +if(platform_booting(true)) { echo "."; if(file_exists("/cf/conf/config.xml")) { $config_contents = file_get_contents("/cf/conf/config.xml"); diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index 63e36e9..1b006e9 100644 --- a/etc/inc/config.lib.inc +++ b/etc/inc/config.lib.inc @@ -111,7 +111,7 @@ function parse_config($parse = false) { } } - if (platform_booting()) + if (platform_booting(true)) echo "."; // Check for encrypted config.xml @@ -127,7 +127,7 @@ function parse_config($parse = false) { } if ($parse == true) { if(!file_exists($g['conf_path'] . "/config.xml")) { - if (platform_booting()) + if (platform_booting(true)) echo "."; log_error("No config.xml found, attempting last known config restore."); file_notice("config.xml", "No config.xml found, attempting last known config restore.", "pfSenseConfigurator", ""); @@ -154,7 +154,7 @@ function parse_config($parse = false) { generate_config_cache($config); } - if (platform_booting()) + if (platform_booting(true)) echo "."; $config_parsed = true; diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index b613a90..195cb07 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -165,11 +165,12 @@ $sysctls = array("net.inet.ip.portrange.first" => "1024", if (file_exists("/etc/inc/globals_override.inc")) @include("globals_override.inc"); -function platform_booting() { +function platform_booting($on_console = false) { global $g; if ($g['booting'] || file_exists("{$g['varrun_path']}/booting")) - return true; + if ($on_console == false || php_sapi_name() != 'fpm-fcgi') + return true; return false; } |