summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-12-31 22:15:36 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-12-31 22:15:36 +0000
commit6d4d3a7e3cff62729b6944bcde62149fb36f79f9 (patch)
tree1dad3499cc9c9adee9d7dd9a771ef9faca4bb677 /etc/inc
parent0996dada17856ce1f23732a700b26153d7364b78 (diff)
downloadpfsense-6d4d3a7e3cff62729b6944bcde62149fb36f79f9.zip
pfsense-6d4d3a7e3cff62729b6944bcde62149fb36f79f9.tar.gz
Only iterate items if it is an array.
Work sponsored-by: Centipede Networks
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/auth.inc26
1 files changed, 14 insertions, 12 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc
index 0af5ae6..aa31f08 100644
--- a/etc/inc/auth.inc
+++ b/etc/inc/auth.inc
@@ -674,18 +674,20 @@ function ldap_get_user_ous($show_complete_ou=false) {
$ous = array();
- foreach($info as $inf) {
- if(!$show_complete_ou) {
- $inf_split = split(",", $inf['dn']);
- $ou = $inf_split[0];
- $ou = str_replace("OU=","", $ou);
- } else {
- if($inf['dn'])
- $ou = $inf['dn'];
- }
- if($ou)
- $ous[] = $ou;
- }
+ if(is_array($info)) {
+ foreach($info as $inf) {
+ if(!$show_complete_ou) {
+ $inf_split = split(",", $inf['dn']);
+ $ou = $inf_split[0];
+ $ou = str_replace("OU=","", $ou);
+ } else {
+ if($inf['dn'])
+ $ou = $inf['dn'];
+ }
+ if($ou)
+ $ous[] = $ou;
+ }
+ }
$ous[] = "OU=Users," . $ldapsearchbase;
OpenPOWER on IntegriCloud