AuthAdapter.class.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * The Staple_AuthAdapter interface creates a preset list of functions that must be implemented
  4. * to allow authentication to pass through Staple_Auth. Adapters sent to Staple_Auth must
  5. * implement this class or an error will occur.
  6. *
  7. * @author Ironpilot
  8. * @copyright Copywrite (c) 2011, STAPLE CODE
  9. *
  10. * This file is part of the STAPLE Framework.
  11. *
  12. * The STAPLE Framework is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Lesser General Public License as published by the
  14. * Free Software Foundation, either version 3 of the License, or (at your option)
  15. * any later version.
  16. *
  17. * The STAPLE Framework is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  19. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
  20. * more details.
  21. *
  22. * You should have received a copy of the GNU Lesser General Public License
  23. * along with the STAPLE Framework. If not, see <http://www.gnu.org/licenses/>.
  24. *
  25. */
  26. interface Staple_AuthAdapter
  27. {
  28. /**
  29. * This function must be implemented to check the authorization based on the adapter
  30. * at hand. The function must return a boolean true for the Staple_Auth object to view
  31. * authentication as successful. If a non-boolean true is returned, authentication will
  32. * fail.
  33. * @return bool
  34. */
  35. public function getAuth($credentials);
  36. /**
  37. *
  38. * This function must be implemented to return a numeric level of access. This level is
  39. * used to determine feature access based on account type.
  40. * @return int
  41. */
  42. public function getLevel($uid);
  43. /**
  44. * Returns the userid from the adapater
  45. * @return string
  46. */
  47. public function getUserId();
  48. }
  49. ?>