header.php 911 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. setlocale(LC_TIME, 'fr_FR');
  3. date_default_timezone_set(TIME_ZONE);
  4. require DIR_PHP_LIBS.'PHPMailer/Exception.php';
  5. require DIR_PHP_LIBS.'PHPMailer/PHPMailer.php';
  6. require DIR_PHP_LIBS.'PHPMailer/SMTP.php';
  7. use PHPMailer\PHPMailer\PHPMailer;
  8. use PHPMailer\PHPMailer\Exception;
  9. spl_autoload_register(function ($class_name) {
  10. (file_exists(DIR_PHP_CLASS.'/'.$class_name.'.class.php'))?
  11. require_once DIR_PHP_CLASS.'/'.$class_name.'.class.php' : '';
  12. });
  13. // Filtre les IP authorisés à accéder au site
  14. if(!is_null(WHITE_IP)){
  15. if(!in_array(htmlspecialchars(core::getUserIP()), WHITE_IP)){
  16. header("Location: /noAccess.php");
  17. exit();
  18. }
  19. }
  20. if(debug::isFile("debug")){
  21. error_reporting(E_ALL);
  22. ini_set("display_errors", 1);
  23. debug::startTimer();
  24. }
  25. if(debug::isFile("maintenance") AND $_SERVER['HTTP_HOST'] != DOMAIN_CMS){
  26. get::page("maintenance");
  27. exit();
  28. }