iuser.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <?php
  2. /**
  3. * @author Lukas Reschke <lukas@owncloud.com>
  4. * @author Morris Jobke <hey@morrisjobke.de>
  5. * @author Robin Appelman <icewind@owncloud.com>
  6. * @author Thomas Müller <thomas.mueller@tmit.eu>
  7. *
  8. * @copyright Copyright (c) 2015, ownCloud, Inc.
  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. namespace OCP;
  25. /**
  26. * Interface IUser
  27. *
  28. * @package OCP
  29. * @since 8.0.0
  30. */
  31. interface IUser {
  32. /**
  33. * get the user id
  34. *
  35. * @return string
  36. * @since 8.0.0
  37. */
  38. public function getUID();
  39. /**
  40. * get the display name for the user, if no specific display name is set it will fallback to the user id
  41. *
  42. * @return string
  43. * @since 8.0.0
  44. */
  45. public function getDisplayName();
  46. /**
  47. * set the display name for the user
  48. *
  49. * @param string $displayName
  50. * @return bool
  51. * @since 8.0.0
  52. */
  53. public function setDisplayName($displayName);
  54. /**
  55. * returns the timestamp of the user's last login or 0 if the user did never
  56. * login
  57. *
  58. * @return int
  59. * @since 8.0.0
  60. */
  61. public function getLastLogin();
  62. /**
  63. * updates the timestamp of the most recent login of this user
  64. * @since 8.0.0
  65. */
  66. public function updateLastLoginTimestamp();
  67. /**
  68. * Delete the user
  69. *
  70. * @return bool
  71. * @since 8.0.0
  72. */
  73. public function delete();
  74. /**
  75. * Set the password of the user
  76. *
  77. * @param string $password
  78. * @param string $recoveryPassword for the encryption app to reset encryption keys
  79. * @return bool
  80. * @since 8.0.0
  81. */
  82. public function setPassword($password, $recoveryPassword = null);
  83. /**
  84. * get the users home folder to mount
  85. *
  86. * @return string
  87. * @since 8.0.0
  88. */
  89. public function getHome();
  90. /**
  91. * Get the name of the backend class the user is connected with
  92. *
  93. * @return string
  94. * @since 8.0.0
  95. */
  96. public function getBackendClassName();
  97. /**
  98. * check if the backend allows the user to change his avatar on Personal page
  99. *
  100. * @return bool
  101. * @since 8.0.0
  102. */
  103. public function canChangeAvatar();
  104. /**
  105. * check if the backend supports changing passwords
  106. *
  107. * @return bool
  108. * @since 8.0.0
  109. */
  110. public function canChangePassword();
  111. /**
  112. * check if the backend supports changing display names
  113. *
  114. * @return bool
  115. * @since 8.0.0
  116. */
  117. public function canChangeDisplayName();
  118. /**
  119. * check if the user is enabled
  120. *
  121. * @return bool
  122. * @since 8.0.0
  123. */
  124. public function isEnabled();
  125. /**
  126. * set the enabled status for the user
  127. *
  128. * @param bool $enabled
  129. * @since 8.0.0
  130. */
  131. public function setEnabled($enabled);
  132. }