Melhoria #416
Atualizado por Mauricio Luiz Viani há quase 6 anos
Modificar o webservice Admin/SearchLdap da API para retornar um array com todas as entradas obtidas pela consulta.
Atualmente está sendo retornado sempre a primeira entrada encontrada.
Ver código expressoAdmin1_2/inc/class.functions.inc.php
Function getlist()
<pre>
elseif( $type == 'api')
{
$queryLDAP = ( ( unserialize($query) ) ? unserialize($query) : $query );
$justthese = array("uidnumber", "uid", "cn", "mail", "dn", "cpf", "rg", "rgUF", "jpegPhoto");
$search = ldap_search( $ldap_conn, $contexts[0], "(&(phpgwAccountType=u)(".$queryLDAP[0]."=".$queryLDAP[1]."))", $justthese );
$info = ldap_get_entries( $ldap_conn, $search );
$return = false;
if( $info['count'] > 0 )
{
$return[0]['accountId'] = $info[0]['uidnumber'][0];
$return[0]['accountLid'] = $info[0]['uid'][0];
$return[0]['accountDn'] = $info[0]['dn'];
$return[0]['accountCn'] = $info[0]['cn'][0];
$return[0]['accountMail'] = $info[0]['mail'][0];
$return[0]['accountCpf'] = $info[0]['cpf'][0];
$return[0]['accountRG'] = $info[0]['rg'][0];
$return[0]['accountRgUF'] = $info[0]['rguf'][0];
$return[0]['accountPhoto'] = ((isset($info[0]['jpegphoto']['count']) && $info[0]['jpegphoto']['count'] == 1 ) ? true : false );
}
ldap_close($ldap_conn);
return $return;
}
</pre>
Atualmente está sendo retornado sempre a primeira entrada encontrada.
Ver código expressoAdmin1_2/inc/class.functions.inc.php
Function getlist()
<pre>
elseif( $type == 'api')
{
$queryLDAP = ( ( unserialize($query) ) ? unserialize($query) : $query );
$justthese = array("uidnumber", "uid", "cn", "mail", "dn", "cpf", "rg", "rgUF", "jpegPhoto");
$search = ldap_search( $ldap_conn, $contexts[0], "(&(phpgwAccountType=u)(".$queryLDAP[0]."=".$queryLDAP[1]."))", $justthese );
$info = ldap_get_entries( $ldap_conn, $search );
$return = false;
if( $info['count'] > 0 )
{
$return[0]['accountId'] = $info[0]['uidnumber'][0];
$return[0]['accountLid'] = $info[0]['uid'][0];
$return[0]['accountDn'] = $info[0]['dn'];
$return[0]['accountCn'] = $info[0]['cn'][0];
$return[0]['accountMail'] = $info[0]['mail'][0];
$return[0]['accountCpf'] = $info[0]['cpf'][0];
$return[0]['accountRG'] = $info[0]['rg'][0];
$return[0]['accountRgUF'] = $info[0]['rguf'][0];
$return[0]['accountPhoto'] = ((isset($info[0]['jpegphoto']['count']) && $info[0]['jpegphoto']['count'] == 1 ) ? true : false );
}
ldap_close($ldap_conn);
return $return;
}
</pre>