Changeset 977 for trunk/jabberit_messenger/inc/class.contacts_im.inc.php
- Timestamp:
- 06/10/09 18:26:16 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jabberit_messenger/inc/class.contacts_im.inc.php
r952 r977 20 20 private $db; 21 21 private $ou_User; 22 private $hostsJabber;23 22 private $serverJabber; 24 23 25 public finalfunction __construct()24 function __construct() 26 25 { 27 26 $this->ldap = new ldap_im(); … … 32 31 $this->ou_User = substr($this->ou_User,strpos($this->ou_User, "ou=")); 33 32 $this->ou_User = strtoupper(substr($this->ou_User, 0, strpos($this->ou_User, ",dc="))); 34 35 // Hosts Jabber36 $this->hostsJabber = unserialize($_SESSION['phpgw_info']['jabberit_messenger']['map_org_realm_jabberit']);37 33 38 34 // Server Name Jabber … … 71 67 return "<error>Many Results</error>"; 72 68 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) ) 75 74 $hostDefault = $conf['jabberName']; 76 75 … … 79 78 for($i = 0; $i < count($users); $i++) 80 79 { 81 if( is_array($ this->hostsJabber) )82 { 83 foreach($ this->hostsJabber as $itens)80 if( is_array($hostsJabber) ) 81 { 82 foreach($hostsJabber as $itens) 84 83 { 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']; 90 86 else 91 87 { 92 88 if( $users[$i]['ou'] === $ou_User ) 93 { 94 if( strpos($users[$i]['jid'], "@") === false ) 89 if(strpos($users[$i]['jid'],"@") === false) 95 90 $users[$i]['jid'] = $users[$i]['jid']."@".$this->serverJabber; 96 }97 91 else 98 { 99 if( strpos($users[$i]['jid'], "@") === false ) 92 if(strpos($users[$i]['jid'],"@") === false) 100 93 $users[$i]['jid'] = $users[$i]['jid']."@".$hostDefault; 101 }102 94 } 103 95 } … … 109 101 if ( !array_key_exists($tmp['ou'], $order) ) 110 102 $order[$tmp['ou']] = array(); 111 112 if( strpos($tmp['jid'], "@") === false)113 $tmp['jid'] = $tmp['jid']."@".$this->serverJabber;114 103 115 104 $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>'; … … 184 173 return $uids_org; 185 174 } 175 186 176 return $members; 187 177 }
Note: See TracChangeset
for help on using the changeset viewer.