\OCPIGroupManager

Class Manager

Hooks available in scope \OC\Group:

  • preAddUser(\OC\Group\Group $group, \OC\User\User $user)
  • postAddUser(\OC\Group\Group $group, \OC\User\User $user)
  • preRemoveUser(\OC\Group\Group $group, \OC\User\User $user)
  • postRemoveUser(\OC\Group\Group $group, \OC\User\User $user)
  • preDelete(\OC\Group\Group $group)
  • postDelete(\OC\Group\Group $group)
  • preCreate(string $groupId)
  • postCreate(\OC\Group\Group $group)

Summary

Methods
Constants
isBackendUsed()
addBackend()
clearBackends()
get()
groupExists()
createGroup()
search()
getUserGroups()
getUserGroupIds()
displayNamesInGroup()
findUsersInGroup()
isAdmin()
isInGroup()
getSubAdmin()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

isBackendUsed()

isBackendUsed(string  $backendClass) : boolean

Checks whether a given backend is used

Parameters

string $backendClass

Full classname including complete namespace

Returns

boolean

addBackend()

addBackend(\OCP\GroupInterface  $backend) 

Parameters

\OCP\GroupInterface $backend

clearBackends()

clearBackends() 

get()

get(string  $gid) : \OCP\IGroup

Parameters

string $gid

Returns

\OCP\IGroup

groupExists()

groupExists(string  $gid) : boolean

Parameters

string $gid

Returns

boolean

createGroup()

createGroup(string  $gid) : \OCP\IGroup

Parameters

string $gid

Returns

\OCP\IGroup

search()

search(string  $search, integer  $limit = null, integer  $offset = null, string  $scope = null) : array<mixed,\OCP\IGroup>

Parameters

string $search
integer $limit
integer $offset
string $scope

Returns

array<mixed,\OCP\IGroup>

getUserGroups()

getUserGroups(\OCP\IUser|null  $user, string  $scope = null) : array<mixed,\OCP\IGroup>

Parameters

\OCP\IUser|null $user
string $scope

Returns

array<mixed,\OCP\IGroup>

getUserGroupIds()

getUserGroupIds(\OCP\IUser  $user, string  $scope = null) : array

Parameters

\OCP\IUser $user
string $scope

Returns

array —

with group names

displayNamesInGroup()

displayNamesInGroup(string  $gid, string  $search = '', integer  $limit = -1, integer  $offset) : array

get a list of all display names in a group

Parameters

string $gid
string $search
integer $limit
integer $offset

Returns

array —

an array of display names (value) and user ids (key)

findUsersInGroup()

findUsersInGroup(string  $gid, string  $search = '', integer  $limit = -1, integer  $offset) : array

search for users in a specific group

Parameters

string $gid
string $search
integer $limit
integer $offset

Returns

array —

an array of display names (value) and user objects

isAdmin()

isAdmin(string  $userId) : boolean

Checks if a userId is in the admin group

Parameters

string $userId

Returns

boolean —

if admin

isInGroup()

isInGroup(string  $userId, string  $group) : boolean

Checks if a userId is in a group

Parameters

string $userId
string $group

Returns

boolean —

if in group

getSubAdmin()

getSubAdmin() : \OCP\ISubAdminManager

Returns the sub admin manager

Returns

\OCP\ISubAdminManager