ILDAPGroupPlugin.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 EITA Cooperative (eita.org.br)
  4. *
  5. * @author Vinicius Cubas Brand <vinicius@eita.org.br>
  6. *
  7. * @license GNU AGPL version 3 or any later version
  8. *
  9. * This program is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License as
  11. * published by the Free Software Foundation, either version 3 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU Affero General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Affero General Public License
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  21. *
  22. */
  23. namespace OCA\User_LDAP;
  24. interface ILDAPGroupPlugin {
  25. /**
  26. * Check if plugin implements actions
  27. * @return int
  28. *
  29. * Returns the supported actions as int to be
  30. * compared with OC_GROUP_BACKEND_CREATE_GROUP etc.
  31. */
  32. public function respondToActions();
  33. /**
  34. * @param string $gid
  35. * @return string|null The group DN if group creation was successful.
  36. */
  37. public function createGroup($gid);
  38. /**
  39. * delete a group
  40. * @param string $gid gid of the group to delete
  41. * @return bool
  42. */
  43. public function deleteGroup($gid);
  44. /**
  45. * Add a user to a group
  46. * @param string $uid Name of the user to add to group
  47. * @param string $gid Name of the group in which add the user
  48. * @return bool
  49. *
  50. * Adds a user to a group.
  51. */
  52. public function addToGroup($uid, $gid);
  53. /**
  54. * Removes a user from a group
  55. * @param string $uid Name of the user to remove from group
  56. * @param string $gid Name of the group from which remove the user
  57. * @return bool
  58. *
  59. * removes the user from a group.
  60. */
  61. public function removeFromGroup($uid, $gid);
  62. /**
  63. * get the number of all users matching the search string in a group
  64. * @param string $gid
  65. * @param string $search
  66. * @return int|false
  67. */
  68. public function countUsersInGroup($gid, $search = '');
  69. /**
  70. * get an array with group details
  71. * @param string $gid
  72. * @return array|false
  73. */
  74. public function getGroupDetails($gid);
  75. }