File: /homepages/18/d411704320/htdocs/sitedeproduction/indexTMP.php
<?php
/*
* 2007-2012 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2012 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/********************************************/
/********************************************/
/********* Début script redirection *********/
/********************************************/
/********************************************/
/** Code temporaire, à supprimer **/
/* avant de faire une MAJ Prestashop!!! */
/********************************************/
/********************************************/
//include('geoloc/geoipcity.inc');
//include('geoloc/geoipregionvars.php');
/**
* Récupérer la véritable adresse IP d'un visiteur
*/
function get_ip() {
// IP si internet partagé
if (isset($_SERVER['HTTP_CLIENT_IP'])) {
return $_SERVER['HTTP_CLIENT_IP'];
// echo $_SERVER['HTTP_CLIENT_IP'];
}
// IP derrière un proxy
elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
return $_SERVER['HTTP_X_FORWARDED_FOR'];
//echo $_SERVER['HTTP_X_FORWARDED_FOR'];
}
// Sinon : IP normale
else {
return (isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '');
// echo $_SERVER['REMOTE_ADDR'];
}
}
//Afficher l'adresse IP
//echo 'Adresse IP du visiteur : '.get_ip() . "\n";
//$getip = $_SERVER['REMOTE_ADDR'];
/*
$getip = get_ip();
$gi = geoip_open(realpath("geoloc/GeoLiteCity.dat"),GEOIP_STANDARD);
$record = geoip_record_by_addr($gi,$getip);
//echo $_SERVER['HTTP_HOST'];
if ($record->country_code == 'MA' || $record->country_code == 'US'){
if ($_SERVER['HTTP_HOST'] == 'misseuropeshopping.com'){
header('Location: http://ma.misseuropeshopping.com');
}
}
//else header('Location: http://www.google.co.uk');
geoip_close($gi);
*/
/********************************************/
/********** Fin script redirection **********/
/********************************************/
require(dirname(__FILE__).'/config/config.inc.php');
Dispatcher::getInstance()->dispatch();