You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IUser.php 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Lukas Reschke <lukas@statuscode.ch>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Robin Appelman <robin@icewind.nl>
  9. * @author Thomas Müller <thomas.mueller@tmit.eu>
  10. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCP;
  27. /**
  28. * Interface IUser
  29. *
  30. * @package OCP
  31. * @since 8.0.0
  32. */
  33. interface IUser {
  34. /**
  35. * get the user id
  36. *
  37. * @return string
  38. * @since 8.0.0
  39. */
  40. public function getUID();
  41. /**
  42. * get the display name for the user, if no specific display name is set it will fallback to the user id
  43. *
  44. * @return string
  45. * @since 8.0.0
  46. */
  47. public function getDisplayName();
  48. /**
  49. * set the display name for the user
  50. *
  51. * @param string $displayName
  52. * @return bool
  53. * @since 8.0.0
  54. */
  55. public function setDisplayName($displayName);
  56. /**
  57. * returns the timestamp of the user's last login or 0 if the user did never
  58. * login
  59. *
  60. * @return int
  61. * @since 8.0.0
  62. */
  63. public function getLastLogin();
  64. /**
  65. * updates the timestamp of the most recent login of this user
  66. * @since 8.0.0
  67. */
  68. public function updateLastLoginTimestamp();
  69. /**
  70. * Delete the user
  71. *
  72. * @return bool
  73. * @since 8.0.0
  74. */
  75. public function delete();
  76. /**
  77. * Set the password of the user
  78. *
  79. * @param string $password
  80. * @param string $recoveryPassword for the encryption app to reset encryption keys
  81. * @return bool
  82. * @since 8.0.0
  83. */
  84. public function setPassword($password, $recoveryPassword = null);
  85. /**
  86. * get the users home folder to mount
  87. *
  88. * @return string
  89. * @since 8.0.0
  90. */
  91. public function getHome();
  92. /**
  93. * Get the name of the backend class the user is connected with
  94. *
  95. * @return string
  96. * @since 8.0.0
  97. */
  98. public function getBackendClassName();
  99. /**
  100. * Get the backend for the current user object
  101. *
  102. * @since 15.0.0
  103. */
  104. public function getBackend();
  105. /**
  106. * check if the backend allows the user to change his avatar on Personal page
  107. *
  108. * @return bool
  109. * @since 8.0.0
  110. */
  111. public function canChangeAvatar();
  112. /**
  113. * check if the backend supports changing passwords
  114. *
  115. * @return bool
  116. * @since 8.0.0
  117. */
  118. public function canChangePassword();
  119. /**
  120. * check if the backend supports changing display names
  121. *
  122. * @return bool
  123. * @since 8.0.0
  124. */
  125. public function canChangeDisplayName();
  126. /**
  127. * check if the user is enabled
  128. *
  129. * @return bool
  130. * @since 8.0.0
  131. */
  132. public function isEnabled();
  133. /**
  134. * set the enabled status for the user
  135. *
  136. * @param bool $enabled
  137. * @since 8.0.0
  138. */
  139. public function setEnabled(bool $enabled = true);
  140. /**
  141. * get the users email address
  142. *
  143. * @return string|null
  144. * @since 9.0.0
  145. */
  146. public function getEMailAddress();
  147. /**
  148. * get the avatar image if it exists
  149. *
  150. * @param int $size
  151. * @return IImage|null
  152. * @since 9.0.0
  153. */
  154. public function getAvatarImage($size);
  155. /**
  156. * get the federation cloud id
  157. *
  158. * @return string
  159. * @since 9.0.0
  160. */
  161. public function getCloudId();
  162. /**
  163. * set the email address of the user
  164. *
  165. * @param string|null $mailAddress
  166. * @return void
  167. * @since 9.0.0
  168. */
  169. public function setEMailAddress($mailAddress);
  170. /**
  171. * get the users' quota in human readable form. If a specific quota is not
  172. * set for the user, the default value is returned. If a default setting
  173. * was not set otherwise, it is return as 'none', i.e. quota is not limited.
  174. *
  175. * @return string
  176. * @since 9.0.0
  177. */
  178. public function getQuota();
  179. /**
  180. * set the users' quota
  181. *
  182. * @param string $quota
  183. * @return void
  184. * @since 9.0.0
  185. */
  186. public function setQuota($quota);
  187. }