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.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. * check if the backend allows the user to change his avatar on Personal page
  101. *
  102. * @return bool
  103. * @since 8.0.0
  104. */
  105. public function canChangeAvatar();
  106. /**
  107. * check if the backend supports changing passwords
  108. *
  109. * @return bool
  110. * @since 8.0.0
  111. */
  112. public function canChangePassword();
  113. /**
  114. * check if the backend supports changing display names
  115. *
  116. * @return bool
  117. * @since 8.0.0
  118. */
  119. public function canChangeDisplayName();
  120. /**
  121. * check if the user is enabled
  122. *
  123. * @return bool
  124. * @since 8.0.0
  125. */
  126. public function isEnabled();
  127. /**
  128. * set the enabled status for the user
  129. *
  130. * @param bool $enabled
  131. * @since 8.0.0
  132. */
  133. public function setEnabled($enabled);
  134. /**
  135. * get the users email address
  136. *
  137. * @return string|null
  138. * @since 9.0.0
  139. */
  140. public function getEMailAddress();
  141. /**
  142. * get the avatar image if it exists
  143. *
  144. * @param int $size
  145. * @return IImage|null
  146. * @since 9.0.0
  147. */
  148. public function getAvatarImage($size);
  149. /**
  150. * get the federation cloud id
  151. *
  152. * @return string
  153. * @since 9.0.0
  154. */
  155. public function getCloudId();
  156. /**
  157. * set the email address of the user
  158. *
  159. * @param string|null $mailAddress
  160. * @return void
  161. * @since 9.0.0
  162. */
  163. public function setEMailAddress($mailAddress);
  164. /**
  165. * get the users' quota in human readable form. If a specific quota is not
  166. * set for the user, the default value is returned. If a default setting
  167. * was not set otherwise, it is return as 'none', i.e. quota is not limited.
  168. *
  169. * @return string
  170. * @since 9.0.0
  171. */
  172. public function getQuota();
  173. /**
  174. * set the users' quota
  175. *
  176. * @param string $quota
  177. * @return void
  178. * @since 9.0.0
  179. */
  180. public function setQuota($quota);
  181. }