diff options
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/config.lib.inc | 15 |
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']; |