Ignore:
Timestamp:
11/23/10 15:22:12 (13 years ago)
Author:
brunocosta
Message:

Ticket #1325 - Adapta buscas LDAP para casos que não existem OUs.

Location:
branches/2.2/jabberit_messenger
Files:
3 edited

Legend:

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

    r3406 r3530  
    119119                        foreach($users as $tmp) 
    120120                        { 
    121                                 if ( !array_key_exists($tmp['ou'], $order) ) 
     121                            if ( !array_key_exists($tmp['ou'], $order) ) 
    122122                                        $order[$tmp['ou']] = array(); 
    123123 
  • branches/2.2/jabberit_messenger/inc/class.ldap_im.inc.php

    r3266 r3530  
    340340                if( $this->ldap ) 
    341341                { 
    342                         $filter = "(ou=*)"; 
     342                        $filter = "(objectClass=organizationalUnit)"; 
    343343                        $justthese = array("dn"); 
    344344                        $search = ldap_search($this->ldap, $this->ldap_context, $filter, $justthese); 
     
    464464                                $result[$j]['uid']                      = $entry[$i][$this->attribute][0]; 
    465465                                $result[$j]['jid']                      = $entry[$i][$this->attribute][0]; 
    466                                  
    467                                 $ou = explode("dc=", $entry[$i]['dn']); 
    468                                 $ou = explode("ou=",$ou[0]); 
    469                                 $ou = array_pop($ou); 
    470                                 $result[$j]['ou']       = strtoupper(substr($ou,0,strlen($ou)-1)); 
     466 
     467                                if(!strpos($entry[$i]['dn'],"ou=") === FALSE){ 
     468                                    $ou = explode("dc=", $entry[$i]['dn']); 
     469                                    $ou = explode("ou=",$ou[0]); 
     470                                    $ou = array_pop($ou); 
     471                                    $result[$j]['ou']   = strtoupper(substr($ou,0,strlen($ou)-1)); 
     472                                }else{ 
     473                                    $ou = explode("dc=", $entry[$i]['dn']); 
     474                                    $result[$j]['ou'] = strtoupper(substr($ou[1],0,strlen($ou[1])-1)); 
     475                                } 
    471476                                 
    472477                                if( $pOrg === "*" ) 
  • branches/2.2/jabberit_messenger/jmessenger/inc/class.LdapIM.inc.php

    r3326 r3530  
    339339                if( $this->ldap ) 
    340340                { 
    341                         $filter = "(ou=*)"; 
     341                        $filter = "(objectClass=organizationalUnit)"; 
    342342                        $justthese = array("dn"); 
    343343                        $search = ldap_search($this->ldap, $this->ldap_context, $filter, $justthese); 
Note: See TracChangeset for help on using the changeset viewer.