1
0

iuser.php 4.0 KB

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