Do not apply server side sorting for paged search requests

Revert this prior start working on #10147

refs #10147
This commit is contained in:
Johannes Meyer 2015-10-01 15:47:11 +02:00
parent 50e66810bf
commit 57f30b1f92
3 changed files with 16 additions and 8 deletions

View File

@ -808,7 +808,7 @@ class LdapConnection implements Selectable, Inspectable
$ds = $this->getConnection(); $ds = $this->getConnection();
$serverSorting = $this->getCapabilities()->hasOid(LdapCapabilities::LDAP_SERVER_SORT_OID); $serverSorting = false;//$this->getCapabilities()->hasOid(LdapCapabilities::LDAP_SERVER_SORT_OID);
if (! $serverSorting && $query->hasOrder()) { if (! $serverSorting && $query->hasOrder()) {
foreach ($query->getOrder() as $rule) { foreach ($query->getOrder() as $rule) {
if (! in_array($rule[0], $fields)) { if (! in_array($rule[0], $fields)) {

View File

@ -48,7 +48,7 @@ class LdapQuery extends SimpleQuery
protected function init() protected function init()
{ {
$this->filters = array(); $this->filters = array();
$this->usePagedResults = true; $this->usePagedResults = false;
} }
/** /**

View File

@ -291,11 +291,15 @@ class AdminAccountPage extends Form
protected function fetchUsers() protected function fetchUsers()
{ {
try { try {
return $this $query = $this
->createUserBackend() ->createUserBackend()
->select(array('user_name')) ->select(array('user_name'))
->order('user_name', 'asc', true) ->order('user_name', 'asc', true);
->fetchColumn(); if (in_array($this->backendConfig['backend'], array('ldap', 'msldap'))) {
$query->getQuery()->setUsePagedResults();
}
return $query->fetchColumn();
} catch (Exception $_) { } catch (Exception $_) {
// No need to handle anything special here. Error means no users found. // No need to handle anything special here. Error means no users found.
return array(); return array();
@ -346,10 +350,14 @@ class AdminAccountPage extends Form
protected function fetchGroups() protected function fetchGroups()
{ {
try { try {
return $this $query = $this
->createUserGroupBackend() ->createUserGroupBackend()
->select(array('group_name')) ->select(array('group_name'));
->fetchColumn(); if (in_array($this->backendConfig['backend'], array('ldap', 'msldap'))) {
$query->getQuery()->setUsePagedResults();
}
return $query->fetchColumn();
} catch (Exception $_) { } catch (Exception $_) {
// No need to handle anything special here. Error means no groups found. // No need to handle anything special here. Error means no groups found.
return array(); return array();