You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

igroupmanager.php 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace OCP;
  9. /**
  10. * Class Manager
  11. *
  12. * Hooks available in scope \OC\Group:
  13. * - preAddUser(\OC\Group\Group $group, \OC\User\User $user)
  14. * - postAddUser(\OC\Group\Group $group, \OC\User\User $user)
  15. * - preRemoveUser(\OC\Group\Group $group, \OC\User\User $user)
  16. * - postRemoveUser(\OC\Group\Group $group, \OC\User\User $user)
  17. * - preDelete(\OC\Group\Group $group)
  18. * - postDelete(\OC\Group\Group $group)
  19. * - preCreate(string $groupId)
  20. * - postCreate(\OC\Group\Group $group)
  21. *
  22. * @package OC\Group
  23. */
  24. interface IGroupManager {
  25. /**
  26. * @param \OCP\UserInterface $backend
  27. */
  28. public function addBackend($backend);
  29. public function clearBackends();
  30. /**
  31. * @param string $gid
  32. * @return \OCP\IGroup
  33. */
  34. public function get($gid);
  35. /**
  36. * @param string $gid
  37. * @return bool
  38. */
  39. public function groupExists($gid);
  40. /**
  41. * @param string $gid
  42. * @return \OCP\IGroup
  43. */
  44. public function createGroup($gid);
  45. /**
  46. * @param string $search
  47. * @param int $limit
  48. * @param int $offset
  49. * @return \OCP\IGroup[]
  50. */
  51. public function search($search, $limit = null, $offset = null);
  52. /**
  53. * @param \OCP\IUser $user
  54. * @return \OCP\IGroup[]
  55. */
  56. public function getUserGroups($user);
  57. /**
  58. * @param \OCP\IUser $user
  59. * @return array with group names
  60. */
  61. public function getUserGroupIds($user);
  62. /**
  63. * get a list of all display names in a group
  64. *
  65. * @param string $gid
  66. * @param string $search
  67. * @param int $limit
  68. * @param int $offset
  69. * @return array an array of display names (value) and user ids (key)
  70. */
  71. public function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0);
  72. }