ob_start(); session_set_cookie_params(0,"/",".granitpartner.de"); session_start(); #error_reporting(E_ERROR); header('Content-Type: text/html; charset=ISO-8859-1'); /*if(empty($_SERVER['HTTPS'])) { if($_SERVER['HTTP_HOST']!="localhost") { header("Location: http://".$_SERVER['HTTP_HOST'].($_SERVER['REQUEST_URI'] ? $_SERVER['REQUEST_URI'] : '')); header("Connection: close"); exit; } }*/ #$wartungsmodus = "17:00 CET/MEZ"; // Standard festlegen if(!isset($_GET['seite'])) $_GET['seite'] = "/"; if(!isset($_GET['ordner'])) $_GET['ordner'] = ""; // 404 if($_GET['seite']=="404") { header("HTTP/1.1 404 Not Found"); } if($_SERVER['HTTP_HOST']=="localhost" || strpos($_SERVER['HTTP_HOST'],"192.168.178")!==false) $_SERVER['DOCUMENT_ROOT'] = $_SERVER['DOCUMENT_ROOT']."/fricke-micro.de"; // Configdaten require_once $_SERVER['DOCUMENT_ROOT']."/scripts/config.php"; // Autoload function __autoload($class_name) { require_once $_SERVER['DOCUMENT_ROOT']."/classes/".$class_name.".php"; } // Templateklasse laden $template = new Template($_GET['seite']); $template->lang = (!empty($_SESSION['kunde']['lang']) ? $_SESSION['kunde']['lang'] : "DE"); // CSS f�r IE if(strpos($_SERVER['HTTP_USER_AGENT'],"MSIE")!==false) $template->putCSS('seite/ie/layout'); // Header und Footertemplate laden $headertemplate = $template->load((isset($_SESSION['kunde']['template']) ? $_SESSION['kunde']['template'] : "standard")."/header"); $footertemplate = $template->load((isset($_SESSION['kunde']['template']) ? $_SESSION['kunde']['template'] : "standard")."/footer"); $maintemplate = $template->load((isset($_SESSION['kunde']['template']) ? $_SESSION['kunde']['template'] : "standard")."/".($_GET['ordner'] ? $_GET['ordner'].'/' : '').$_GET['seite']); $template->putMeta(''); // Inhalt includen if(file_exists($_SERVER['DOCUMENT_ROOT']."/includes/".($_GET['ordner'] ? $_GET['ordner']."/" : "").$_GET['seite'].".php")) require_once $_SERVER['DOCUMENT_ROOT']."/includes/".($_GET['ordner'] ? $_GET['ordner']."/" : "").$_GET['seite'].".php"; else require_once $_SERVER['DOCUMENT_ROOT']."/includes/index.php"; if(!$_SESSION['kunde']['online']) { header("HTTP/1.0 404 Not Found"); $headertemplate = $template->load("header404"); $maintemplate = $template->load("index404"); $footertemplate = $template->load("footer404"); function IPtoCountry($ip) { $sock = fsockopen("whois.ripe.net", 43); fwrite($sock, $ip."\n"); while (!feof($sock)) { $info .= fgetc($sock); } fclose($sock); preg_match("/country:[ ]+([A-Z]{2})\n/", $info, $match); return $match[1]; } switch(IPtoCountry($_SERVER['REMOTE_ADDR'])) { case "BE": header('Location: https://www.granit-parts.be/registration'); exit; die(); break; case "DK": header('Location: https://www.granit-parts.dk/registration'); exit; die(); break; case "FR": header('Location: https://www.granit-parts.fr/registration'); exit; die(); break; case "NL": header('Location: https://www.granit-parts.nl/registration'); exit; die(); break; case "AT": header('Location: https://www.granit-parts.at/registration'); exit; die(); break; case "SE": header('Location: https://www.granit-parts.se/registration'); exit; die(); break; case "CH": header('Location: https://www.granit-parts.ch/registration'); exit; die(); break; case "ES": header('Location: https://www.granit-parts.es/registration'); exit; die(); break; default: header('Location: https://www.granit-parts.com/registration'); exit; die(); break; } } #print_r($_GET); #print_r($_SESSION); #die(); /*if((isset($_SESSION['user']))&&(!$wartungsmodus)) { if($_SESSION['user']['kunde_id']!=$_SESSION['kunde']['id']) { $_SESSION['user'] = array(); $_SESSION['kunde'] = array(); //header("Location: "._ROOT."/admin/"); } $maintemplate = $template->load("adminmaske").'