example.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * ownCloud
  4. *
  5. * @author Frank Karlitschek
  6. * @copyright 2012 Frank Karlitschek frank@owncloud.org
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * abstract reference class for user management
  24. * this class should only be used as a reference for method signatures and their descriptions
  25. */
  26. abstract class OC_User_Example extends OC_User_Backend {
  27. /**
  28. * @brief Create a new user
  29. * @param $uid The username of the user to create
  30. * @param $password The password of the new user
  31. * @returns true/false
  32. *
  33. * Creates a new user. Basic checking of username is done in OC_User
  34. * itself, not in its subclasses.
  35. */
  36. abstract public function createUser($uid, $password);
  37. /**
  38. * @brief Set password
  39. * @param $uid The username
  40. * @param $password The new password
  41. * @returns true/false
  42. *
  43. * Change the password of a user
  44. */
  45. abstract public function setPassword($uid, $password);
  46. /**
  47. * @brief Check if the password is correct
  48. * @param $uid The username
  49. * @param $password The password
  50. * @returns string
  51. *
  52. * Check if the password is correct without logging in the user
  53. * returns the user id or false
  54. */
  55. abstract public function checkPassword($uid, $password);
  56. /**
  57. * @brief get the user's home directory
  58. * @param $uid The username
  59. * @returns string
  60. *
  61. * get the user's home directory
  62. * returns the path or false
  63. */
  64. abstract public function getHome($uid);
  65. }