ILDAPGroupPlugin.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\User_LDAP;
  7. interface ILDAPGroupPlugin {
  8. /**
  9. * Check if plugin implements actions
  10. * @return int
  11. *
  12. * Returns the supported actions as int to be
  13. * compared with OC_GROUP_BACKEND_CREATE_GROUP etc.
  14. */
  15. public function respondToActions();
  16. /**
  17. * @param string $gid
  18. * @return string|null The group DN if group creation was successful.
  19. */
  20. public function createGroup($gid);
  21. /**
  22. * delete a group
  23. * @param string $gid gid of the group to delete
  24. * @return bool
  25. */
  26. public function deleteGroup($gid);
  27. /**
  28. * Add a user to a group
  29. * @param string $uid Name of the user to add to group
  30. * @param string $gid Name of the group in which add the user
  31. * @return bool
  32. *
  33. * Adds a user to a group.
  34. */
  35. public function addToGroup($uid, $gid);
  36. /**
  37. * Removes a user from a group
  38. * @param string $uid Name of the user to remove from group
  39. * @param string $gid Name of the group from which remove the user
  40. * @return bool
  41. *
  42. * removes the user from a group.
  43. */
  44. public function removeFromGroup($uid, $gid);
  45. /**
  46. * get the number of all users matching the search string in a group
  47. * @param string $gid
  48. * @param string $search
  49. * @return int|false
  50. */
  51. public function countUsersInGroup($gid, $search = '');
  52. /**
  53. * get an array with group details
  54. * @param string $gid
  55. * @return array|false
  56. */
  57. public function getGroupDetails($gid);
  58. }