userinterface.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. *
  9. * @license AGPL-3.0
  10. *
  11. * This code is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License, version 3,
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>
  22. *
  23. */
  24. /**
  25. * Public interface of ownCloud for apps to use.
  26. * User Interface
  27. *
  28. */
  29. // use OCP namespace for all classes that are considered public.
  30. // This means that they should be used by apps instead of the internal ownCloud classes
  31. namespace OCP;
  32. /**
  33. * TODO actually this is a IUserBackend
  34. *
  35. * @package OCP
  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. */
  48. public function implementsActions($actions);
  49. /**
  50. * delete a user
  51. * @param string $uid The username of the user to delete
  52. * @return bool
  53. * @since 4.5.0
  54. */
  55. public function deleteUser($uid);
  56. /**
  57. * Get a list of all users
  58. *
  59. * @param string $search
  60. * @param null|int $limit
  61. * @param null|int $offset
  62. * @return string[] an array of all uids
  63. * @since 4.5.0
  64. */
  65. public function getUsers($search = '', $limit = null, $offset = null);
  66. /**
  67. * check if a user exists
  68. * @param string $uid the username
  69. * @return boolean
  70. * @since 4.5.0
  71. */
  72. public function userExists($uid);
  73. /**
  74. * get display name of the user
  75. * @param string $uid user ID of the user
  76. * @return string display name
  77. * @since 4.5.0
  78. */
  79. public function getDisplayName($uid);
  80. /**
  81. * Get a list of all display names and user ids.
  82. *
  83. * @param string $search
  84. * @param string|null $limit
  85. * @param string|null $offset
  86. * @return array an array of all displayNames (value) and the corresponding uids (key)
  87. * @since 4.5.0
  88. */
  89. public function getDisplayNames($search = '', $limit = null, $offset = null);
  90. /**
  91. * Check if a user list is available or not
  92. * @return boolean if users can be listed or not
  93. * @since 4.5.0
  94. */
  95. public function hasUserListings();
  96. }