UserInterface.php 2.7 KB

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