Changeset 5126 in subversion
- Timestamp:
- Aug 24, 2011 3:38:50 PM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/include/rcube_ldap.php
r5074 r5126 432 432 if ($this->ldap_result && $this->result->count > 0) 433 433 { 434 // sorting still on the ldap server 434 435 if ($this->sort_col && $this->prop['scope'] !== 'base' && !$this->vlv_active) 435 436 ldap_sort($this->conn, $this->ldap_result, $this->sort_col); 436 437 438 // start and end of the page 437 439 $start_row = $this->vlv_active ? 0 : $this->result->first; 438 440 $start_row = $subset < 0 ? $start_row + $this->page_size + $subset : $start_row; … … 440 442 $last_row = $subset != 0 ? $start_row + abs($subset) : $last_row; 441 443 444 // get all entries from the ldap server 442 445 $entries = ldap_get_entries($this->conn, $this->ldap_result); 446 447 // filtering for group members 448 if ($this->groups and $this->group_id) 449 { 450 $count = 0; 451 $members = array(); 452 foreach ($entries as $entry) 453 { 454 if ($this->group_members[base64_encode($entry['dn'])]) 455 { 456 $members[] = $entry; 457 $count++; 458 } 459 } 460 $entries = $members; 461 $entries['count'] = $count; 462 $this->result->count = $count; 463 } 464 465 // filter entries for this page 443 466 for ($i = $start_row; $i < min($entries['count'], $last_row); $i++) 444 467 $this->result->add($this->_ldap2result($entries[$i])); 445 468 } 446 447 // temp hack for filtering group members448 if ($this->groups and $this->group_id)449 {450 $result = new rcube_result_set();451 while ($record = $this->result->iterate())452 {453 if ($this->group_members[$record['ID']])454 {455 $result->add($record);456 $result->count++;457 }458 }459 $this->result = $result;460 }461 462 469 return $this->result; 463 470 }
Note: See TracChangeset
for help on using the changeset viewer.
