Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
8906158d
Commit
8906158d
authored
Mar 23, 2015
by
blizzz
Browse files
Merge pull request #15123 from owncloud/fix_14098
offset needs to be considered in computed limit
parents
02c0fe8d
7520d0fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
apps/user_ldap/group_ldap.php
View file @
8906158d
...
...
@@ -673,7 +673,7 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface {
}
$maxGroups
=
100000
;
// limit max results (just for safety reasons)
if
(
$limit
>
-
1
)
{
$overallLimit
=
min
(
$limit
,
$maxGroups
);
$overallLimit
=
min
(
$limit
+
$offset
,
$maxGroups
);
}
else
{
$overallLimit
=
$maxGroups
;
}
...
...
apps/user_ldap/tests/group_ldap.php
View file @
8906158d
...
...
@@ -298,4 +298,18 @@ class Test_Group_Ldap extends \Test\TestCase {
$groupBackend
->
inGroup
(
$uid
,
$gid
);
}
public
function
testGetGroupsWithOffset
()
{
$access
=
$this
->
getAccessMock
();
$this
->
enableGroups
(
$access
);
$access
->
expects
(
$this
->
once
())
->
method
(
'ownCloudGroupNames'
)
->
will
(
$this
->
returnValue
(
array
(
'group1'
,
'group2'
)));
$groupBackend
=
new
GroupLDAP
(
$access
);
$groups
=
$groupBackend
->
getGroups
(
''
,
2
,
2
);
$this
->
assertSame
(
2
,
count
(
$groups
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment