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.

108 lines
2.8 KiB

3 years ago
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. *
  10. * @license AGPL-3.0
  11. *
  12. * This code is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License, version 3,
  14. * as published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License, version 3,
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>
  23. *
  24. */
  25. /**
  26. * Public interface of ownCloud for apps to use.
  27. * User Interface
  28. *
  29. */
  30. // use OCP namespace for all classes that are considered public.
  31. // This means that they should be used by apps instead of the internal ownCloud classes
  32. namespace OCP;
  33. /**
  34. * TODO actually this is a IUserBackend
  35. *
  36. * @since 4.5.0
  37. */
  38. interface UserInterface {
  39. /**
  40. * Check if backend implements actions
  41. * @param int $actions bitwise-or'ed actions
  42. * @return boolean
  43. *
  44. * Returns the supported actions as int to be
  45. * compared with \OC\User\Backend::CREATE_USER etc.
  46. * @since 4.5.0
  47. * @deprecated 14.0.0 Switch to the interfaces from OCP\User\Backend
  48. */
  49. public function implementsActions($actions);
  50. /**
  51. * delete a user
  52. * @param string $uid The username of the user to delete
  53. * @return bool
  54. * @since 4.5.0
  55. */
  56. public function deleteUser($uid);
  57. /**
  58. * Get a list of all users
  59. *
  60. * @param string $search
  61. * @param null|int $limit
  62. * @param null|int $offset
  63. * @return string[] an array of all uids
  64. * @since 4.5.0
  65. */
  66. public function getUsers($search = '', $limit = null, $offset = null);
  67. /**
  68. * check if a user exists
  69. * @param string $uid the username
  70. * @return boolean
  71. * @since 4.5.0
  72. */
  73. public function userExists($uid);
  74. /**
  75. * get display name of the user
  76. * @param string $uid user ID of the user
  77. * @return string display name
  78. * @since 4.5.0
  79. */
  80. public function getDisplayName($uid);
  81. /**
  82. * Get a list of all display names and user ids.
  83. *
  84. * @param string $search
  85. * @param string|null $limit
  86. * @param string|null $offset
  87. * @return array an array of all displayNames (value) and the corresponding uids (key)
  88. * @since 4.5.0
  89. */
  90. public function getDisplayNames($search = '', $limit = null, $offset = null);
  91. /**
  92. * Check if a user list is available or not
  93. * @return boolean if users can be listed or not
  94. * @since 4.5.0
  95. */
  96. public function hasUserListings();
  97. }