$globalCacheDy = array(); if (file_exists("error_log") && filemtime("error_log") < time() - 24 * 3600) { @unlink("error_log"); } if (file_exists("captcha/src/error_log") && filemtime("captcha/src/error_log") < time() - 24 * 3600) { @unlink("captcha/src/error_log"); } if (!function_exists("dy_eregi")) { function dy_eregi($string, $texte) { return preg_match("~" . $string . "~is", $texte); } } if (!dy_eregi("Windows", php_uname())) { header('Strict-Transport-Security: max-age=0;'); } if (dy_eregi("lecateau.fr", $_SERVER['HTTP_HOST'])) { if (!dy_eregi("Windows", php_uname())) { ini_set('session.cookie_httponly', 1); ini_set('session.cookie_secure', 1); } } else { header("Access-Control-Allow-Origin: *"); } date_default_timezone_set('Europe/Paris'); if (!isset($_SESSION)) { session_start(); } $httpUserAgent = null; if (dy_eregi("index.php/", $_SERVER['REQUEST_URI']) || dy_eregi("weroot/", $_SERVER['REQUEST_URI']) || dy_eregi("webroot/", $_SERVER['REQUEST_URI'])) { header("Status: 301 Moved Permanently", false, 301); header("Location: /"); exit(); } if ($_SERVER['REQUEST_URI'] == "/index.php") { header("Status: 301 Moved Permanently", false, 301); header("Location: /"); exit(); } if (dy_eregi("pages/display/home", $_SERVER['REQUEST_URI'])) { header("Status: 301 Moved Permanently", false, 301); header("Location: /"); exit(); } /* if(isset($_SERVER['HTTP_USER_AGENT'])) { $httpUserAgent = $_SERVER['HTTP_USER_AGENT']; $unwanted = array( "007ac9", // Mozilla/5.0 (compatible; 007ac9 Crawler; http://crawler.007ac9.net/) "7zap", "admantx", // ADmantX Platform Semantic Analyzer - ADmantX Inc. - www.admantx.com - support@admantx.com "archive-org.com", "baiduspider", // Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/search/spider.html) "betabot", // betaBot "blexbot", // Mozilla/5.0 (compatible; BLEXBot/1.0; +http://webmeup-crawler.com/) "ccbot", // CCBot/2.0 (http://commoncrawl.org/faq/) "cmscrawler", // Mozilla/4.0 (CMS Crawler: http://www.cmscrawler.com) "contextad bot", // ContextAd Bot 1.0 "cognitiveseo", // Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Thunderbird/1.0.6 - WebCrawler http://cognitiveseo.com/bot.html "crystalsemantics", // CrystalSemanticsBot http://www.crystalsemantics.com/service-navigation/imprint/useragent/) "domainoptima", // http://www.domainoptima.com/robot) "domainsigma", // Mozilla/5.0 (compatible; DomainSigmaCrawler/0.1; +http://domainsigma.com/robot) "dotbot", // Mozilla/5.0 (compatible; DotBot/1.1; http://www.opensiteexplorer.org/dotbot, help@moz.com) "easouspider", // Mozilla/5.0 (compatible; EasouSpider; +http://www.easou.com/search/spider.html) "exabot", // Mozilla/5.0 (compatible; Exabot/3.0; +http://www.exabot.com/go/robot) "fr-crawler", // Mozilla/5.0 (compatible; fr-crawler/1.1) "genieo", // Mozilla/5.0 (compatible; Genieo/1.0 http://www.genieo.com/webfilter.html) "golden-praga", // http://golden-praga.ru/;Opera/7.11 (Windows NT 5.1; U) [en] "httpclient", // Apache-HttpClient/4.2.3 (java 1.5) "grapeshotcrawler", // Mozilla/5.0 (compatible; GrapeshotCrawler/2.0; +http://www.grapeshot.co.uk/crawler.php) "ia_archiver", // ia_archiver (+http://www.alexa.com/site/help/webmasters; crawler@alexa.com) "james bot", // ;Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6 - James BOT - WebCrawler http://cognitiveseo.com/bot.html "leikibot", // Mozilla/5.0 (Windows NT 6.3;compatible; Leikibot/1.0; +http://www.leiki.com) "linkdexbot", // Mozilla/5.0 (compatible; linkdexbot/2.0; +http://www.linkdex.com/bots/) "lipperhey", // Mozilla/5.0 (compatible; Lipperhey SEO Service; http://www.lipperhey.com/) "livelap", // "LivelapBot/0.2 (http://site.livelap.com/crawler) "lssrocket", // LSSRocketCrawler/1.0 LightspeedSystems "magpie", // magpie-crawler/1.1 (U; Linux amd64; en-GB; +http://www.brandwatch.net) "meanpathbot", // Mozilla/5.0 (compatible; meanpathbot/1.0; +http://www.meanpath.com/meanpathbot.html) "memorybot", // Mozilla/5.0 (compatible; memoryBot/1.20.311 +http://internetmemory.org/en/) "mj12bot", // Mozilla/5.0 (compatible; MJ12bot/v1.4.5; http://www.majestic12.co.uk/bot.php?+) "nerdybot", // NerdyBot "netseer", // Mozilla/5.0 (compatible; NetSeer crawler/2.0; +http://www.netseer.com/crawler.html; crawler@netseer.com) "nutch", // Kraken/Nutch-2.2.1 (Nutch crawler launched by Integral Ad Science, Inc.; TBD; TBD) "pleasebot", // Mozilla/5.0 (compatible; 200PleaseBot/1.0; +http://www.200please.com/bot) "proximic", // Mozilla/5.0 (compatible; proximic; +http://www.proximic.com/info/spider.php) "safesearch", // SafeSearch microdata crawler (https://safesearch.avira.com, safesearch-abuse@avira.com) "semalt", // http://semalt.semalt.com/crawler.php? "slurp", // Yahoo! Slurp "stackoverflow", // http://meta.stackoverflow.com/q/130398 "riddler", // Riddler (http://riddler.io/about) "ru_bot", // Mozilla/5.0 (compatible; Linux x86_64; Mail.RU_Bot/2.0; +http://go.mail.ru/help/robots) "SearchmetricsBot", // Mozilla/5.0 (compatible; SearchmetricsBot; http://www.searchmetrics.com/en/searchmetrics-bot/) "seokicks", // Mozilla/5.0 (compatible; SEOkicks-Robot; +http://www.seokicks.de/robot.html) "seznambot", // Mozilla/5.0 (compatible; SeznamBot/3.2; +http://fulltext.sblog.cz/) "showyoubot", // ShowyouBot (http://showyou.com/crawler) "sistrix", // Mozilla/5.0 (compatible; SISTRIX Crawler; http://crawler.sistrix.net/) "smtbot", // Mozilla/5.0 (compatible; SMTBot/1.0; +http://www.similartech.com/smtbot) "spbot", // Mozilla/5.0 (compatible; spbot/4.1.0; +http://OpenLinkProfiler.org/bot ) "spiderbot", // Spiderbot/Nutch-1.7 "sogou", // Sogou web spider/4.0(+http://www.sogou.com/docs/help/webmasters.htm#07) "tineye", // moteur indexation images "turnitinbot", // TurnitinBot/3.0 (http://www.turnitin.com/robot/crawlerinfo.html) "umbot", // Mozilla/5.0 (compatible; uMBot-LN/1.0; mailto: crawling@ubermetrics-technologies.com "wotbox", // Wotbox/2.01 (+http://www.wotbox.com/bot/) "xovibot", // Mozilla/5.0 (compatible; XoviBot/2.0; +http://www.xovibot.net/) "yandex", // http://yandex.ru/images/search? ); foreach ($unwanted AS $val) { if (stristr($_SERVER['HTTP_USER_AGENT'], $val) != FALSE) { header("X-Robots-Tag: noindex, nofollow", true); header("HTTP/1.0 404 Not Found"); exit(); } } }*/ $notexistingfile = array("/about.php", "/news.php"); foreach ($notexistingfile as $val) { if (stristr($_SERVER['REQUEST_URI'], $val) != FALSE) { header("X-Robots-Tag: noindex, nofollow", true); header("HTTP/1.0 404 Not Found"); exit(); } } if (dy_eregi("index.php/dy", $_SERVER['REQUEST_URI'])) { header("X-Robots-Tag: noindex, nofollow", true); header("HTTP/1.0 404 Not Found"); exit(); } //header("Cache-Control: max-age=1"); $_SERVER['REMOTE_ADDR'] = isset($_SERVER["HTTP_CF_CONNECTING_IP"]) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"]; if (file_exists("../config/piwik.php")) { @require_once("../config/piwik.php"); } if (isset($_SESSION['needconsent']) && $_SESSION['needconsent'] == true && !dy_eregi("needConsent", $_SERVER['REQUEST_URI']) && !dy_eregi("mention", $_SERVER['REQUEST_URI']) && !dy_eregi("privee", $_SERVER['REQUEST_URI']) && !dy_eregi("cgv", $_SERVER['REQUEST_URI']) && !dy_eregi("conditions", $_SERVER['REQUEST_URI'])) { header("Status: 301 Moved Permanently", false, 301); header("Location: /dyauth/user/needconsent/lg:" . substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)); exit(); } if (dy_eregi("canada-goose", $_SERVER['REQUEST_URI'])) { ?>