UserInterface.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. * @package OCP
  37. * @since 4.5.0
  38. */
  39. interface UserInterface {
  40. /**
  41. * Check if backend implements actions
  42. * @param int $actions bitwise-or'ed actions
  43. * @return boolean
  44. *
  45. * Returns the supported actions as int to be
  46. * compared with \OC\User\Backend::CREATE_USER etc.
  47. * @since 4.5.0
  48. * @deprecated 14.0.0 Switch to the interfaces from OCP\User\Backend
  49. */
  50. public function implementsActions($actions);
  51. /**
  52. * delete a user
  53. * @param string $uid The username of the user to delete
  54. * @return bool
  55. * @since 4.5.0
  56. */
  57. public function deleteUser($uid);
  58. /**
  59. * Get a list of all users
  60. *
  61. * @param string $search
  62. * @param null|int $limit
  63. * @param null|int $offset
  64. * @return string[] an array of all uids
  65. * @since 4.5.0
  66. */
  67. public function getUsers($search = '', $limit = null, $offset = null);
  68. /**
  69. * check if a user exists
  70. * @param string $uid the username
  71. * @return boolean
  72. * @since 4.5.0
  73. */
  74. public function userExists($uid);
  75. /**
  76. * get display name of the user
  77. * @param string $uid user ID of the user
  78. * @return string display name
  79. * @since 4.5.0
  80. */
  81. public function getDisplayName($uid);
  82. /**
  83. * Get a list of all display names and user ids.
  84. *
  85. * @param string $search
  86. * @param string|null $limit
  87. * @param string|null $offset
  88. * @return array an array of all displayNames (value) and the corresponding uids (key)
  89. * @since 4.5.0
  90. */
  91. public function getDisplayNames($search = '', $limit = null, $offset = null);
  92. /**
  93. * Check if a user list is available or not
  94. * @return boolean if users can be listed or not
  95. * @since 4.5.0
  96. */
  97. public function hasUserListings();
  98. }