summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-01-05 16:53:59 +0000
committerErmal <eri@pfsense.org>2013-01-05 16:53:59 +0000
commitcf0dae69a13300e34ab7d3b6203f048debf58ff5 (patch)
tree58b87021219d4b8c584f68e5f2400989bb57fc8b
parent7ba99a6c441cd5b4b0d4aa1e802266e16d52e1ec (diff)
downloadpfsense-cf0dae69a13300e34ab7d3b6203f048debf58ff5.zip
pfsense-cf0dae69a13300e34ab7d3b6203f048debf58ff5.tar.gz
Since php_sapi_name() is useless in pfSense test if argc has been registered or not to avoid warnings on bootup
-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