summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-07-01 11:38:20 -0400
committerjim-p <jimp@pfsense.org>2011-07-01 11:38:20 -0400
commit2488a7e73a1527445f23b97d30cde74d1bb74738 (patch)
treefc17367994edbe8b94232b864e85942ca73ec651 /etc/inc
parentda70dc36adf11666d92ab109c564c76103a3ebac (diff)
parent0fcaf4f2723c7defa1f8cd13ac3ba63c73a9d77d (diff)
downloadpfsense-2488a7e73a1527445f23b97d30cde74d1bb74738.zip
pfsense-2488a7e73a1527445f23b97d30cde74d1bb74738.tar.gz
Merge remote branch 'upstream/master'
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/auth.inc16
-rw-r--r--etc/inc/captiveportal.inc2
-rw-r--r--etc/inc/interfaces.inc32
-rw-r--r--etc/inc/services.inc32
-rw-r--r--etc/inc/shaper.inc2
-rw-r--r--etc/inc/upgrade_config.inc10
6 files changed, 52 insertions, 42 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index 8dc0fe7..ae4a8f3 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -200,9 +200,11 @@ function & getUserEntry($name) {
function & getUserEntryByUID($uid) {
global $debug, $config;
- foreach ($config['system']['user'] as & $user)
- if ($user['uid'] == $uid)
- return $user;
+
+ if (is_array($config['system']['user']))
+ foreach ($config['system']['user'] as & $user)
+ if ($user['uid'] == $uid)
+ return $user;
return false;
}
@@ -215,9 +217,11 @@ function & getGroupEntry($name) {
function & getGroupEntryByGID($gid) {
global $debug, $config;
- foreach ($config['system']['group'] as & $group)
- if ($group['gid'] == $gid)
- return $group;
+
+ if (is_array($config['system']['group']))
+ foreach ($config['system']['group'] as & $group)
+ if ($group['gid'] == $gid)
+ return $group;
return false;
}
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index e54413c..ce0435d 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -413,7 +413,7 @@ function captiveportal_init_webgui() {
$key = base64_decode($config['captiveportal']['private-key']);
/* generate lighttpd configuration */
system_generate_lighty_config("{$g['varetc_path']}/lighty-CaptivePortal-SSL.conf",
- $cert, $key, $cacert, "lighty-CaptivePortal-ssl.pid", "8001", "/usr/local/captiveportal/",
+ $cert, $key, $cacert, "lighty-CaptivePortal-SSL.pid", "8001", "/usr/local/captiveportal/",
"cert-portal.pem", "ca-portal.pem", "1", $maxproc, $use_fastcgi, true);
}
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index ecbb504..4bbc4ac 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -4062,4 +4062,36 @@ function get_vip_descr($ipaddress) {
return "";
}
+function interfaces_staticarp_configure($if) {
+ global $config, $g;
+ if(isset($config['system']['developerspew'])) {
+ $mt = microtime();
+ echo "interfaces_staticarp_configure($if) being called $mt\n";
+ }
+
+ $ifcfg = $config['interfaces'][$if];
+
+ if (empty($if) || empty($ifcfg['if']))
+ return 0;
+
+ /* Enable staticarp, if enabled */
+ if(isset($config['dhcpd'][$if]['staticarp'])) {
+ mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " staticarp " );
+ mwexec("/usr/sbin/arp -d -i " . escapeshellarg($ifcfg['if']) . " -a > /dev/null 2>&1 ");
+ if (is_array($config['dhcpd'][$if]['staticmap'])) {
+
+ foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) {
+ mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
+
+ }
+
+ }
+ } else {
+ mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " -staticarp " );
+ mwexec("/usr/sbin/arp -d -i " . escapeshellarg($ifcfg['if']) . " -a > /dev/null 2>&1 ");
+ }
+
+ return 0;
+}
+
?>
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index d800859..88c69b7 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -913,38 +913,6 @@ EOD;
return 0;
}
-function interfaces_staticarp_configure($if) {
- global $config, $g;
- if(isset($config['system']['developerspew'])) {
- $mt = microtime();
- echo "interfaces_staticarp_configure($if) being called $mt\n";
- }
-
- $ifcfg = $config['interfaces'][$if];
-
- if (empty($if) || empty($ifcfg['if']))
- return 0;
-
- /* Enable staticarp, if enabled */
- if(isset($config['dhcpd'][$if]['staticarp'])) {
- mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " staticarp " );
- mwexec("/usr/sbin/arp -d -i " . escapeshellarg($ifcfg['if']) . " -a > /dev/null 2>&1 ");
- if (is_array($config['dhcpd'][$if]['staticmap'])) {
-
- foreach ($config['dhcpd'][$if]['staticmap'] as $arpent) {
- mwexec("/usr/sbin/arp -s " . escapeshellarg($arpent['ipaddr']) . " " . escapeshellarg($arpent['mac']));
-
- }
-
- }
- } else {
- mwexec("/sbin/ifconfig " . escapeshellarg($ifcfg['if']) . " -staticarp " );
- mwexec("/usr/sbin/arp -d -i " . escapeshellarg($ifcfg['if']) . " -a > /dev/null 2>&1 ");
- }
-
- return 0;
-}
-
function services_dhcrelay_configure() {
global $config, $g;
if(isset($config['system']['developerspew'])) {
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index c9f41f3..9d9868b 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -382,7 +382,7 @@ class altq_root_queue {
function &get_queue_list($q = null) {
$qlist = array();
- $qlist[$this->GetQname()] = & $this;
+ //$qlist[$this->GetQname()] = & $this;
if (is_array($this->queues)) {
foreach ($this->queues as $queue)
$queue->get_queue_list(&$qlist);
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index 0fa3b37..f8e3439 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -1341,6 +1341,8 @@ function upgrade_048_to_049() {
$all['gid'] = 1998;
$all['member'] = array();
+ if (!is_array($config['system']['user']))
+ $config['system']['user'] = array();
if (!is_array($config['system']['group']))
$config['system']['group'] = array();
@@ -1392,6 +1394,9 @@ function upgrade_048_to_049() {
function upgrade_049_to_050() {
global $config;
+
+ if (!is_array($config['system']['user']))
+ $config['system']['user'] = array();
/* update user privileges */
foreach ($config['system']['user'] as & $user) {
$privs = array();
@@ -2098,6 +2103,7 @@ function upgrade_055_to_056() {
function upgrade_056_to_057() {
global $config;
+
if (!is_array($config['system']['user']))
$config['system']['user'] = array();
/* migrate captivate portal to user manager */
@@ -2449,9 +2455,9 @@ function upgrade_070_to_071() {
function rename_field(& $section, $oldname, $newname) {
if (is_array($section)) {
foreach($section as & $item) {
- if (!empty($item[$oldname]))
+ if (is_array($item) && !empty($item[$oldname]))
$item[$newname] = $item[$oldname];
- if (isset($item[$oldname]))
+ if (is_array($item) && isset($item[$oldname]))
unset($item[$oldname]);
}
}
OpenPOWER on IntegriCloud