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
9c3b83e2
Commit
9c3b83e2
authored
11 years ago
by
Arthur Schiwon
Browse files
Options
Downloads
Patches
Plain Diff
Fix retrieval of users with multiple backends
parent
4f6565d8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
settings/ajax/userlist.php
+7
-2
7 additions, 2 deletions
settings/ajax/userlist.php
settings/js/users.js
+9
-3
9 additions, 3 deletions
settings/js/users.js
with
16 additions
and
5 deletions
settings/ajax/userlist.php
+
7
−
2
View file @
9c3b83e2
...
...
@@ -27,9 +27,14 @@ if (isset($_GET['offset'])) {
}
else
{
$offset
=
0
;
}
if
(
isset
(
$_GET
[
'limit'
]))
{
$limit
=
$_GET
[
'limit'
];
}
else
{
$limit
=
10
;
}
$users
=
array
();
if
(
OC_User
::
isAdminUser
(
OC_User
::
getUser
()))
{
$batch
=
OC_User
::
getDisplayNames
(
''
,
10
,
$offset
);
$batch
=
OC_User
::
getDisplayNames
(
''
,
$limit
,
$offset
);
foreach
(
$batch
as
$user
=>
$displayname
)
{
$users
[]
=
array
(
'name'
=>
$user
,
...
...
@@ -40,7 +45,7 @@ if (OC_User::isAdminUser(OC_User::getUser())) {
}
}
else
{
$groups
=
OC_SubAdmin
::
getSubAdminsGroups
(
OC_User
::
getUser
());
$batch
=
OC_Group
::
usersInGroups
(
$groups
,
''
,
10
,
$offset
);
$batch
=
OC_Group
::
usersInGroups
(
$groups
,
''
,
$limit
,
$offset
);
foreach
(
$batch
as
$user
)
{
$users
[]
=
array
(
'name'
=>
$user
,
...
...
This diff is collapsed.
Click to expand it.
settings/js/users.js
+
9
−
3
View file @
9c3b83e2
...
...
@@ -19,6 +19,10 @@ function setQuota (uid, quota, ready) {
var
UserList
=
{
useUndo
:
true
,
availableGroups
:
[],
offset
:
30
,
//The first 30 users are there. No prob, if less in total.
//hardcoded in settings/users.php
usersToLoad
:
10
,
//So many users will be loaded when user scrolls down
/**
* @brief Initiate user deletion process in UI
...
...
@@ -192,14 +196,17 @@ var UserList = {
return
;
}
UserList
.
updating
=
true
;
$
.
get
(
OC
.
Router
.
generate
(
'
settings_ajax_userlist
'
,
{
offset
:
UserList
.
offset
}),
function
(
result
)
{
$
.
get
(
OC
.
Router
.
generate
(
'
settings_ajax_userlist
'
,
{
offset
:
UserList
.
offset
,
limit
:
UserList
.
usersToLoad
}),
function
(
result
)
{
if
(
result
.
status
===
'
success
'
)
{
//The offset does not mirror the amount of users available,
//because it is backend-dependent. For correct retrieval,
//always the limit(requested amount of users) needs to be added.
UserList
.
offset
+=
UserList
.
usersToLoad
;
$
.
each
(
result
.
data
,
function
(
index
,
user
)
{
if
(
$
(
'
tr[data-uid="
'
+
user
.
name
+
'
"]
'
).
length
>
0
)
{
return
true
;
}
var
tr
=
UserList
.
add
(
user
.
name
,
user
.
displayname
,
user
.
groups
,
user
.
subadmin
,
user
.
quota
,
false
);
UserList
.
offset
++
;
if
(
index
==
9
)
{
$
(
tr
).
bind
(
'
inview
'
,
function
(
event
,
isInView
,
visiblePartX
,
visiblePartY
)
{
$
(
this
).
unbind
(
event
);
...
...
@@ -315,7 +322,6 @@ $(document).ready(function () {
UserList
.
doSort
();
UserList
.
availableGroups
=
$
(
'
#content table
'
).
attr
(
'
data-groups
'
).
split
(
'
,
'
);
UserList
.
offset
=
$
(
'
tbody tr
'
).
length
;
$
(
'
tbody tr:last
'
).
bind
(
'
inview
'
,
function
(
event
,
isInView
,
visiblePartX
,
visiblePartY
)
{
OC
.
Router
.
registerLoadedCallback
(
function
()
{
UserList
.
update
();
...
...
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