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
caa9182e
Commit
caa9182e
authored
12 years ago
by
Tom Needham
Browse files
Options
Downloads
Patches
Plain Diff
Updated group methods for provisioning api
parent
8161b04c
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/provisioning_api/lib/groups.php
+52
-1
52 additions, 1 deletion
apps/provisioning_api/lib/groups.php
with
52 additions
and
1 deletion
apps/provisioning_api/lib/groups.php
+
52
−
1
View file @
caa9182e
...
...
@@ -23,7 +23,58 @@
class
OC_Provisioning_API_Groups
{
/**
* returns a list of groups
*/
public
static
function
getGroups
(
$parameters
){
$groups
=
OC_Group
::
getGroups
();
return
empty
(
$groups
)
?
404
:
$groups
;
}
/**
* returns an array of users in the group specified
*/
public
static
function
getGroup
(
$parameters
){
// Check the group exists
if
(
!
OC_Group
::
groupExists
(
$parameters
[
'groupid'
])){
return
404
;
}
return
OC_Group
::
usersInGroup
(
$parameters
[
'groupid'
]);
}
/**
* creates a new group
*/
public
static
function
addGroup
(
$parameters
){
// Validate name
if
(
preg_match
(
'/[^a-zA-Z0-9 _\.@\-]/'
,
$parameters
[
'groupid'
]
)
||
empty
(
$parameters
[
'groupid'
])){
return
401
;
}
// Check if it exists
if
(
OC_Group
::
groupExists
(
$parameters
[
'groupid'
])){
return
409
;
}
if
(
OC_Group
::
createGroup
(
$parameters
[
'groupid'
])){
return
200
;
}
else
{
return
500
;
}
}
public
static
function
deleteGroup
(
$parameters
){
// Check it exists
if
(
!
OC_Group
::
groupExists
(
$parameters
[
'groupid'
])){
return
404
;
}
else
if
(
$parameters
[
'groupid'
]
==
'admin'
){
// Cannot delete admin group
return
403
;
}
else
{
if
(
OC_Group
::
deleteGroup
(
$parameters
[
'groupid'
])){
return
200
;
}
else
{
return
500
;
}
}
}
}
\ No newline at end of file
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