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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
b2ca5955
Commit
b2ca5955
authored
11 years ago
by
Raghu Nayyar
Committed by
Arthur Schiwon
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add GroupList Ajax to Users.
parent
43ced8c6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
settings/ajax/grouplist.php
+75
-0
75 additions, 0 deletions
settings/ajax/grouplist.php
settings/css/settings.css
+1
-1
1 addition, 1 deletion
settings/css/settings.css
settings/routes.php
+2
-0
2 additions, 0 deletions
settings/routes.php
with
78 additions
and
1 deletion
settings/ajax/grouplist.php
0 → 100644
+
75
−
0
View file @
b2ca5955
<?php
/**
* ownCloud - Core
*
* @author Morris Jobke
* @author Raghu Nayyar
* @copyright 2014 Morris Jobke morris.jobke@gmail.com
* @copyright 2014 Raghu Nayyar raghu.nayyar.007@gmail.com
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// This file is repsonsible for the Ajax Request for Group list
// Outputs are Names of Groups and IDs of users which are a part of them
OC_JSON
::
checkSubAdminUser
();
$users
=
array
();
$groupname
=
array
();
$useringroup
=
array
();
$userUid
=
OC_User
::
getUser
();
$isAdmin
=
OC_User
::
isAdminUser
(
$userUid
);
if
(
isset
(
$_GET
[
'offset'
]))
{
$offset
=
$_GET
[
'offset'
];
}
else
{
$offset
=
0
;
}
if
(
isset
(
$_GET
[
'limit'
]))
{
$limit
=
$_GET
[
'limit'
];
}
else
{
$limit
=
10
;
}
if
(
$isAdmin
)
{
$groups
=
OC_Group
::
getGroups
();
$batch
=
OC_User
::
getDisplayNames
(
''
,
$limit
,
$offset
);
foreach
(
$batch
as
$user
)
{
$users
[
'users'
][]
=
array
(
'user'
=>
$user
);
}
}
else
{
$groups
=
OC_SubAdmin
::
getSubAdminsGroups
(
$userUid
);
$batch
=
OC_Group
::
usersInGroups
(
$groups
,
''
,
$limit
,
$offset
);
foreach
(
$batch
as
$user
)
{
$users
[
'users'
][]
=
array
(
'user'
=>
$user
);
}
}
// convert them to the needed format
foreach
(
$groups
as
$gid
)
{
$groupname
[]
=
array
(
'id'
=>
str_replace
(
' '
,
''
,
$gid
),
'name'
=>
$gid
,
'useringroup'
=>
OC_Group
::
usersInGroup
(
$gid
,
''
,
$limit
,
$offset
),
'isAdmin'
=>
!
OC_User
::
isAdminUser
(
$gid
),
);
}
OCP\JSON
::
success
(
array
(
'result'
=>
$groupname
));
?>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
settings/css/settings.css
+
1
−
1
View file @
b2ca5955
...
...
@@ -65,7 +65,7 @@ tr:hover>td.remove>a, tr:hover>td.password>img,tr:hover>td.displayName>img, tr:h
tr
:hover
>
td
.remove
>
a
{
float
:
right
;
}
div
.quota
{
float
:
right
;
margin
:
10px
;
display
:
block
;
}
div
.quota-select-wrapper
{
position
:
relative
;
}
...
...
This diff is collapsed.
Click to expand it.
settings/routes.php
+
2
−
0
View file @
b2ca5955
...
...
@@ -25,6 +25,8 @@ $this->create('settings_admin', '/settings/admin')
// users
$this
->
create
(
'settings_ajax_userlist'
,
'/settings/ajax/userlist'
)
->
actionInclude
(
'settings/ajax/userlist.php'
);
$this
->
create
(
'settings_ajax_grouplist'
,
'/settings/ajax/grouplist'
)
->
actionInclude
(
'settings/ajax/grouplist.php'
);
$this
->
create
(
'settings_ajax_createuser'
,
'/settings/ajax/createuser.php'
)
->
actionInclude
(
'settings/ajax/createuser.php'
);
$this
->
create
(
'settings_ajax_removeuser'
,
'/settings/ajax/removeuser.php'
)
...
...
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