Changeset 1911
- Timestamp:
- 12/29/09 15:03:07 (14 years ago)
- Location:
- trunk/jabberit_messenger/inc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jabberit_messenger/inc/class.contacts_im.inc.php
r1900 r1911 201 201 if( !$this->groupsLocked() ) 202 202 { 203 $array_uids_external = array();204 205 203 unset($serversLdap[$this->serverLdap]); 206 204 … … 209 207 foreach( $serversLdap as $key => $tmp ) 210 208 { 209 $array_uids_external = array( ); 211 210 $groupsExternal = unserialize($tmp); 212 211 … … 217 216 $group = explode(":",$tmpExt); 218 217 $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); 218 219 if( $array_result[0]['memberuid']['count'] ) 220 unset($array_result[0]['memberuid']['count']); 221 222 $array_uids_external = array_merge($array_uids_external, $array_result[0]['memberuid']); 222 223 } 223 224 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); 232 } 233 234 } 235 } 236 225 226 if( is_array($array_uids_external) ) 227 { 228 for( $i = 0; $i < count( $array_uids_external ) ; $i+=50 ) 229 { 230 $partial_uids_external = array_slice($array_uids_external,$i,50); 231 $filter_uid_external = implode(")(uid=",$partial_uids_external); 232 $filter_uid_external = "(uid=". $filter_uid_external. ")"; 233 $result[] = $this->ldap->getUsersLdapCatalog("cn=*".$pName."*", $filter_uid_external, $key ); 234 } 235 } 236 } 237 } 238 } 239 237 240 if( count($this->hostsJabberLdap) ) 238 241 { -
trunk/jabberit_messenger/inc/class.ldap_im.inc.php
r1900 r1911 195 195 @ldap_close($this->ldap); 196 196 197 if( $pLdap == $confHosts[$i]['serverLdap'])197 if( trim($pLdap) === trim($confHosts[$i]['serverLdap']) ) 198 198 { 199 199 $this->ldap_host = $confHosts[$i]['serverLdap']; … … 202 202 $this->ldap_org = $confHosts[$i]['org']; 203 203 $this->ldap_pass = $confHosts[$i]['password']; 204 205 204 $this->ldap = $this->ldapCatalog(); 206 205 … … 212 211 $result = ldap_get_entries($this->ldap,$search); 213 212 } 213 214 214 } 215 215 } … … 310 310 for( $i = 0; $i < count($confHosts); $i++ ) 311 311 { 312 if( $this->ldap )313 @ldap_close($this->ldap);314 315 312 if( $pLdap && $pLdap == $confHosts[$i]['serverLdap'] ) 316 313 { … … 321 318 $this->ldap_pass = $confHosts[$i]['password']; 322 319 $this->ldap = $this->ldapCatalog(); 323 } 324 else 325 { 326 $this->ldap_host = $confHosts[$i]['serverLdap']; 327 $this->ldap_context = $confHosts[$i]['contextLdap']; 328 $this->ldap_user = $confHosts[$i]['user']; 329 $this->ldap_org = $confHosts[$i]['org']; 330 $this->ldap_pass = $confHosts[$i]['password']; 331 $this->ldap = $this->ldapCatalog(); 332 } 333 334 if( $this->ldap ) 335 { 336 $filter = ( $uid ) ? "(&(phpgwaccounttype=u)(|".$uid.")(".$search ."))" : "(&(phpgwaccounttype=u)(".$search ."))"; 337 $justthese = array( $this->attribute ,"uidNumber" ,"cn" ,"mail" ,"phpgwAccountVisible" ,"dn" ,"jpegPhoto" ); 338 $searchRoot = ( $this->ldap_org != "*" ) ? "ou=".$this->ldap_org.",".$this->ldap_context : $this->ldap_context; 339 $search1 = @ldap_search($this->ldap, $searchRoot, $filter, $justthese, 0, $this->max_result + 1); 340 $entry1 = @ldap_get_entries( $this->ldap, $search1 ); 341 $result = $this->resultArray( $entry1, $this->ldap, $this->ldap_org ); 342 343 if( count($return) > 0 ) 344 $return = array_merge($return, $result); 345 else 346 $return = $result; 320 321 if( $this->ldap ) 322 { 323 $filter = ( $uid ) ? "(&(phpgwaccounttype=u)(|".$uid.")(".$search ."))" : "(&(phpgwaccounttype=u)(".$search ."))"; 324 $justthese = array( $this->attribute ,"uidNumber" ,"cn" ,"mail" ,"phpgwAccountVisible" ,"dn" ,"jpegPhoto" ); 325 $searchRoot = ( $this->ldap_org != "*" ) ? "ou=".$this->ldap_org.",".$this->ldap_context : $this->ldap_context; 326 $search1 = @ldap_search($this->ldap, $searchRoot, $filter, $justthese, 0, $this->max_result + 1); 327 $entry1 = @ldap_get_entries( $this->ldap, $search1 ); 328 $result = $this->resultArray( $entry1, $this->ldap, $this->ldap_org ); 329 330 if( count($return) > 0 ) 331 $return = array_merge($return, $result); 332 else 333 $return = $result; 334 } 335 336 if( $this->ldap ) 337 ldap_close($this->ldap); 347 338 } 348 339 }
Note: See TracChangeset
for help on using the changeset viewer.