login.php 613B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. require_once(dirname(__DIR__)."/controllers/data.php");
  3. require_once(dirname(__DIR__)."/models/data.class.php");
  4. require_once(dirname(__DIR__)."/../DbIds.php");
  5. function getAdminIdentifiers()
  6. {
  7. return ["toto", "tata"];
  8. }
  9. function login()
  10. {
  11. set("title", "Login");
  12. return html("login.html.php", "layout.html.php");
  13. }
  14. function check_login()
  15. {
  16. $identifiers = getAdminIdentifiers();
  17. if($_POST["login"] != $identifiers[0] || $_POST["password"] != $identifiers[1])
  18. return login();
  19. set("title", "Home");
  20. return html("home.html.php", "layout.html.php");
  21. }