X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=template.php;h=df83800a0d8925b1d8911b918331ed89ce653a4a;hb=57ec0045cfb2952d1956c20fc15e4ff93bb13e31;hp=f0fe1fa75a86a94523c6435bef2bd56b0fa17638;hpb=b9b41f140e560c8ec28fa28c222a4a621d5c9f92;p=contagged diff --git a/template.php b/template.php index f0fe1fa..df83800 100644 --- a/template.php +++ b/template.php @@ -147,23 +147,25 @@ function tpl_orgs(){ global $LDAP_CON; global $smarty; + $f_entries = namedentries(true); + $orgs = array(); - $sr = ldap_list($LDAP_CON,$conf['publicbook'],"ObjectClass=inetOrgPerson",array("o")); + $sr = ldap_list($LDAP_CON,$conf['publicbook'],"ObjectClass=inetOrgPerson",array($f_entries['organization'])); $result1 = ldap_get_binentries($LDAP_CON, $sr); //check users private addressbook if(!empty($_SESSION['ldapab']['binddn'])){ $sr = @ldap_list($LDAP_CON, $conf['privatebook'].','.$_SESSION['ldapab']['binddn'], - "ObjectClass=inetOrgPerson",array("o")); + "ObjectClass=inetOrgPerson",array($f_entries['organization'])); $result2 = ldap_get_binentries($LDAP_CON, $sr); } $result = array_merge((array)$result1,(array)$result2); if(count($result)){ foreach ($result as $entry){ - if(!empty($entry['o'][0])){ - array_push($orgs, $entry['o'][0]); + if(!empty($entry[$f_entries['organization']][0])){ + array_push($orgs, $entry[$f_entries['organization']][0]); } } }