summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2020-07-29 17:39:40 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2020-07-29 17:48:56 +0200
commitd3501be851fe00e02d56aedb69e0281a1d49a681 (patch)
tree276e5c2694e9a4b4391e434f3d4bae60a3c22267
parent7e28286e9dc9a61494ba3f62ed5a5f150ea88fa5 (diff)
downloadnextcloud-server-d3501be851fe00e02d56aedb69e0281a1d49a681.tar.gz
nextcloud-server-d3501be851fe00e02d56aedb69e0281a1d49a681.zip
reset the cookie internally in new API when abandoning paged results op
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
-rw-r--r--apps/user_ldap/lib/PagedResults/Php73.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/PagedResults/Php73.php b/apps/user_ldap/lib/PagedResults/Php73.php
index fffac35c27c..7e182e2eabc 100644
--- a/apps/user_ldap/lib/PagedResults/Php73.php
+++ b/apps/user_ldap/lib/PagedResults/Php73.php
@@ -82,6 +82,12 @@ class Php73 implements IAdapter {
return $this->linkData[$linkId]['serverControls'][LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] ?? '';
}
+ private function resetCookie(int $linkId): void {
+ if (isset($this->linkData[$linkId]['serverControls'][LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'])) {
+ $this->linkData[$linkId]['serverControls'][LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] = '';
+ }
+ }
+
public function getRequestCallFunc(): ?string {
return null;
}
@@ -94,6 +100,10 @@ class Php73 implements IAdapter {
$this->linkData[$linkId]['requestArgs'] = [];
$this->linkData[$linkId]['requestArgs']['pageSize'] = $pageSize;
$this->linkData[$linkId]['requestArgs']['isCritical'] = $isCritical;
+
+ if ($pageSize === 0) {
+ $this->resetCookie($linkId);
+ }
}
public function getRequestCallArgs($link): array {
@@ -153,7 +163,7 @@ class Php73 implements IAdapter {
'oid' => LDAP_CONTROL_PAGEDRESULTS,
'value' => [
'size' => $this->linkData[$linkId]['requestArgs']['pageSize'],
- 'cookie' => $this->linkData[$linkId]['serverControls'][LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] ?? ''
+ 'cookie' => $this->linkData[$linkId]['serverControls'][LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'] ?? '',
]
]];