diff --git a/main/install/install.lib.php b/main/install/install.lib.php index 3b06d6cf4e..efc20aec30 100755 --- a/main/install/install.lib.php +++ b/main/install/install.lib.php @@ -122,6 +122,22 @@ function checkPhpSettingExists($phpSetting) return false; } +/** + * Check if the current url is the same root_web when the multiple_access_url is enabled + * @return bool + */ +function checkAccessUrl() +{ + if (api_get_configuration_value('multiple_access_urls') !== true) { + return true; + } + + $currentWebPath = api_get_path(WEB_PATH); + $rootWeb = api_get_configuration_value('root_web'); + + return $currentWebPath === $rootWeb; +} + /** * Returns a textual value ('ON' or 'OFF') based on a requester 2-state ini- configuration setting. * @@ -689,6 +705,18 @@ function display_requirements( } echo ''; + $properlyAccessUrl = checkAccessUrl(); + + if (!$properlyAccessUrl) { + echo ' +
+ ' . Display::return_icon('error.png', get_lang('Error'), [], ICON_SIZE_MEDIUM) . + ' ' . + get_lang('InstallMultiURLDetectedNotMainURL') . ' +
+ '; + } + // SERVER REQUIREMENTS echo '

'.get_lang('ServerRequirements').'

'; @@ -1092,6 +1120,10 @@ function display_requirements(