backend.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. /**
  3. * ownCloud
  4. *
  5. * @author Frank Karlitschek
  6. * @copyright 2010 Frank Karlitschek karlitschek@kde.org
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * Abstract base class for user management
  24. */
  25. abstract class OC_Group_Backend {
  26. /**
  27. * @brief Try to create a new group
  28. * @param $gid The name of the group to create
  29. * @returns true/false
  30. *
  31. * Trys to create a new group. If the group name already exists, false will
  32. * be returned.
  33. */
  34. public static function createGroup($gid){}
  35. /**
  36. * @brief delete a group
  37. * @param $gid gid of the group to delete
  38. * @returns true/false
  39. *
  40. * Deletes a group and removes it from the group_user-table
  41. */
  42. public static function removeGroup($gid){}
  43. /**
  44. * @brief is user in group?
  45. * @param $uid uid of the user
  46. * @param $gid gid of the group
  47. * @returns true/false
  48. *
  49. * Checks whether the user is member of a group or not.
  50. */
  51. public static function inGroup($uid, $gid){}
  52. /**
  53. * @brief Add a user to a group
  54. * @param $uid Name of the user to add to group
  55. * @param $gid Name of the group in which add the user
  56. * @returns true/false
  57. *
  58. * Adds a user to a group.
  59. */
  60. public static function addToGroup($uid, $gid){}
  61. /**
  62. * @brief Removes a user from a group
  63. * @param $uid Name of the user to remove from group
  64. * @param $gid Name of the group from which remove the user
  65. * @returns true/false
  66. *
  67. * removes the user from a group.
  68. */
  69. public static function removeFromGroup($uid,$gid){}
  70. /**
  71. * @brief Get all groups a user belongs to
  72. * @param $uid Name of the user
  73. * @returns array with group names
  74. *
  75. * This function fetches all groups a user belongs to. It does not check
  76. * if the user exists at all.
  77. */
  78. public static function getUserGroups($uid){}
  79. /**
  80. * @brief get a list of all groups
  81. * @returns array with group names
  82. *
  83. * Returns a list with all groups
  84. */
  85. public static function getGroups(){}
  86. /**
  87. * @brief get a list of all users in a group
  88. * @returns array with user ids
  89. */
  90. public static function usersInGroup($gid){}
  91. }