Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2020-07-29 18:39:40 +0300
committerArthur Schiwon <blizzz@arthur-schiwon.de>2020-07-29 18:48:56 +0300
commitd3501be851fe00e02d56aedb69e0281a1d49a681 (patch)
tree276e5c2694e9a4b4391e434f3d4bae60a3c22267 /apps/user_ldap
parent7e28286e9dc9a61494ba3f62ed5a5f150ea88fa5 (diff)
reset the cookie internally in new API when abandoning paged results op
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/user_ldap')
-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'] ?? '',
]
]];