[ticket/12623] Add allow_install_dir

PHPBB3-12623
This commit is contained in:
Rubén Calvo 2018-09-01 01:09:22 +02:00
parent 1c406c70e0
commit 5dd9c251e7
4 changed files with 6 additions and 2 deletions

View file

@ -3,6 +3,7 @@ imports:
core: core:
require_dev_dependencies: true require_dev_dependencies: true
allow_install_dir: true
debug: debug:
exceptions: true exceptions: true

View file

@ -31,6 +31,7 @@ class container_configuration implements ConfigurationInterface
$rootNode $rootNode
->children() ->children()
->booleanNode('require_dev_dependencies')->defaultValue(false)->end() ->booleanNode('require_dev_dependencies')->defaultValue(false)->end()
->booleanNode('allow_install_dir')->defaultValue(false)->end()
->arrayNode('debug') ->arrayNode('debug')
->addDefaultsIfNotSet() ->addDefaultsIfNotSet()
->children() ->children()

View file

@ -72,6 +72,8 @@ class core extends Extension
} }
} }
$container->setParameter('allow_install_dir', $config['allow_install_dir']);
// Set the Twig options if defined in the environment // Set the Twig options if defined in the environment
$definition = $container->getDefinition('template.twig.environment'); $definition = $container->getDefinition('template.twig.environment');
$twig_environment_options = $definition->getArgument(static::TWIG_OPTIONS_POSITION); $twig_environment_options = $definition->getArgument(static::TWIG_OPTIONS_POSITION);

View file

@ -110,7 +110,7 @@ class user extends \phpbb\session
function setup($lang_set = false, $style_id = false) function setup($lang_set = false, $style_id = false)
{ {
global $db, $request, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache; global $db, $request, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
global $phpbb_dispatcher; global $phpbb_dispatcher, $phpbb_container;
$this->language->set_default_language($config['default_lang']); $this->language->set_default_language($config['default_lang']);
@ -325,7 +325,7 @@ class user extends \phpbb\session
// Disable board if the install/ directory is still present // Disable board if the install/ directory is still present
// For the brave development army we do not care about this, else we need to comment out this every time we develop locally // For the brave development army we do not care about this, else we need to comment out this every time we develop locally
if (!defined('DEBUG') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install')) if (!$phpbb_container->getParameter('allow_install_dir') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
{ {
// Adjust the message slightly according to the permissions // Adjust the message slightly according to the permissions
if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))