iuser.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. /**
  3. * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace OCP;
  9. interface IUser {
  10. /**
  11. * get the user id
  12. *
  13. * @return string
  14. */
  15. public function getUID();
  16. /**
  17. * get the display name for the user, if no specific display name is set it will fallback to the user id
  18. *
  19. * @return string
  20. */
  21. public function getDisplayName();
  22. /**
  23. * set the display name for the user
  24. *
  25. * @param string $displayName
  26. * @return bool
  27. */
  28. public function setDisplayName($displayName);
  29. /**
  30. * returns the timestamp of the user's last login or 0 if the user did never
  31. * login
  32. *
  33. * @return int
  34. */
  35. public function getLastLogin();
  36. /**
  37. * updates the timestamp of the most recent login of this user
  38. */
  39. public function updateLastLoginTimestamp();
  40. /**
  41. * Delete the user
  42. *
  43. * @return bool
  44. */
  45. public function delete();
  46. /**
  47. * Set the password of the user
  48. *
  49. * @param string $password
  50. * @param string $recoveryPassword for the encryption app to reset encryption keys
  51. * @return bool
  52. */
  53. public function setPassword($password, $recoveryPassword = null);
  54. /**
  55. * get the users home folder to mount
  56. *
  57. * @return string
  58. */
  59. public function getHome();
  60. /**
  61. * Get the name of the backend class the user is connected with
  62. *
  63. * @return string
  64. */
  65. public function getBackendClassName();
  66. /**
  67. * check if the backend allows the user to change his avatar on Personal page
  68. *
  69. * @return bool
  70. */
  71. public function canChangeAvatar();
  72. /**
  73. * check if the backend supports changing passwords
  74. *
  75. * @return bool
  76. */
  77. public function canChangePassword();
  78. /**
  79. * check if the backend supports changing display names
  80. *
  81. * @return bool
  82. */
  83. public function canChangeDisplayName();
  84. /**
  85. * check if the user is enabled
  86. *
  87. * @return bool
  88. */
  89. public function isEnabled();
  90. /**
  91. * set the enabled status for the user
  92. *
  93. * @param bool $enabled
  94. */
  95. public function setEnabled($enabled);
  96. }