$add['objectClass'] = $set;
$r = @ldap_mod_replace($LDAP_CON,$dn,$add);
- tpl_ldaperror();
+ tpl_ldaperror('store object classes');
/* print '<pre>';
print_r($set);
$results = array();
$result1 = array();
$result2 = array();
+ $result3 = array();
// public addressbook
- $sr = @ldap_list($LDAP_CON,$conf['publicbook'],
+ $sr = @ldap_search($LDAP_CON,$conf['publicbook'],
$filter,$types);
tpl_ldaperror();
$result1 = ldap_get_binentries($LDAP_CON, $sr);
ldap_free_result($sr);
// private addressbook
- if(!empty($_SESSION['ldapab']['binddn'])){
+ if(!empty($_SESSION['ldapab']['binddn']) && $conf['privatebook']){
$sr = @ldap_list($LDAP_CON,$conf['privatebook'].
','.$_SESSION['ldapab']['binddn'],
$filter,$types);
- tpl_ldaperror();
+ if(ldap_errno($LDAP_CON) != 32) tpl_ldaperror(); // ignore missing address book
$result2 = ldap_get_binentries($LDAP_CON, $sr);
}
+ // user account entries
+ if ($conf['displayusertree']) {
+ $sr = @ldap_list($LDAP_CON,$conf['usertree'],
+ $filter,$types);
+ tpl_ldaperror();
+ $result3 = ldap_get_binentries($LDAP_CON, $sr);
+ ldap_free_result($sr);
+ }
+
+
+
// return merged results
- return array_merge((array)$result1,(array)$result2);
+ return array_merge((array)$result1,(array)$result2,(array)$result3);
}
/**
$return[] = $FIELDS[$f];
}elseif($FIELDS["_$f"]){
$return[] = $FIELDS["_$f"];
+ }elseif($f = 'markers'){
+ $return[] = 'marker';
}
}
return $return;