Changeset 1881 for trunk/jabberit_messenger/inc/class.contacts_im.inc.php
- Timestamp:
- 12/22/09 09:38:07 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jabberit_messenger/inc/class.contacts_im.inc.php
r1877 r1881 17 17 class contacts_im 18 18 { 19 private $ldap;20 19 private $db; 21 20 private $dn_User; 21 private $hostsJabberLdap; 22 private $ldap; 22 23 private $ou_User; 23 24 private $serverJabber; … … 41 42 42 43 // Server Name Ldap 43 $this->serverLdap = $_SESSION['phpgw_info']['jabberit_messenger']['server_ldap_jabberit']; 44 $this->serverLdap = $_SESSION['phpgw_info']['jabberit_messenger']['server_ldap_jabberit']; 45 46 // Hosts Jabber / Ldap 47 $this->hostsJabberLdap = unserialize($_SESSION['phpgw_info']['jabberit_messenger']['map_org_realm_jabberit']); 44 48 } 45 49 … … 132 136 $uidType = "uid"; 133 137 $serversLdap = unserialize(trim($_SESSION['phpgw_info']['jabberit_messenger']['groups_search'])); 134 138 135 139 if( $serversLdap ) 136 140 { … … 151 155 } 152 156 } 153 154 157 } 155 158 … … 159 162 $uidType = "uidnumber"; 160 163 } 161 164 162 165 for( $i = 0; $i < count($array_uids) ; $i+=50 ) 163 166 { … … 200 203 $array_uids_external = array(); 201 204 202 if( $serversLdap ) 205 unset($serversLdap[$this->serverLdap]); 206 207 if( $serversLdap && count($serversLdap)) 203 208 { 204 209 foreach( $serversLdap as $key => $tmp ) 205 210 { 206 if( $key != $this->serverLdap ) 211 $groupsExternal = unserialize($tmp); 212 213 if( count($groupsExternal) ) 207 214 { 208 $groupsExternal = unserialize($tmp); 209 210 if(count($groupsExternal)) 211 { 212 foreach( $groupsExternal as $tmpExt ) 213 { 214 $group = explode(":",$tmpExt); 215 $array_result = $this->ldap->getGroupsMemberUid( $group[0], $key ); 216 @array_shift($array_result[0]['memberuid']); 217 $array_uids_external = @array_merge($array_uids_external, $array_result[0]['memberuid']); 218 unset($array_result); 219 } 220 221 for( $i = 0; $i < count( $array_uids_external ) ; $i+=50 ) 222 { 223 $partial_uids_external = array_slice($array_uids_external,$i,50); 224 $filter_uid_external = implode(")(uid=",$partial_uids_external); 225 $filter_uid_external = "(uid=". $filter_uid_external. ")"; 226 $result[] = $this->ldap->getUsersLdapCatalog("cn=*".$pName."*", $filter_uid_external, $key ); 227 } 228 unset($array_uids_external); 229 } 215 foreach( $groupsExternal as $tmpExt ) 216 { 217 $group = explode(":",$tmpExt); 218 $array_result = $this->ldap->getGroupsMemberUid( $group[0], $key ); 219 @array_shift($array_result[0]['memberuid']); 220 $array_uids_external = @array_merge($array_uids_external, $array_result[0]['memberuid']); 221 unset($array_result); 222 } 223 224 for( $i = 0; $i < count( $array_uids_external ) ; $i+=50 ) 225 { 226 $partial_uids_external = array_slice($array_uids_external,$i,50); 227 $filter_uid_external = implode(")(uid=",$partial_uids_external); 228 $filter_uid_external = "(uid=". $filter_uid_external. ")"; 229 $result[] = $this->ldap->getUsersLdapCatalog("cn=*".$pName."*", $filter_uid_external, $key ); 230 } 231 unset($array_uids_external); 230 232 } 231 } 232 } 233 else 234 { 235 $result[] = $this->ldap->getUsersLdapCatalog("cn=*".$pName."*"); 233 234 } 235 } 236 237 if( count($this->hostsJabberLdap) ) 238 { 239 for($i = 0 ; $i < count($this->hostsJabberLdap); $i++) 240 { 241 if( !array_key_exists($this->hostsJabberLdap[$i]['serverLdap'], $serversLdap) ) 242 $result[] = $this->ldap->getUsersLdapCatalog("cn=*".$pName."*", false, $this->hostsJabberLdap[$i]['serverLdap'] ); 243 } 236 244 } 237 245 } … … 247 255 { 248 256 $ou = substr( $this->ou_User, strpos($this->ou_User, "=") + 1 ); 257 249 258 for($i = 0 ; $i < count($members); $i++ ) 250 259 { 251 260 if( $ou == $members[$i]['ou'] ) 261 { 252 262 $uids_org[] = $members[$i]; 263 } 253 264 else 265 { 254 266 if(isset($_SESSION['phpgw_info']['jabberit_messenger']['photo'])) 255 267 unset($_SESSION['phpgw_info']['jabberit_messenger']['photo'][$members[$i]['ou']]); 256 } 268 } 269 } 270 257 271 return $uids_org; 258 272 }
Note: See TracChangeset
for help on using the changeset viewer.