summaryrefslogtreecommitdiffstats
path: root/etc/inc/auth.inc
diff options
context:
space:
mode:
Diffstat (limited to 'etc/inc/auth.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