summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-01-05 17:02:27 +0000
committerErmal <eri@pfsense.org>2013-01-05 17:02:27 +0000
commitdf0207cea9dbed0d0816f5c89cd6a9827936eadb (patch)
treef24253580c4de4d139e9785c3b11cd74db6ae7db /etc
parent9f1e3d64807c0eaf2a9ade1010a8a90e63d719be (diff)
downloadpfsense-df0207cea9dbed0d0816f5c89cd6a9827936eadb.zip
pfsense-df0207cea9dbed0d0816f5c89cd6a9827936eadb.tar.gz
Since php_sapi_name() is useless in pfSense test if argc has been registered or not to avoid warnings on bootup
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/config.lib.inc15
1 files changed, 11 insertions, 4 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc
index e0d5acb..f496562 100644
--- a/etc/inc/config.lib.inc
+++ b/etc/inc/config.lib.inc
@@ -494,10 +494,17 @@ function write_config($desc="Unknown", $backup = true) {
log_error("WARNING! Configuration written on bootup. This can cause stray openvpn and load balancing items in config.xml");
*/
- if (!session_id())
- session_start();
- $username = empty($_SESSION["Username"]) ? "(system)" : $_SESSION['Username'];
- session_commit();
+ if (!isset($argc)) {
+ if (!session_id())
+ session_start();
+ $username = empty($_SESSION["Username"]) ? "(system)" : $_SESSION['Username'];
+ session_commit();
+ } else {
+ if (empty($_ENV['USER']) || $_ENV['USER'] == "root")
+ $username = "(system)";
+ else
+ $username = $_ENV['USER'];
+ }
if (!empty($_SERVER['REMOTE_ADDR']))
$username .= '@' . $_SERVER['REMOTE_ADDR'];
OpenPOWER on IntegriCloud