// Keep the behavior of the 1.4 for displayMaintenancePage() (retro-compatibility)

This commit is contained in:
dMetzger committed 2012-05-19 10:25:43 +00:00
1 parent 02d44aab6a
commit 5325344720
1 file changed
+7 -5
+7 -5
View File
@@ -161,12 +161,11 @@ class FrontControllerCore extends Controller
if ($this->auth && !$this->context->customer->isLogged($this->guestAllowed)) if ($this->auth && !$this->context->customer->isLogged($this->guestAllowed))
Tools::redirect('index.php?controller=authentication'.($this->authRedirection ? '&back='.$this->authRedirection : '')); Tools::redirect('index.php?controller=authentication'.($this->authRedirection ? '&back='.$this->authRedirection : ''));
/* Theme is missing or maintenance */ /* Theme is missing */
if (!is_dir(_PS_THEME_DIR_)) if (!is_dir(_PS_THEME_DIR_))
die(sprintf(Tools::displayError('Current theme unavailable "%s". Please check your theme directory name and permissions.'), basename(rtrim(_PS_THEME_DIR_, '/\\')))); die(sprintf(Tools::displayError('Current theme unavailable "%s". Please check your theme directory name and permissions.'), basename(rtrim(_PS_THEME_DIR_, '/\\'))));
elseif (basename($_SERVER['PHP_SELF']) != 'disabled.php' && !(int)(Configuration::get('PS_SHOP_ENABLE')))
$this->maintenance = true; if (Configuration::get('PS_GEOLOCATION_ENABLED'))
elseif (Configuration::get('PS_GEOLOCATION_ENABLED'))
if (($newDefault = $this->geolocationManagement($this->context->country)) && Validate::isLoadedObject($newDefault)) if (($newDefault = $this->geolocationManagement($this->context->country)) && Validate::isLoadedObject($newDefault))
$this->context->country = $newDefault; $this->context->country = $newDefault;
@@ -375,7 +374,6 @@ class FrontControllerCore extends Controller
self::$link = $link; self::$link = $link;
$defaultCountry = $this->context->country; $defaultCountry = $this->context->country;
if ($this->maintenance)
$this->displayMaintenancePage(); $this->displayMaintenancePage();
if ($this->restrictedCountry) if ($this->restrictedCountry)
$this->displayRestrictedCountryPage(); $this->displayRestrictedCountryPage();
@@ -563,6 +561,9 @@ class FrontControllerCore extends Controller
/* Display a maintenance page if shop is closed */ /* Display a maintenance page if shop is closed */
protected function displayMaintenancePage() protected function displayMaintenancePage()
{ {
if ($this->maintenance == true || (basename($_SERVER['PHP_SELF']) != 'disabled.php' && !(int)(Configuration::get('PS_SHOP_ENABLE'))))
{
$this->maintenance = true;
if (!in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP')))) if (!in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP'))))
{ {
header('HTTP/1.1 503 temporarily overloaded'); header('HTTP/1.1 503 temporarily overloaded');
@@ -571,6 +572,7 @@ class FrontControllerCore extends Controller
exit; exit;
} }
} }
}
/* Display a specific page if the user country is not allowed */ /* Display a specific page if the user country is not allowed */
protected function displayRestrictedCountryPage() protected function displayRestrictedCountryPage()