fix paging

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2017-05-26 13:44:43 +02:00
parent 973f9bfe81
commit 351204ec16
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
1 changed files with 4 additions and 3 deletions

View File

@ -853,10 +853,11 @@ class Access extends LDAPUtility implements IUserTools {
} }
array_unshift($arguments, $cr); array_unshift($arguments, $cr);
// php no longer supports call-time pass-by-reference // php no longer supports call-time pass-by-reference
// make special case for controlPagedResultResponse as the third argument is a reference // thus cannot support controlPagedResultResponse as the third argument
// is a reference
$doMethod = function () use ($command, &$arguments) { $doMethod = function () use ($command, &$arguments) {
if ($command == 'controlPagedResultResponse') { if ($command == 'controlPagedResultResponse') {
return $this->ldap->controlPagedResultResponse($arguments[0], $arguments[1], $arguments[2]); throw new \InvalidArgumentException('Invoker does not support controlPagedResultResponse, call LDAP Wrapper directly instead.');
} else { } else {
return call_user_func_array(array($this->ldap, $command), $arguments); return call_user_func_array(array($this->ldap, $command), $arguments);
} }
@ -939,7 +940,7 @@ class Access extends LDAPUtility implements IUserTools {
if($pagedSearchOK) { if($pagedSearchOK) {
$cr = $this->connection->getConnectionResource(); $cr = $this->connection->getConnectionResource();
foreach($sr as $key => $res) { foreach($sr as $key => $res) {
if($this->invokeLDAPMethod('controlPagedResultResponse', $cr, $res, $cookie)) { if($this->ldap->controlPagedResultResponse($cr, $res, $cookie)) {
$this->setPagedResultCookie($base[$key], $filter, $limit, $offset, $cookie); $this->setPagedResultCookie($base[$key], $filter, $limit, $offset, $cookie);
} }
} }