$host, 'account' => $account, 'password' => $password ) ); // It's problably more efficient to let method readResponse control the timeout through // stream_select native timeout. $response = NULL; for ($i = 0; $i < $timeout; $i++) { if ($tsearch->isActive()) { sleep(1); if (($response = $tsearch->readResponse()) !== NULL) { $tsearch->close(); return $response; } } else { $response = $tsearch->readResponse(); break; } } $tsearch->close(); return false; } // usa o host e context do contact center. function ldapConnect($refer = false,$catalogo = 0){ include("../contactcenter/setup/external_catalogs.inc.php"); if ($catalogo == 0){ $this->ldap_host = $_SESSION['phpgw_info']['expressomail']['ldap_server']['host']; $this->ldap_context = $_SESSION['phpgw_info']['expressomail']['ldap_server']['dn']; $this->bind_dn = $_SESSION['phpgw_info']['expressomail']['ldap_server']['acc']; $this->bind_dn_pw = $_SESSION['phpgw_info']['expressomail']['ldap_server']['pw']; $this->branch = 'ou'; }else { $this->ldap_host = $external_srcs[$catalogo]['host']; $this->ldap_context = $external_srcs[$catalogo]['dn']; $this->bind_dn = $external_srcs[$catalogo]['acc']; $this->bind_dn_pw = $external_srcs[$catalogo]['pw']; $this->object_class = $external_srcs[$catalogo]['obj']; $this->base_dn = $external_srcs[$catalogo]['dn']; $this->branch = $external_srcs[$catalogo]['branch']; $response = $this->test_connection($this->ldap_host, $this->bind_dn, $this->bind_dn_pw, 1); if (!$response) { return false; } } $this->ds = ldap_connect($this->ldap_host); ldap_set_option($this->ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($this->ds, LDAP_OPT_REFERRALS, $refer); if ($refer){ ldap_set_rebind_proc($this->ds, ldapRebind); } @ldap_bind($this->ds,$this->bind_dn,$this->bind_dn_pw ); return "ok"; } //Teste jakjr retornando o DS function ldapConnect2($refer = false){ $ds = ldap_connect($_SESSION['phpgw_info']['expressomail']['ldap_server']['host']); if (!$ds) return false; ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ds, LDAP_OPT_REFERRALS, $refer); if ($refer) ldap_set_rebind_proc($ds, ldapRebind); @ldap_bind($ds, $_SESSION['phpgw_info']['expressomail']['ldap_server']['acc'],$_SESSION['phpgw_info']['expressomail']['ldap_server']['pw']); return $ds; } // usa o host e context do setup. function ldapRootConnect($refer = false){ $this->ldap_host = $_SESSION['phpgw_info']['expressomail']['server']['ldap_host']; $this->ldap_context = $_SESSION['phpgw_info']['expressomail']['server']['ldap_context']; $this->ds = ldap_connect($this->ldap_host); ldap_set_option($this->ds, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($this->ds, LDAP_OPT_REFERRALS, $refer); ldap_bind($this->ds, $_SESSION['phpgw_info']['expressomail']['server']['ldap_root_dn'],$_SESSION['phpgw_info']['expressomail']['server']['ldap_root_pw']); } function quicksearch($params) { include_once("../contactcenter/setup/external_catalogs.inc.php"); include_once("class.functions.inc.php"); $functions = new functions; $search_for = utf8_encode($params['search_for']); $field = $params['field']; $ID = $params['ID']; $search_for = explode(" ",$search_for); $aux=""; foreach ($search_for as $search) { if(!$aux) { $aux=$search; } else { $aux=$aux."*".$search; } } $search_for=$aux; $contacts_result = array(); $contacts_result['field'] = $field; $contacts_result['ID'] = $ID; // follow the referral $this->ldapConnect(true); if ($this->ds) { if (($field != 'null') && ($ID != 'null')) { $filter="(& (|(phpgwAccountType=u)(phpgwAccountType=l)) (|(cn=*$search_for*)(mail=*$search_for*)) (!(phpgwaccountvisible=-1)) )"; $justthese = array("cn", "mail", "telephoneNumber", "mobile", "phpgwAccountVisible", "uid", "employeeNumber", "ou"); } else { $filter="(& (phpgwAccountType=u)(cn=*$search_for*) (!(phpgwaccountvisible=-1)) )"; $justthese = array("cn", "mail", "telephoneNumber", "mobile", "phpgwAccountVisible", "jpegPhoto", "uid", "employeeNumber", "ou"); } $sr=ldap_search($this->ds, $this->ldap_context, $filter, $justthese, 0, 201); $count_entries = ldap_count_entries($this->ds,$sr); // Get user org dn. $user_dn = $_SESSION['phpgw_info']['expressomail']['user']['account_dn']; $user_sector_dn = ldap_explode_dn ( $user_dn, false ); array_shift($user_sector_dn); array_shift($user_sector_dn); $user_sector_dn = implode(",", $user_sector_dn); // New search only on user sector if ($count_entries > 200) { // Close old ldap conection ldap_close($this->ds); // Reopen a local ldap connection, following referral $this->ldapRootConnect(true); $sr=ldap_search($this->ds, $user_sector_dn, $filter, $justthese, 0, 201); $count_entries = ldap_count_entries($this->ds,$sr); if ($count_entries > 200){ $return = array(); $return['status'] = false; $return['error'] = "many results"; return $return; } else { $quickSearch_only_in_userSector = true; } } $info = ldap_get_entries($this->ds, $sr); $tmp = array(); $tmp_users_from_user_org = array(); if (!$quickSearch_only_in_userSector) { $catalogsNum=count($external_srcs); $unavailable = array(); for ($i=0; $i<=count($external_srcs); $i++) { if ($external_srcs[$i]["quicksearch"]) { if($this->ldapConnect(true,$i)) { $filter="(|(cn=*$search_for*)(mail=*$search_for*))"; $justthese = array("cn", "mail", "telephoneNumber", "mobile", "phpgwAccountVisible", "uid", "employeeNumber", "ou"); $sr=ldap_search($this->ds, $this->ldap_context, $filter, $justthese, 0, 201); $count_entries = ldap_count_entries($this->ds,$sr); $search = ldap_get_entries($this->ds, $sr); for ($j=0; $j<$search["count"]; $j++) { $info[] = $search[$j]; } $info["count"] = count($info)-1; }else{ $unavailable[] = $external_srcs[$i]["name"]; } } } $contacts_result['unavailable']=$unavailable; } for ($i=0; $i<$info["count"]; $i++) { if ($quickSearch_only_in_userSector) { $tmp[$info[$i]["mail"][0] . '%' . $info[$i]["telephonenumber"][0] . '%'. $info[$i]["mobile"][0] . '%' . $info[$i]["uid"][0] . '%' . $info[$i]["jpegphoto"]['count'] . '%' . $info[$i]["employeenumber"][0] . '%' . $info[$i]["ou"][0]] = utf8_decode($info[$i]["cn"][0]); } else { if (preg_match("/$user_sector_dn/i", $info[$i]['dn'])) { $tmp_users_from_user_org[$info[$i]["mail"][0] . '%' . $info[$i]["telephonenumber"][0] . '%'. $info[$i]["mobile"][0] . '%' . $info[$i]["uid"][0] . '%' . $info[$i]["jpegphoto"]['count'] . '%' . $info[$i]["employeenumber"][0] . '%' . $info[$i]["ou"][0]] = utf8_decode($info[$i]["cn"][0]); } else { $tmp[$info[$i]["mail"][0] . '%' . $info[$i]["telephonenumber"][0] . '%'. $info[$i]["mobile"][0] . '%' . $info[$i]["uid"][0] . '%' . $info[$i]["jpegphoto"]['count'] . '%' . $info[$i]["employeenumber"][0] . '%' . $info[$i]["ou"][0]] = utf8_decode($info[$i]["cn"][0]); } } } natcasesort($tmp_users_from_user_org); natcasesort($tmp); if (($field != 'null') && ($ID != 'null')) { $i = 0; $tmp = array_merge($tmp, $tmp_users_from_user_org); natcasesort($tmp); foreach ($tmp as $info => $cn) { $contacts_result[$i] = array(); $contacts_result[$i]["cn"] = $cn; list ($contacts_result[$i]["mail"], $contacts_result[$i]["phone"], $contacts_result[$i]["mobile"], $contacts_result[$i]["uid"], $contacts_result[$i]["jpegphoto"], $contacts_result[$i]["employeenumber"], $contacts_result[$i]["ou"]) = split ('%', $info); $i++; } $contacts_result['quickSearch_only_in_userSector'] = $quickSearch_only_in_userSector; } else { $options_users_from_user_org = ''; $options = ''; /* List of users from user org */ $i = 0; foreach ($tmp_users_from_user_org as $info => $cn) { $contacts_result[$i] = array(); $options_users_from_user_org .= $this->make_quicksearch_card($info, $cn); $i++; } /* List of users from others org */ foreach ($tmp as $info => $cn) { $contacts_result[$i] = array(); $options .= $this->make_quicksearch_card($info, $cn); $i++; } if ($quickSearch_only_in_userSector) { if ($options != '') { $head_option = '' . '' . $functions->getLang('More than 200 results were found') . '.
' . $functions->getLang('Showing only the results found in your organization') . '.'; '' . ''; $contacts_result = $head_option . $options_users_from_user_org . $options; } else { $return = array(); $return['status'] = false; $return['error'] = "many results"; return $return; } } else { if (($options_users_from_user_org != '') && ($options != '')) { $head_option0 = '' . '' . $functions->getLang('Users from your organization') . '.'; '' . ''; $head_option1 = '' . '' . $functions->getLang('Users from others organizations') . '.'; '' . ''; } $contacts_result = $head_option0 . $options_users_from_user_org . $head_option1 . $options; } } } ldap_close($this->ds); return $contacts_result; } function make_quicksearch_card($info, $cn) { include_once("class.functions.inc.php"); $functions = new functions; $contacts_result = array(); $contacts_result["cn"] = $cn; list ($contacts_result["mail"], $contacts_result["phone"], $contacts_result["mobile"], $contacts_result["uid"], $contacts_result["jpegphoto"], $contacts_result["employeenumber"], $contacts_result["ou"]) = split ('%', $info); if ($contacts_result['jpegphoto']) $photo_link = ''; else $photo_link = ''; $phoneUser = $contacts_result['phone']; if($_SESSION['phpgw_info']['user']['preferences']['expressoMail']['voip_enabled'] && $phoneUser) { $phoneUser = ''.$phoneUser.''; } //verifica de existe o celular do funcionario ($contacts_result["mobile"]), se nao, $phoneUser fica vazia; $mobileUser = $contacts_result["mobile"]; if($mobileUser) { $phoneUser .= " / $mobileUser"; } //verifica se existe a matricula do funcionario ($contacts_result["employeenumber"]), se nao, $empNumber fica vazia; $empNumber = $contacts_result["employeenumber"]; if($empNumber) { $empNumber = "$empNumber - "; } $option = '' . '' . '' . $photo_link . '' . '' . '' . '' . $empNumber . $contacts_result['cn'] . '' . '
' . '' . '' . '' . $contacts_result['mail'] . '' . '
' . '
' . '
' . $phoneUser . '
' . $contacts_result['ou'] . '' . ''; return $option; } function get_catalogs(){ include("../contactcenter/setup/external_catalogs.inc.php"); $catalogs = array(); $catalogs[0] = "Catalogo geral"; foreach ($external_srcs as $key => $valor ){ $catalogs[$key] = $valor['name']; } return $catalogs; } function get_organizations($params){ $organizations = array(); $params['referral']?$referral = $params['referral']:$referral = false; $cat = $params['catalog']; if(!$this->ldapConnect($referral,$cat)) return "unavalible"; if($this->branch != '') { //$filter=$this->branch."=*"; $filter="objectclass=organizationalunit"; $justthese = array("$this->branch"); $sr = ldap_list($this->ds, $this->ldap_context, $filter, $justthese); $info = ldap_get_entries($this->ds, $sr); for ($i=0; $i<$info["count"]; $i++) $organizations[$i] = $info[$i]["ou"][0]; ldap_close($this->ds); sort($organizations); return $organizations; }else{ return null; } } function get_organizations2($params){ $organizations = array(); $referral = $params['referral']; $this->ldapConnect(false,0); if ($this->ds) { $filter="objectclass=organizationalunit"; $justthese = array("ou"); $sr = ldap_list($this->ds, $this->ldap_context, $filter, $justthese); $info = ldap_get_entries($this->ds, $sr); if($info["count"] <= 1) { $organizations[0]['ou']='Todos'; $organizations[0]['dn']=$this->ldap_context; return $organizations; } for ($i=0; $i<$info["count"]; $i++) { $organizations[$i]['ou'] = $info[$i]["ou"][0]; $organizations[$i]['dn'] = $info[$i]["dn"]; } ldap_close($this->ds); sort($organizations); } return $organizations; } //Busca usuarios de um contexto e ja retorna as options do select - usado por template serpro; function search_users($params) { $this->ldapConnect(false,0); //Monta lista de Grupos e Usuarios $users = Array(); $groups = Array(); $user_context= $this->ldap_context; $owner = $_SESSION['phpgw_info']['expressomail']['user']['owner']; $filtro =utf8_encode($params['filter']); $context =utf8_encode($params['context']);//adicionado if ($this->ds) { $justthese = array("gidNumber","cn"); if ($params['type'] == 'search') //$sr=ldap_search($this->ds, $user_context, ("(&(phpgwaccounttype=g)(!(phpgwaccountvisible=-1))(phpgwaccountstatus=A)(cn=*$filtro*))"),$justthese); $sr=ldap_search($this->ds, $context, ("(&(phpgwaccounttype=g)(!(phpgwaccountvisible=-1))(phpgwaccountstatus=A)(cn=*$filtro*))"),$justthese); else $sr=ldap_list($this->ds, $user_context, ("(&(phpgwaccounttype=g)(!(phpgwaccountvisible=-1))(phpgwaccountstatus=A)(cn=*".$filtro."*))"),$justthese); $info = ldap_get_entries($this->ds, $sr); for ($i=0; $i<$info["count"]; $i++) $groups[$uids=$info[$i]["gidnumber"][0]] = Array('name' => $uids=$info[$i]["cn"][0], 'type' => g); $justthese = array("phpgwaccountvisible","uidNumber","cn"); if ($params['type'] == 'search') // $sr=ldap_search($this->ds, $user_context, ("(&(phpgwaccounttype=u)(!(phpgwaccountvisible=-1))(phpgwaccountstatus=A)(|(cn=*$filtro*)(mail=$filtro*)))"),$justthese); $sr=ldap_search($this->ds, $context, ("(&(phpgwaccounttype=u)(!(phpgwaccountvisible=-1))(phpgwaccountstatus=A)(|(cn=*$filtro*)(mail=$filtro*)))"),$justthese); else $sr=ldap_list($this->ds, $user_context, ("(&(phpgwaccounttype=u)(!(phpgwaccountvisible=-1))(phpgwaccountstatus=A)(|(cn=*$filtro*)(mail=$filtro*)))"),$justthese); $info = ldap_get_entries($this->ds, $sr); for ($i=0; $i<$info["count"]; $i++) { if ($info[$i]["phpgwaccountvisible"][0] == '-1') continue; $users[$uids=$info[$i]["uidnumber"][0]] = Array('name' => $uids=$info[$i]["cn"][0], 'type' => u); } } ldap_close($this->ds); @asort($users); @reset($users); @asort($groups); @reset($groups); $user_options =''; $group_options =''; foreach($groups as $id => $user_array) { $newId = $id.'U'; $group_options .= ''."\n"; } foreach($users as $id => $user_array) { if($owner != $id){ $newId = $id.'U'; $user_options .= ''."\n"; } } return array("users" => $user_options, "groups" => $group_options); } function catalogsearch($params) { //$this->ldapConnect(true); include("../contactcenter/inc/external_catalogs.inc.php"); $cn = $params['search_for'] ? "*".utf8_encode($params['search_for'])."*" : "*"; $max_result = $params['max_result'] ? $params['max_result'] : '200'; $catalog = $params['catalog']; $error = False; $this->ldapConnect(false,$catalog); $params['organization'] == 'all'?$user_context = $this->ldap_context :$user_context = $this->branch."=".$params['organization'].",".$this->ldap_context; if ($this->ds) { if ($catalog == 0){ //os atributos "employeeNumber" e "ou" foram adicionado ao vetor de busca; $justthese = array("cn", "mail", "phpgwaccounttype", "phpgwAccountVisible", "employeeNumber", "ou"); $filter="(&(|(phpgwAccountType=u)(phpgwAccountType=l))(cn=".$cn."))"; //$user_context = "ou=".$params['organization'].",".$this->ldap_context; }else { //os atributos "employeeNumber" e "ou" foram adicionado ao vetor de busca; $justthese = array("cn", "mail", "employeeNumber", "ou"); $filter="(&(objectClass=".$this->object_class.")(cn=".$cn."))"; //$user_context = $this->branch."=".$params['organization'].",".$external_srcs[$catalog]['dn']; } $sr=ldap_search($this->ds, $user_context, $filter, $justthese,0,200); $count_entries = ldap_count_entries($this->ds,$sr); if ($count_entries > $max_result){ $info = null; $error = True; } else $info = ldap_get_entries($this->ds, $sr); ldap_close($this->ds); $u_tmp = array(); $g_tmp = array(); for ($i=0; $i<$info["count"]; $i++){ if((!$catalog==0)||(strtoupper($info[$i]["phpgwaccounttype"][0]) == 'U') && ($info[$i]["phpgwaccountvisible"][0] != '-1')) //aqui eh feita a concatenacao do departamento ao cn; $u_tmp[$info[$i]["mail"][0]] = utf8_decode($info[$i]["cn"][0]). '%' . $info[$i]["ou"][0]; else $g_tmp[$info[$i]["mail"][0]] = utf8_decode($info[$i]["cn"][0]); } natcasesort($u_tmp); natcasesort($g_tmp); $i = 0; $users = array(); foreach ($u_tmp as $mail => $cn){ $tmp = explode("%", $cn); //explode o cn pelo caracter "%" e joga em $tmp; $name = $tmp[0]; //pega o primeiro item (cn) do vetor resultante do explode acima; $department = $tmp[1]; //pega o segundo item (ou) do vetor resultanto do explode acima; $users[$i++] = array("name" => $name, "email" => $mail, "department" => $department); } unset($u_tmp); $i = 0; $groups = array(); foreach ($g_tmp as $mail => $cn){ $groups[$i++] = array("name" => $cn, "email" => $mail); } unset($g_tmp); return array('users' => $users, 'groups' => $groups, 'error' => $error); }else return null; } function get_emails_ldap(){ $result['mail']= array(); $result['mailalter']= array(); $user = $_SESSION['phpgw_info']['expressomail']['user']['account_lid']; $this->ldapRootConnect(false); if ($this->ds) { $filter="uid=".$user; $justthese = array("mail","mailAlternateAddress"); $sr = ldap_search($this->ds,$this->ldap_context, $filter, $justthese); $ent = ldap_get_entries($this->ds, $sr); ldap_close($this->ds); for ($i=0; $i<$ent["count"]; $i++){ $result['mail'][] = $ent[$i]["mail"][0]; $result['mailalter'][] = $ent[$i]["mailalternateaddress"][0]; } } return $result; } //Busca usu�rios de um contexto e j� retorna as options do select; function get_available_users($params) { $this->ldapConnect(false,0); //Monta lista de Grupos e Usu�rios $users = Array(); $groups = Array(); $user_context= $params['context']; $owner = $_SESSION['phpgw_info']['expressomail']['user']['owner']; if ($this->ds) { $justthese = array("gidNumber","cn"); if ($params['type'] == 'search') $sr=ldap_search($this->ds, $user_context, ("(&(cn=*)(phpgwaccounttype=g)(!(phpgwaccountvisible=-1)))"),$justthese); else $sr=ldap_list($this->ds, $user_context, ("(&(cn=*)(phpgwaccounttype=g)(!(phpgwaccountvisible=-1)))"),$justthese); $info = ldap_get_entries($this->ds, $sr); for ($i=0; $i<$info["count"]; $i++) $groups[$uids=$info[$i]["gidnumber"][0]] = Array('name' => $uids=$info[$i]["cn"][0], 'type' => g); $justthese = array("phpgwaccountvisible","uidNumber","cn"); if ($params['type'] == 'search') $sr=ldap_search($this->ds, $user_context, ("(&(cn=*)(phpgwaccounttype=u)(!(phpgwaccountvisible=-1)))"),$justthese); else $sr=ldap_list($this->ds, $user_context, ("(&(cn=*)(phpgwaccounttype=u)(!(phpgwaccountvisible=-1)))"),$justthese); $info = ldap_get_entries($this->ds, $sr); for ($i=0; $i<$info["count"]; $i++) { if ($info[$i]["phpgwaccountvisible"][0] == '-1') continue; $users[$uids=$info[$i]["uidnumber"][0]] = Array('name' => $uids=$info[$i]["cn"][0], 'type' => u); } } ldap_close($this->ds); @asort($users); @reset($users); @asort($groups); @reset($groups); $user_options =''; $group_options =''; foreach($groups as $id => $user_array) { $newId = $id.'U'; $group_options .= ''."\n"; } foreach($users as $id => $user_array) { if($owner != $id){ $newId = $id.'U'; $user_options .= ''."\n"; } } return array("users" => $user_options, "groups" => $group_options); } //Busca usu�rios de um contexto e j� retorna as options do select; function get_available_users2($params) { $this->ldapConnect(false,0); $justthese = array("cn", "uid", "cn"); $filter = "(&(phpgwaccounttype=u)(!(phpgwaccountvisible=-1))(phpgwaccountstatus=A)(cn=*".$params['filter']."*))"; if ($this->ds) { $sr=ldap_search($this->ds, $this->ldap_context, $filter, $justthese); $entries = ldap_get_entries($this->ds, $sr); for ($i=0; $i<$entries["count"]; $i++){ if($_SESSION['phpgw_info']['expressomail']['user']['account_lid'] != $entries[$i]["uid"][0]){ $u_tmp[$entries[$i]["uid"][0]] = $entries[$i]["cn"][0]; } } natcasesort($u_tmp); $i = 0; $users = array(); if (count($u_tmp)) { foreach ($u_tmp as $uidnumber => $cn) { $options .= ""; } unset($u_tmp); } ldap_close($this->ds); return $options; } } function uid2cn($uid) { // do not follow the referral $this->ldapRootConnect(false); if ($this->ds) { $filter="(&(phpgwAccountType=u)(uid=$uid))"; $justthese = array("cn"); $sr=ldap_search($this->ds, $this->ldap_context, $filter, $justthese); $info = ldap_get_entries($this->ds, $sr); return utf8_decode($info[0]["cn"][0]); } return false; } function getSharedUsersFrom($params){ $uids = explode(";",$params['uids']); $this->imap = new imap_functions(); $filter = ''; foreach($uids as $index => $uid){ $params = array(); $acl = $this->imap->getacltouser($uid); if(preg_match("/a/",$acl)) $filter .= "(uid=$uid)"; } $this->ldapRootConnect(false); $filter="(&(phpgwAccountType=u)(|$filter))"; if ($this->ds) { $justthese = array("cn","mail"); $sr = ldap_search($this->ds, $this->ldap_context, $filter, $justthese); ldap_sort($this->ds,$sr,"cn"); $info = ldap_get_entries($this->ds, $sr); $info['myname'] = $_SESSION['phpgw_info']['expressomail']['user']['fullname']; for ($i = 0;$i < $info["count"]; $i++) $info[$i]['cn'][0] = utf8_decode($info[$i]['cn'][0]); return $info; } } function getUserByEmail($params) { $filter="(&(phpgwAccountType=u)(mail=" . $params['email'] . "))"; $ldap_context = $_SESSION['phpgw_info']['expressomail']['ldap_server']['dn']; $justthese = array("cn","uid","telephoneNumber","jpegPhoto","mobile"); // Follow the referral $ds = $this->ldapConnect2(true); if ($ds) { $sr=ldap_search($ds, $ldap_context, $filter, $justthese); if (!$sr) return null; $entry = ldap_first_entry($ds, $sr); //linha adicionada p/ corrigir bug que exibia a palavra Array no lugar do nome; $tmp = @ldap_get_values($ds, $entry, "cn"); if($entry) { $obj = array("cn" => utf8_decode($tmp[0]), //linha modificada p/ acompanhar inclusao da linha acima; "email" => $params['email'], "uid" => ldap_get_values($ds, $entry, "uid"), "type" => "global", "mobile" => @ldap_get_values($ds, $entry, "mobile"), "telefone" => @ldap_get_values($ds, $entry, "telephonenumber") ); $_SESSION['phpgw_info']['expressomail']['contact_photo'] = @ldap_get_values_len($ds, $entry, "jpegphoto"); ldap_close($ds); return $obj; } } return null; } } ?>