"OdenseTrack" is a school assignment/project from AspIT https://aspit.dfine.net/odensetrack
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. mb_internal_encoding("utf-8"); // Internal encoding set to UTF-8, should fix some charset issues.
  3. session_start(); // Start PHP session, so we can handle session-data on all pages.
  4. require_once("include.php"); // Our includes.
  5. /*
  6. * Check if user is logged in. If not, show login page.
  7. if (User::checkLogin() != true) {
  8. header("Location: login.php");
  9. }
  10. */
  11. if (isset($_GET['page'])) { // Figure out what page needs to be displayed
  12. $page = $_GET['page'];
  13. } else { // If nothing is defined, lets assume we have to display the frontpage/index
  14. header('Location: ' . Config::$sys_url .'?page=home');
  15. //$page = "home"; // Setting page to home.php - Note: This is possible, but we would rather want to redirect to the home instead - For searchengines you know..
  16. }
  17. /* Sidenote: Its important to specify the dir content, as we dont want people to be able to just ../ to another dir. */
  18. if (IS_FILE("content/" . $page . ".php")) { // Check if the file exists, if yes lets show it - If not, lets show our 404
  19. include 'content/' . $page . '.php';
  20. } else {
  21. include 'content/error.php';
  22. }
  23. /*
  24. * Perform LOG procedure to all page calls, unless debug mode is enabled.
  25. if (Config::$debug == false) {
  26. Log::writeLog("1", $_SESSION['user'], "Visited page $page");
  27. }
  28. */