summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/config.lib.inc16
1 files changed, 9 insertions, 7 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc
index 1647d7d..e258510 100644
--- a/etc/inc/config.lib.inc
+++ b/etc/inc/config.lib.inc
@@ -497,13 +497,15 @@ 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();
- if (!empty($_SESSION['Username']) && ($_SESSION['Username'] != "admin")) {
- $user = getUserEntry($_SESSION['Username']);
- if (is_array($user) && userHasPrivilege($user, "user-config-readonly")) {
- session_commit();
- return false;
+ if (!isset($argc)) {
+ if (!session_id())
+ session_start();
+ if (!empty($_SESSION['Username']) && ($_SESSION['Username'] != "admin")) {
+ $user = getUserEntry($_SESSION['Username']);
+ if (is_array($user) && userHasPrivilege($user, "user-config-readonly")) {
+ session_commit();
+ return false;
+ }
}
}
OpenPOWER on IntegriCloud