Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
81dbe7da
Commit
81dbe7da
authored
11 years ago
by
Arthur Schiwon
Browse files
Options
Downloads
Patches
Plain Diff
Port PR #5457 to master
parent
3fc23237
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/user_ldap/lib/access.php
+11
-4
11 additions, 4 deletions
apps/user_ldap/lib/access.php
with
11 additions
and
4 deletions
apps/user_ldap/lib/access.php
+
11
−
4
View file @
81dbe7da
...
...
@@ -28,6 +28,8 @@ class Access extends LDAPUtility {
//never ever check this var directly, always use getPagedSearchResultState
protected
$pagedSearchedSuccessful
;
protected
$cookies
=
array
();
public
function
__construct
(
Connection
$connection
,
ILDAPWrapper
$ldap
)
{
parent
::
__construct
(
$ldap
);
$this
->
connection
=
$connection
;
...
...
@@ -60,6 +62,8 @@ class Access extends LDAPUtility {
\OCP\Util
::
writeLog
(
'user_ldap'
,
'LDAP resource not available.'
,
\OCP\Util
::
DEBUG
);
return
false
;
}
//all or nothing! otherwise we get in trouble with.
$this
->
initPagedSearch
(
$filter
,
array
(
$dn
),
$attr
,
99999
,
0
);
$dn
=
$this
->
DNasBaseParameter
(
$dn
);
$rr
=
@
$this
->
ldap
->
read
(
$cr
,
$dn
,
$filter
,
array
(
$attr
));
if
(
!
$this
->
ldap
->
isResource
(
$rr
))
{
...
...
@@ -1048,9 +1052,12 @@ class Access extends LDAPUtility {
$offset
-=
$limit
;
//we work with cache here
$cachekey
=
'lc'
.
crc32
(
$base
)
.
'-'
.
crc32
(
$filter
)
.
'-'
.
$limit
.
'-'
.
$offset
;
$cookie
=
$this
->
connection
->
getFromCache
(
$cachekey
);
if
(
is_null
(
$cookie
))
{
$cookie
=
''
;
$cookie
=
''
;
if
(
isset
(
$this
->
cookies
[
$cachekey
]))
{
$cookie
=
$this
->
cookies
[
$cachekey
];
if
(
is_null
(
$cookie
))
{
$cookie
=
''
;
}
}
return
$cookie
;
}
...
...
@@ -1067,7 +1074,7 @@ class Access extends LDAPUtility {
private
function
setPagedResultCookie
(
$base
,
$filter
,
$limit
,
$offset
,
$cookie
)
{
if
(
!
empty
(
$cookie
))
{
$cachekey
=
'lc'
.
crc32
(
$base
)
.
'-'
.
crc32
(
$filter
)
.
'-'
.
$limit
.
'-'
.
$offset
;
$
cookie
=
$this
->
connection
->
writeToCache
(
$cachekey
,
$cookie
)
;
$
this
->
cookies
[
$cachekey
]
=
$cookie
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment