index.php

  1. 6.x index.php
  2. 4.x index.php
  3. 5.x index.php

The primary entry point for FlightPath.

This script will determine which page the user is trying to view, and display it for them.

File

index.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * The primary entry point for FlightPath.
  5. *
  6. * This script will determine which page the user is trying to view,
  7. * and display it for them.
  8. */
  9. /**
  10. * This function makes sure we auto-load our classes, if we need to.
  11. * Largely used when loading objects our of our SESSION cache.
  12. */
  13. function __autoload($class) {
  14. // Load all of the classes, as well as the custom classes.
  15. require_once("classes/all_classes.php");
  16. }
  17. // Make sure our cookies are the most secure possible:
  18. ini_set('session.cookie_httponly', 'On');
  19. if( (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443 ){
  20. //enable secure cookies, since we are on HTTPS.
  21. ini_set('session.cookie_secure', 'On');
  22. }
  23. // Should we init the session using a specific session_id?
  24. if (@$_GET['fp_session_id'] != '') {
  25. session_id($_GET['fp_session_id']);
  26. }
  27. session_start();
  28. // Set headers for maximum security
  29. header("Cache-control: no-cache, no-store, must-revalidate"); // HTTP 1.1
  30. header("Pragma: no-cache"); // HTTP 1.0
  31. header("X-XSS-Protection: 1");
  32. header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past, to ensure it expires when we close browser.
  33. header('X-Frame-Options: SAMEORIGIN'); // No iframes except from the same website origins.
  34. // If the user is requesting a "clean URLs" check, display a simple success message.
  35. if (isset($_REQUEST["q"]) && $_REQUEST["q"] == "test-clean-urls/check") {
  36. print "CLEAN URLS CHECK SUCCESSFUL";
  37. die;
  38. }
  39. // If the settings.php file doesn't exist, then FlightPath must not be installed,
  40. // and we should redirect to install.php.
  41. if (!file_exists("custom/settings.php")) {
  42. header ("Location: install.php");
  43. die;
  44. }
  45. require_once("bootstrap.inc");
  46. // For development reasons only:
  47. // To rebuild the cache on every page load, uncomment the following line
  48. // menu_rebuild_cache();
  49. // FlightPath will now look at the request in the query to decide what page we are going to display.
  50. $page = menu_execute_page_request();
  51. if (!is_int($page)) {
  52. // Display the page!
  53. fp_display_page($page);
  54. }
  55. else {
  56. if ($page == MENU_NOT_FOUND) {
  57. display_not_found();
  58. }
  59. else if ($page == MENU_ACCESS_DENIED) {
  60. display_access_denied();
  61. }
  62. }
  63. // Call hook_exit as we leave the page.
  64. invoke_hook("exit");

Functions

Namesort descending Description
__autoload This function makes sure we auto-load our classes, if we need to. Largely used when loading objects our of our SESSION cache.