ILDAPUserPlugin.php 2.3 KB

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