Ignore:
Timestamp:
09/17/10 14:39:10 (14 years ago)
Author:
alexandrecorreia
Message:

Ticket #1316 - Correcoes e melhorias na busca dos contatos para o Modulo IM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/jabberit_messenger/jmessenger/inc/class.ContactsIm.inc.php

    r3260 r3263  
    5454                $users          = $this->getUsersIm($param['name']); 
    5555                 
    56                 if ( !is_array($users) ) 
    57                         return "<error></error>"; 
    58                  
    5956                if( count($users) == 0  ) 
    6057                        return "<empty></empty>"; 
    6158                 
    62                 if( count($users) > $this->ldap->getMaxResults() ) 
     59                if( $users === "manyresults" ) 
    6360                { 
    6461                        if( isset($_SESSION['phpgw_info']['jabberit_messenger']['photo']) ) 
     
    119116        {    
    120117                $array_uids             = array(); 
     118                $countUids              = 0; 
    121119        $members                = array(); 
    122120        $result                 = array(); 
    123121        $uidType                = "uid"; 
    124122                $serversLdap    = unserialize( trim($_SESSION['phpgw_info']['jabberit_messenger']['groups_search']) ); 
     123                 
    125124 
    126125                if( $serversLdap ) 
     
    144143                                { 
    145144                                        $result[$key] = $this->ldap->getUsersLdapRoot("cn=*".$pName."*"); 
     145                                        $countUids += count($result[$key]); 
    146146                                } 
    147147                                else 
    148148                                { 
    149149                                        if( !$this->groupsLocked() ) 
     150                                        { 
    150151                                                $result[$key] =  $this->ldap->getUsersLdapCatalog("cn=*".$pName."*", $key ); 
    151                                 } 
    152                         } 
    153                                  
     152                                                $countUids += count($result[$key]); 
     153                                        } 
     154                                } 
     155                        } 
     156                         
     157                        if( $countUids >  $this->ldap->getMaxResults() ) 
     158                        { 
     159                                return "manyresults"; 
     160                        } 
     161                         
    154162                        $_RESULT = $this->ldap->getMembers($result, $filters); 
    155163                         
    156164                        foreach( $_RESULT as $key => $value ) 
    157                                 $array_uids = array_merge($array_uids, $_RESULT[$key]);  
     165                                $array_uids = array_merge($array_uids, $_RESULT[$key]); 
     166  
    158167                } 
    159168                else 
Note: See TracChangeset for help on using the changeset viewer.