Nextcloud PHP API (master)

GroupInterface

TODO actually this is a IGroupBackend

Tags
since
4.5.0

Table of Contents

Constants

ADD_TO_GROUP  = 0x100
COUNT_USERS  = 0x100000
CREATE_GROUP  = 0x1
actions that user backends can define
DELETE_GROUP  = 0x10
GROUP_DETAILS  = 0x1000000
IS_ADMIN  = 0x10000000
REMOVE_FROM_GOUP  = 0x1000
REMOVE_FROM_GROUP  = 0x1000

Methods

getGroups()  : array<string|int, mixed>
getUserGroups()  : array<string|int, mixed>
Get all groups a user belongs to
groupExists()  : bool
implementsActions()  : bool
Check if backend implements actions
inGroup()  : bool
is user in group?
usersInGroup()  : array<int, string>

Constants

ADD_TO_GROUP

public mixed ADD_TO_GROUP = 0x100
Tags
since
12.0.0

COUNT_USERS

public mixed COUNT_USERS = 0x100000
Tags
since
12.0.0

CREATE_GROUP

actions that user backends can define

public mixed CREATE_GROUP = 0x1
Tags
since
12.0.0

GROUP_DETAILS

public mixed GROUP_DETAILS = 0x1000000
Tags
since
12.0.0

REMOVE_FROM_GOUP

public mixed REMOVE_FROM_GOUP = 0x1000
Tags
since
12.0.0
deprecated
29.0.0

REMOVE_FROM_GROUP

public mixed REMOVE_FROM_GROUP = 0x1000
Tags
since
12.0.0

Methods

getGroups()

public getGroups([string $search = '' ][, int $limit = -1 ][, int $offset = 0 ]) : array<string|int, mixed>
Parameters
$search : string = ''
$limit : int = -1
$offset : int = 0
Tags
brief

Get a list of all groups

since
4.5.0

Returns a list with all groups

Return values
array<string|int, mixed>

an array of group names

getUserGroups()

Get all groups a user belongs to

public getUserGroups(string $uid) : array<string|int, mixed>
Parameters
$uid : string

Name of the user

Tags
since
4.5.0

This function fetches all groups a user belongs to. It does not check if the user exists at all.

Return values
array<string|int, mixed>

an array of group names

groupExists()

public groupExists(string $gid) : bool
Parameters
$gid : string
Tags
brief

Check if a group exists

since
4.5.0
Return values
bool

implementsActions()

Check if backend implements actions

public implementsActions(int $actions) : bool
Parameters
$actions : int

bitwise-or'ed actions

Tags
since
4.5.0

Returns the supported actions as int to be compared with \OC_Group_Backend::CREATE_GROUP etc.

Return values
bool

inGroup()

is user in group?

public inGroup(string $uid, string $gid) : bool
Parameters
$uid : string

uid of the user

$gid : string

gid of the group

Tags
since
4.5.0

Checks whether the user is member of a group or not.

Return values
bool

usersInGroup()

public usersInGroup(string $gid[, string $search = '' ][, int $limit = -1 ][, int $offset = 0 ]) : array<int, string>
Parameters
$gid : string
$search : string = ''
$limit : int = -1
$offset : int = 0
Tags
brief

Get a list of user ids in a group matching the given search parameters.

since
4.5.0
deprecated
27.0.0

Use searchInGroup instead, for performance reasons

Return values
array<int, string>

an array of user ids


        
On this page

Search results