Changeset 977


Ignore:
Timestamp:
06/10/09 18:26:16 (15 years ago)
Author:
alexandrecorreia
Message:

Ticket #541 - O arquivo confLDAPInternal.php não é criado, gera um erro no applet java.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/jabberit_messenger/inc/class.contacts_im.inc.php

    r952 r977  
    2020        private $db; 
    2121        private $ou_User; 
    22         private $hostsJabber; 
    2322        private $serverJabber; 
    2423                 
    25         public final function __construct() 
     24        function __construct() 
    2625        { 
    2726                $this->ldap = new ldap_im(); 
     
    3231                $this->ou_User = substr($this->ou_User,strpos($this->ou_User, "ou=")); 
    3332                $this->ou_User = strtoupper(substr($this->ou_User, 0, strpos($this->ou_User, ",dc="))); 
    34                  
    35                 // Hosts Jabber 
    36                 $this->hostsJabber = unserialize($_SESSION['phpgw_info']['jabberit_messenger']['map_org_realm_jabberit']); 
    3733                 
    3834                // Server Name Jabber 
     
    7167                        return "<error>Many Results</error>"; 
    7268 
    73                 foreach($this->hostsJabber as $conf ) 
    74                         if(array_search("*", $conf)) 
     69                // Hosts Jabber 
     70                $hostsJabber = unserialize($_SESSION['phpgw_info']['jabberit_messenger']['map_org_realm_jabberit']); 
     71 
     72                foreach($hostsJabber as $conf ) 
     73                        if( array_search("*", $conf) ) 
    7574                                $hostDefault = $conf['jabberName']; 
    7675                         
     
    7978                        for($i = 0; $i < count($users); $i++)                            
    8079                        { 
    81                                 if( is_array($this->hostsJabber) ) 
    82                                 { 
    83                                         foreach($this->hostsJabber as $itens) 
     80                                if( is_array($hostsJabber) ) 
     81                                { 
     82                                        foreach($hostsJabber as $itens) 
    8483                                        { 
    85                                                 if( $itens['org'] === $users[$i]['ou']  ) 
    86                                                 { 
    87                                                         if( strpos($users[$i]['jid'], "@") === false ) 
    88                                                                 $users[$i]['jid'] = $users[$i]['jid']."@".$itens['jabberName']; 
    89                                                 } 
     84                                                if( trim($users[$i]['ou']) === trim($itens['org']) ) 
     85                                                        $users[$i]['jid'] = $users[$i]['jid']."@".$itens['jabberName']; 
    9086                                                else 
    9187                                                { 
    9288                                                        if( $users[$i]['ou'] === $ou_User ) 
    93                                                         { 
    94                                                                 if( strpos($users[$i]['jid'], "@") === false ) 
     89                                                                if(strpos($users[$i]['jid'],"@") === false) 
    9590                                                                        $users[$i]['jid'] = $users[$i]['jid']."@".$this->serverJabber; 
    96                                                         } 
    9791                                                        else 
    98                                                         { 
    99                                                                 if( strpos($users[$i]['jid'], "@") === false ) 
     92                                                                if(strpos($users[$i]['jid'],"@") === false) 
    10093                                                                        $users[$i]['jid'] = $users[$i]['jid']."@".$hostDefault; 
    101                                                         } 
    10294                                                } 
    10395                                        } 
     
    109101                                if ( !array_key_exists($tmp['ou'], $order) ) 
    110102                                        $order[$tmp['ou']] = array(); 
    111  
    112                                 if( strpos($tmp['jid'], "@") === false) 
    113                                         $tmp['jid'] = $tmp['jid']."@".$this->serverJabber; 
    114103 
    115104                                $order[$tmp['ou']][] = '<data><ou>'.$tmp['ou'].'</ou><cn>'.$tmp['cn'].'</cn><mail>'.$tmp['mail'].'</mail><uid>'.$tmp['uid'].'</uid><jid>'.$tmp['jid'].'</jid><photo>'.$tmp['photo'].'</photo></data>'; 
     
    184173                        return $uids_org; 
    185174        }             
     175 
    186176                return $members;         
    187177        } 
Note: See TracChangeset for help on using the changeset viewer.