InterfaceUserAuth.php 833 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace Plugins\UserAuth;
  3. require '../vendor/autoload.php';
  4. /**
  5. * This interface provides the neccessary functions for
  6. * a user authentication backend.
  7. */
  8. interface InterfaceUserAuth
  9. {
  10. /**
  11. * Construct the object
  12. *
  13. * @param $logger Monolog logger instance for error handling
  14. * @param $db Database connection
  15. * @param $config The configuration for the Plugin if any was provided
  16. */
  17. public function __construct(\Monolog\Logger $logger, \PDO $db, array $config = null);
  18. /**
  19. * Authenticate user.
  20. *
  21. * @param $username The username for authentication
  22. * @param $password The password for authentication
  23. *
  24. * @return true if valid false otherwise
  25. */
  26. public function authenticate(string $username, string $password) : bool;
  27. }