summaryrefslogtreecommitdiffstats
path: root/etc/inc/auth.inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-06-28 19:26:41 +0000
committerErmal <eri@pfsense.org>2011-06-28 19:26:41 +0000
commit84924e76c44950387e387af7927f63d5822dfda4 (patch)
tree02abe718f97831714113e9e042b3e9e08e289c7a /etc/inc/auth.inc
parent3cedb66fdb85d35f49ec1f180a73a2bc7c120c07 (diff)
downloadpfsense-84924e76c44950387e387af7927f63d5822dfda4.zip
pfsense-84924e76c44950387e387af7927f63d5822dfda4.tar.gz
Add proper checks in auth code for testing if the section has been set in the config. Also do the same in the ugprade code
Diffstat (limited to 'etc/inc/auth.inc')
-rw-r--r--etc/inc/auth.inc16
1 files changed, 10 insertions, 6 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index 239d7de..92c3538 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -193,9 +193,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;
}
@@ -208,9 +210,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;
}
OpenPOWER on IntegriCloud