UserInterface.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. // use OCP namespace for all classes that are considered public.
  8. // This means that they should be used by apps instead of the internal Nextcloud classes
  9. namespace OCP;
  10. /**
  11. * TODO actually this is a IUserBackend
  12. *
  13. * @since 4.5.0
  14. */
  15. interface UserInterface {
  16. /**
  17. * Check if backend implements actions
  18. * @param int $actions bitwise-or'ed actions
  19. * @return boolean
  20. *
  21. * Returns the supported actions as int to be
  22. * compared with \OC\User\Backend::CREATE_USER etc.
  23. * @since 4.5.0
  24. * @deprecated 14.0.0 Switch to the interfaces from OCP\User\Backend
  25. */
  26. public function implementsActions($actions);
  27. /**
  28. * delete a user
  29. * @param string $uid The username of the user to delete
  30. * @return bool
  31. * @since 4.5.0
  32. */
  33. public function deleteUser($uid);
  34. /**
  35. * Get a list of all users
  36. *
  37. * @param string $search
  38. * @param null|int $limit
  39. * @param null|int $offset
  40. * @return string[] an array of all uids
  41. * @since 4.5.0
  42. */
  43. public function getUsers($search = '', $limit = null, $offset = null);
  44. /**
  45. * check if a user exists
  46. * @param string $uid the username
  47. * @return boolean
  48. * @since 4.5.0
  49. */
  50. public function userExists($uid);
  51. /**
  52. * get display name of the user
  53. * @param string $uid user ID of the user
  54. * @return string display name
  55. * @since 4.5.0
  56. */
  57. public function getDisplayName($uid);
  58. /**
  59. * Get a list of all display names and user ids.
  60. *
  61. * @param string $search
  62. * @param int|null $limit
  63. * @param int|null $offset
  64. * @return array an array of all displayNames (value) and the corresponding uids (key)
  65. * @since 4.5.0
  66. */
  67. public function getDisplayNames($search = '', $limit = null, $offset = null);
  68. /**
  69. * Check if a user list is available or not
  70. * @return boolean if users can be listed or not
  71. * @since 4.5.0
  72. */
  73. public function hasUserListings();
  74. }