ILDAPUserPlugin.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 EITA Cooperative (eita.org.br)
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Vinicius Cubas Brand <vinicius@eita.org.br>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  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
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. namespace OCA\User_LDAP;
  25. interface ILDAPUserPlugin {
  26. /**
  27. * Check if plugin implements actions
  28. * @return int
  29. *
  30. * Returns the supported actions as int to be
  31. * compared with OC_USER_BACKEND_CREATE_USER etc.
  32. */
  33. public function respondToActions();
  34. /**
  35. * Create a new user in LDAP Backend
  36. *
  37. * @param string $uid The UID of the user to create
  38. * @param string $password The password of the new user
  39. * @return bool|string
  40. */
  41. public function createUser($uid, $password);
  42. /**
  43. * Set password
  44. *
  45. * @param string $uid The username
  46. * @param string $password The new password
  47. * @return bool
  48. *
  49. * Change the password of a user
  50. */
  51. public function setPassword($uid, $password);
  52. /**
  53. * get the user's home directory
  54. * @param string $uid the username
  55. * @return boolean
  56. */
  57. public function getHome($uid);
  58. /**
  59. * get display name of the user
  60. * @param string $uid user ID of the user
  61. * @return string display name
  62. */
  63. public function getDisplayName($uid);
  64. /**
  65. * set display name of the user
  66. * @param string $uid user ID of the user
  67. * @param string $displayName new user's display name
  68. * @return string display name
  69. */
  70. public function setDisplayName($uid, $displayName);
  71. /**
  72. * checks whether the user is allowed to change his avatar in Nextcloud
  73. * @param string $uid the Nextcloud user name
  74. * @return boolean either the user can or cannot
  75. */
  76. public function canChangeAvatar($uid);
  77. /**
  78. * Count the number of users
  79. * @return int|bool
  80. */
  81. public function countUsers();
  82. }