aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/config/installer/container/services_install_console.yml29
-rw-r--r--phpBB/docs/events.md42
-rw-r--r--phpBB/docs/update-config.sample.yml2
-rw-r--r--phpBB/includes/functions_content.php28
-rw-r--r--phpBB/includes/functions_messenger.php12
-rw-r--r--phpBB/includes/functions_posting.php26
-rwxr-xr-xphpBB/install/phpbbcli.php3
-rw-r--r--phpBB/language/en/install.php4
-rw-r--r--phpBB/phpbb/install/console/command/install/config/show.php12
-rw-r--r--phpBB/phpbb/install/console/command/install/config/validate.php10
-rw-r--r--phpBB/phpbb/install/console/command/install/install.php2
-rw-r--r--phpBB/phpbb/install/console/command/update/config/show.php123
-rw-r--r--phpBB/phpbb/install/console/command/update/config/validate.php124
-rw-r--r--phpBB/phpbb/install/console/command/update/update.php179
-rw-r--r--phpBB/phpbb/install/module/obtain_data/task/obtain_update_settings.php8
-rw-r--r--phpBB/phpbb/install/module/requirements/task/check_update.php2
-rw-r--r--phpBB/phpbb/install/updater_configuration.php40
-rw-r--r--phpBB/phpbb/notification/method/messenger_base.php2
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html6
19 files changed, 622 insertions, 32 deletions
diff --git a/phpBB/config/installer/container/services_install_console.yml b/phpBB/config/installer/container/services_install_console.yml
index 73c804d9ff..41d3aa4c1b 100644
--- a/phpBB/config/installer/container/services_install_console.yml
+++ b/phpBB/config/installer/container/services_install_console.yml
@@ -21,7 +21,6 @@ services:
arguments:
- '@language'
- '@installer.helper.iohandler_factory'
- - '@installer.installer.install'
tags:
- { name: console.installer.command }
@@ -31,6 +30,32 @@ services:
arguments:
- '@language'
- '@installer.helper.iohandler_factory'
- - '@installer.installer.install'
+ tags:
+ - { name: console.installer.command }
+
+ console.updater.command.update:
+ class: phpbb\install\console\command\update\update
+ arguments:
+ - '@language'
+ - '@installer.helper.iohandler_factory'
+ - '@installer.installer.update'
+ - '@installer.helper.install_helper'
+ tags:
+ - { name: console.installer.command }
+
+ console.updater.command.config.show:
+ class: phpbb\install\console\command\update\config\show
+ arguments:
+ - '@language'
+ - '@installer.helper.iohandler_factory'
+ tags:
+ - { name: console.installer.command }
+
+
+ console.updater.command.config.validate:
+ class: phpbb\install\console\command\update\config\validate
+ arguments:
+ - '@language'
+ - '@installer.helper.iohandler_factory'
tags:
- { name: console.installer.command }
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
index acc876ea96..410ae2ad7d 100644
--- a/phpBB/docs/events.md
+++ b/phpBB/docs/events.md
@@ -937,6 +937,20 @@ memberlist_view_contact_before
* Since: 3.1.0-b2
* Purpose: Add content before the user contact part of any user profile
+memberlist_view_contact_custom_fields_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content after the user contact related custom fields
+
+memberlist_view_contact_custom_fields_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content before the user contact related custom fields
+
memberlist_view_content_append
===
* Locations:
@@ -951,6 +965,20 @@ memberlist_view_content_prepend
* Since: 3.1.0-b3
* Purpose: Add custom content to the user profile view before the main content
+memberlist_view_non_contact_custom_fields_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content after the user not contact related custom fields
+
+memberlist_view_non_contact_custom_fields_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content before the user not contact related custom fields
+
memberlist_view_rank_avatar_after
===
* Locations:
@@ -993,6 +1021,20 @@ memberlist_view_user_statistics_before
* Since: 3.1.0-a1
* Purpose: Add entries before the user statistics part of any user profile
+memberlist_view_zebra_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content after the user friends/foes links
+
+memberlist_view_zebra_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_view.html
+* Since: 3.1.9-RC1
+* Purpose: Add content before the user friends/foes links
+
navbar_header_logged_out_content
===
* Locations:
diff --git a/phpBB/docs/update-config.sample.yml b/phpBB/docs/update-config.sample.yml
new file mode 100644
index 0000000000..f3b52a8c01
--- /dev/null
+++ b/phpBB/docs/update-config.sample.yml
@@ -0,0 +1,2 @@
+updater:
+ type: all
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index dda752c6ca..39a3f0352f 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -434,7 +434,20 @@ function phpbb_clean_search_string($search_string)
*/
function decode_message(&$message, $bbcode_uid = '')
{
- global $phpbb_container;
+ global $phpbb_container, $phpbb_dispatcher;
+
+ /**
+ * Use this event to modify the message before it is decoded
+ *
+ * @event core.decode_message_before
+ * @var string message_text The message content
+ * @var string bbcode_uid The message BBCode UID
+ * @since 3.1.9-RC1
+ */
+ $message_text = $message;
+ $vars = array('message_text', 'bbcode_uid');
+ extract($phpbb_dispatcher->trigger_event('core.decode_message_before', compact($vars)));
+ $message = $message_text;
if (preg_match('#^<[rt][ >]#', $message))
{
@@ -460,6 +473,19 @@ function decode_message(&$message, $bbcode_uid = '')
$message = preg_replace($match, $replace, $message);
}
+
+ /**
+ * Use this event to modify the message after it is decoded
+ *
+ * @event core.decode_message_after
+ * @var string message_text The message content
+ * @var string bbcode_uid The message BBCode UID
+ * @since 3.1.9-RC1
+ */
+ $message_text = $message;
+ $vars = array('message_text', 'bbcode_uid');
+ extract($phpbb_dispatcher->trigger_event('core.decode_message_after', compact($vars)));
+ $message = $message_text;
}
/**
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 7ed9a772ec..e8d4e0d7f1 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -204,10 +204,12 @@ class messenger
/**
* Set email template to use
*/
- function template($template_file, $template_lang = '', $template_path = '')
+ function template($template_file, $template_lang = '', $template_path = '', $template_dir_prefix = '')
{
global $config, $phpbb_root_path, $user;
+ $template_dir_prefix = (!$template_dir_prefix || $template_dir_prefix[0] === '/') ? $template_dir_prefix : '/' . $template_dir_prefix;
+
$this->setup_template();
if (!trim($template_file))
@@ -226,7 +228,7 @@ class messenger
if ($template_path)
{
$template_paths = array(
- $template_path,
+ $template_path . $template_dir_prefix,
);
}
else
@@ -235,7 +237,7 @@ class messenger
$template_path .= $template_lang . '/email';
$template_paths = array(
- $template_path,
+ $template_path . $template_dir_prefix,
);
// we can only specify default language fallback when the path is not a custom one for which we
@@ -245,14 +247,14 @@ class messenger
$fallback_template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
$fallback_template_path .= basename($config['default_lang']) . '/email';
- $template_paths[] = $fallback_template_path;
+ $template_paths[] = $fallback_template_path . $template_dir_prefix;
}
}
$this->set_template_paths(array(
array(
'name' => $template_lang . '_email',
- 'ext_path' => 'language/' . $template_lang . '/email'
+ 'ext_path' => 'language/' . $template_lang . '/email' . $template_dir_prefix,
),
), $template_paths);
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 56d2408e88..58753122cc 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -977,6 +977,32 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
$db->sql_freeresult($result);
}
+ /**
+ * Event to modify the posts list for topic reviews
+ *
+ * @event core.topic_review_modify_post_list
+ * @var array attachments Array with the post attachments data
+ * @var int cur_post_id Post offset ID
+ * @var int forum_id The topic's forum ID
+ * @var string mode The topic review mode
+ * @var array post_list Array with the post IDs
+ * @var array rowset Array with the posts data
+ * @var bool show_quote_button Flag indicating if the quote button should be displayed
+ * @var int topic_id The topic ID that is being reviewed
+ * @since 3.1.9-RC1
+ */
+ $vars = array(
+ 'attachments',
+ 'cur_post_id',
+ 'forum_id',
+ 'mode',
+ 'post_list',
+ 'rowset',
+ 'show_quote_button',
+ 'topic_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.topic_review_modify_post_list', compact($vars)));
+
for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
{
// A non-existing rowset only happens if there was no user present for the entered poster_id
diff --git a/phpBB/install/phpbbcli.php b/phpBB/install/phpbbcli.php
index 70a8a9c7ea..6b0ac39f84 100755
--- a/phpBB/install/phpbbcli.php
+++ b/phpBB/install/phpbbcli.php
@@ -36,6 +36,9 @@ require($startup_path);
$input = new ArgvInput();
+// Enable superglobals for cli support
+$phpbb_installer_container->get('request')->enable_super_globals();
+
/** @var \phpbb\filesystem\filesystem $phpbb_filesystem */
$phpbb_filesystem = $phpbb_installer_container->get('filesystem');
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index 31578824ef..ba35aa24c9 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -121,8 +121,6 @@ $lang = array_merge($lang, array(
$lang = array_merge($lang, array(
'INST_ERR_MISSING_DATA' => 'You must fill out all fields in this block.',
- 'PHPBB_ALREADY_INSTALLED' => 'phpBB is already installed.',
-
'TIMEOUT_DETECTED_TITLE' => 'The installer detected a timeout',
'TIMEOUT_DETECTED_MESSAGE' => 'The installer has detected a timeout, you may try to refresh the page, which may lead to data corruption. We suggest that you either increase your timeout settings or try to use the CLI.',
));
@@ -319,12 +317,14 @@ $lang = array_merge($lang, array(
// CLI messages
$lang = array_merge($lang, array(
'CLI_INSTALL_BOARD' => 'Install phpBB',
+ 'CLI_UPDATE_BOARD' => 'Update phpBB',
'CLI_INSTALL_SHOW_CONFIG' => 'Show the configuration which will be used',
'CLI_INSTALL_VALIDATE_CONFIG' => 'Validate a configuration file',
'CLI_CONFIG_FILE' => 'Config file to use',
'MISSING_FILE' => 'Unable to access file %1$s',
'MISSING_DATA' => 'Config file is missing data or might contain invalid settings.',
'INVALID_YAML_FILE' => 'Could not parse YAML file %1$s',
+ 'CONFIGURATION_VALID' => 'The configuration file is valid',
));
// Common updater messages
diff --git a/phpBB/phpbb/install/console/command/install/config/show.php b/phpBB/phpbb/install/console/command/install/config/show.php
index 5d82d8d1ef..b6c11956fe 100644
--- a/phpBB/phpbb/install/console/command/install/config/show.php
+++ b/phpBB/phpbb/install/console/command/install/config/show.php
@@ -14,7 +14,6 @@
namespace phpbb\install\console\command\install\config;
use phpbb\install\helper\iohandler\factory;
-use phpbb\install\installer;
use phpbb\install\installer_configuration;
use phpbb\language\language;
use Symfony\Component\Config\Definition\Exception\Exception;
@@ -34,11 +33,6 @@ class show extends \phpbb\console\command\command
protected $iohandler_factory;
/**
- * @var installer
- */
- protected $installer;
-
- /**
* @var language
*/
protected $language;
@@ -48,12 +42,10 @@ class show extends \phpbb\console\command\command
*
* @param language $language
* @param factory $factory
- * @param installer $installer
*/
- public function __construct(language $language, factory $factory, installer $installer)
+ public function __construct(language $language, factory $factory)
{
$this->iohandler_factory = $factory;
- $this->installer = $installer;
$this->language = $language;
parent::__construct(new \phpbb\user($language, 'datetime'));
@@ -126,6 +118,6 @@ class show extends \phpbb\console\command\command
return;
}
- $iohandler->add_log_message(Yaml::dump(array('installer' => $config), 10, 4, true, false));
+ $style->block(Yaml::dump(array('installer' => $config), 10, 4, true, false));
}
}
diff --git a/phpBB/phpbb/install/console/command/install/config/validate.php b/phpBB/phpbb/install/console/command/install/config/validate.php
index 3bbbc23e34..b48a1acbd4 100644
--- a/phpBB/phpbb/install/console/command/install/config/validate.php
+++ b/phpBB/phpbb/install/console/command/install/config/validate.php
@@ -14,7 +14,6 @@
namespace phpbb\install\console\command\install\config;
use phpbb\install\helper\iohandler\factory;
-use phpbb\install\installer;
use phpbb\install\installer_configuration;
use phpbb\language\language;
use Symfony\Component\Config\Definition\Exception\Exception;
@@ -34,11 +33,6 @@ class validate extends \phpbb\console\command\command
protected $iohandler_factory;
/**
- * @var installer
- */
- protected $installer;
-
- /**
* @var language
*/
protected $language;
@@ -48,12 +42,10 @@ class validate extends \phpbb\console\command\command
*
* @param language $language
* @param factory $factory
- * @param installer $installer
*/
- public function __construct(language $language, factory $factory, installer $installer)
+ public function __construct(language $language, factory $factory)
{
$this->iohandler_factory = $factory;
- $this->installer = $installer;
$this->language = $language;
parent::__construct(new \phpbb\user($language, 'datetime'));
diff --git a/phpBB/phpbb/install/console/command/install/install.php b/phpBB/phpbb/install/console/command/install/install.php
index d76182af92..50c23f6877 100644
--- a/phpBB/phpbb/install/console/command/install/install.php
+++ b/phpBB/phpbb/install/console/command/install/install.php
@@ -109,7 +109,7 @@ class install extends \phpbb\console\command\command
if ($this->install_helper->is_phpbb_installed())
{
- $iohandler->add_error_message('PHPBB_ALREADY_INSTALLED');
+ $iohandler->add_error_message('INSTALL_PHPBB_INSTALLED');
return 1;
}
diff --git a/phpBB/phpbb/install/console/command/update/config/show.php b/phpBB/phpbb/install/console/command/update/config/show.php
new file mode 100644
index 0000000000..e462763b5d
--- /dev/null
+++ b/phpBB/phpbb/install/console/command/update/config/show.php
@@ -0,0 +1,123 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\install\console\command\update\config;
+
+use phpbb\install\helper\iohandler\factory;
+use phpbb\install\updater_configuration;
+use phpbb\language\language;
+use Symfony\Component\Config\Definition\Exception\Exception;
+use Symfony\Component\Config\Definition\Processor;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\Yaml\Exception\ParseException;
+use Symfony\Component\Yaml\Yaml;
+
+class show extends \phpbb\console\command\command
+{
+ /**
+ * @var factory
+ */
+ protected $iohandler_factory;
+
+ /**
+ * @var language
+ */
+ protected $language;
+
+ /**
+ * Constructor
+ *
+ * @param language $language
+ * @param factory $factory
+ */
+ public function __construct(language $language, factory $factory)
+ {
+ $this->iohandler_factory = $factory;
+ $this->language = $language;
+
+ parent::__construct(new \phpbb\user($language, 'datetime'));
+ }
+
+ /**
+ *
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('update:config:show')
+ ->addArgument(
+ 'config-file',
+ InputArgument::REQUIRED,
+ $this->language->lang('CLI_CONFIG_FILE'))
+ ->setDescription($this->language->lang('CLI_INSTALL_SHOW_CONFIG'))
+ ;
+ }
+
+ /**
+ * Show the validated configuration
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return null
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->iohandler_factory->set_environment('cli');
+
+ /** @var \phpbb\install\helper\iohandler\cli_iohandler $iohandler */
+ $iohandler = $this->iohandler_factory->get();
+ $style = new SymfonyStyle($input, $output);
+ $iohandler->set_style($style, $output);
+
+ $config_file = $input->getArgument('config-file');
+
+ if (!is_file($config_file))
+ {
+ $iohandler->add_error_message(array('MISSING_FILE', $config_file));
+
+ return;
+ }
+
+ try
+ {
+ $config = Yaml::parse(file_get_contents($config_file), true, false);
+ }
+ catch (ParseException $e)
+ {
+ $iohandler->add_error_message('INVALID_YAML_FILE');
+
+ return;
+ }
+
+ $processor = new Processor();
+ $configuration = new updater_configuration();
+
+ try
+ {
+ $config = $processor->processConfiguration($configuration, $config);
+ }
+ catch (Exception $e)
+ {
+ $iohandler->add_error_message('INVALID_CONFIGURATION', $e->getMessage());
+
+ return;
+ }
+
+ $style->block(Yaml::dump(array('updater' => $config), 10, 4, true, false));
+ }
+}
diff --git a/phpBB/phpbb/install/console/command/update/config/validate.php b/phpBB/phpbb/install/console/command/update/config/validate.php
new file mode 100644
index 0000000000..18de5eab46
--- /dev/null
+++ b/phpBB/phpbb/install/console/command/update/config/validate.php
@@ -0,0 +1,124 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\install\console\command\update\config;
+
+use phpbb\install\helper\iohandler\factory;
+use phpbb\install\updater_configuration;
+use phpbb\language\language;
+use Symfony\Component\Config\Definition\Exception\Exception;
+use Symfony\Component\Config\Definition\Processor;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\Yaml\Exception\ParseException;
+use Symfony\Component\Yaml\Yaml;
+
+class validate extends \phpbb\console\command\command
+{
+ /**
+ * @var factory
+ */
+ protected $iohandler_factory;
+
+ /**
+ * @var language
+ */
+ protected $language;
+
+ /**
+ * Constructor
+ *
+ * @param language $language
+ * @param factory $factory
+ */
+ public function __construct(language $language, factory $factory)
+ {
+ $this->iohandler_factory = $factory;
+ $this->language = $language;
+
+ parent::__construct(new \phpbb\user($language, 'datetime'));
+ }
+
+ /**
+ *
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('update:config:validate')
+ ->addArgument(
+ 'config-file',
+ InputArgument::REQUIRED,
+ $this->language->lang('CLI_CONFIG_FILE'))
+ ->setDescription($this->language->lang('CLI_INSTALL_VALIDATE_CONFIG'))
+ ;
+ }
+
+ /**
+ * Validate the configuration file
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return null
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->iohandler_factory->set_environment('cli');
+
+ /** @var \phpbb\install\helper\iohandler\cli_iohandler $iohandler */
+ $iohandler = $this->iohandler_factory->get();
+ $style = new SymfonyStyle($input, $output);
+ $iohandler->set_style($style, $output);
+
+ $config_file = $input->getArgument('config-file');
+
+ if (!is_file($config_file))
+ {
+ $iohandler->add_error_message(array('MISSING_FILE', array($config_file)));
+
+ return 1;
+ }
+
+ try
+ {
+ $config = Yaml::parse(file_get_contents($config_file), true, false);
+ }
+ catch (ParseException $e)
+ {
+ $iohandler->add_error_message('INVALID_YAML_FILE');
+
+ return 1;
+ }
+
+ $processor = new Processor();
+ $configuration = new updater_configuration();
+
+ try
+ {
+ $processor->processConfiguration($configuration, $config);
+ }
+ catch (Exception $e)
+ {
+ $iohandler->add_error_message('INVALID_CONFIGURATION', $e->getMessage());
+
+ return 1;
+ }
+
+ $iohandler->add_success_message('CONFIGURATION_VALID');
+ return 0;
+ }
+}
diff --git a/phpBB/phpbb/install/console/command/update/update.php b/phpBB/phpbb/install/console/command/update/update.php
new file mode 100644
index 0000000000..116f42f758
--- /dev/null
+++ b/phpBB/phpbb/install/console/command/update/update.php
@@ -0,0 +1,179 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\install\console\command\update;
+
+use phpbb\install\exception\installer_exception;
+use phpbb\install\helper\install_helper;
+use phpbb\install\helper\iohandler\cli_iohandler;
+use phpbb\install\helper\iohandler\factory;
+use phpbb\install\installer;
+use phpbb\install\updater_configuration;
+use phpbb\language\language;
+use Symfony\Component\Config\Definition\Exception\Exception;
+use Symfony\Component\Config\Definition\Processor;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\Yaml\Exception\ParseException;
+use Symfony\Component\Yaml\Yaml;
+
+class update extends \phpbb\console\command\command
+{
+ /**
+ * @var factory
+ */
+ protected $iohandler_factory;
+
+ /**
+ * @var installer
+ */
+ protected $installer;
+
+ /**
+ * @var install_helper
+ */
+ protected $install_helper;
+
+ /**
+ * @var language
+ */
+ protected $language;
+
+ /**
+ * Constructor
+ *
+ * @param language $language
+ * @param factory $factory
+ * @param installer $installer
+ * @param install_helper $install_helper
+ */
+ public function __construct(language $language, factory $factory, installer $installer, install_helper $install_helper)
+ {
+ $this->iohandler_factory = $factory;
+ $this->installer = $installer;
+ $this->language = $language;
+ $this->install_helper = $install_helper;
+
+ parent::__construct(new \phpbb\user($language, 'datetime'));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('update')
+ ->addArgument(
+ 'config-file',
+ InputArgument::REQUIRED,
+ $this->language->lang('CLI_CONFIG_FILE'))
+ ->setDescription($this->language->lang('CLI_UPDATE_BOARD'))
+ ;
+ }
+
+ /**
+ * Executes the command update.
+ *
+ * Update the board
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return int
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->iohandler_factory->set_environment('cli');
+
+ /** @var \phpbb\install\helper\iohandler\cli_iohandler $iohandler */
+ $iohandler = $this->iohandler_factory->get();
+ $style = new SymfonyStyle($input, $output);
+ $iohandler->set_style($style, $output);
+
+ $this->installer->set_iohandler($iohandler);
+
+ $config_file = $input->getArgument('config-file');
+
+ if (!$this->install_helper->is_phpbb_installed())
+ {
+ $iohandler->add_error_message('INSTALL_PHPBB_NOT_INSTALLED');
+
+ return 1;
+ }
+
+ if (!is_file($config_file))
+ {
+ $iohandler->add_error_message(array('MISSING_FILE', $config_file));
+
+ return 1;
+ }
+
+ try
+ {
+ $config = Yaml::parse(file_get_contents($config_file), true, false);
+ }
+ catch (ParseException $e)
+ {
+ $iohandler->add_error_message(array('INVALID_YAML_FILE', $config_file));
+
+ return 1;
+ }
+
+ $processor = new Processor();
+ $configuration = new updater_configuration();
+
+ try
+ {
+ $config = $processor->processConfiguration($configuration, $config);
+ }
+ catch (Exception $e)
+ {
+ $iohandler->add_error_message('INVALID_CONFIGURATION', $e->getMessage());
+
+ return 1;
+ }
+
+ $this->register_configuration($iohandler, $config);
+
+ try
+ {
+ $this->installer->run();
+ }
+ catch (installer_exception $e)
+ {
+ $iohandler->add_error_message($e->getMessage());
+ return 1;
+ }
+ }
+
+ /**
+ * Register the configuration to simulate the forms.
+ *
+ * @param cli_iohandler $iohandler
+ * @param array $config
+ */
+ private function register_configuration(cli_iohandler $iohandler, $config)
+ {
+ $iohandler->set_input('update_type', $config['type']);
+ $iohandler->set_input('submit_update', 'submit');
+
+ $iohandler->set_input('compression_method', '.tar');
+ $iohandler->set_input('method', 'direct_file');
+ $iohandler->set_input('submit_update_file', 'submit');
+
+ $iohandler->set_input('submit_continue_file_update', 'submit');
+ }
+}
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_update_settings.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_update_settings.php
index c139b70fa4..3b24e8ba40 100644
--- a/phpBB/phpbb/install/module/obtain_data/task/obtain_update_settings.php
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_update_settings.php
@@ -53,6 +53,14 @@ class obtain_update_settings extends task_base
if ($this->iohandler->get_input('submit_update', false))
{
$update_files = $this->iohandler->get_input('update_type', 'all') === 'all';
+
+ if ($this->installer_config->get('disable_filesystem_update', false) && $update_files)
+ {
+ $this->iohandler->add_error_message('UPDATE_FILES_NOT_FOUND');
+
+ throw new user_interaction_required_exception();
+ }
+
$this->installer_config->set('do_update_files', $update_files);
}
else
diff --git a/phpBB/phpbb/install/module/requirements/task/check_update.php b/phpBB/phpbb/install/module/requirements/task/check_update.php
index 4e9124ff47..cd66ffc8f9 100644
--- a/phpBB/phpbb/install/module/requirements/task/check_update.php
+++ b/phpBB/phpbb/install/module/requirements/task/check_update.php
@@ -122,7 +122,7 @@ class check_update extends task_base
// Check for a valid update directory
if (!$this->filesystem->exists($update_files) || !$this->filesystem->is_readable($update_files))
{
- $this->iohandler->add_error_message('UPDATE_FILES_NOT_FOUND');
+ $this->iohandler->add_warning_message('UPDATE_FILES_NOT_FOUND');
$this->set_test_passed(false);
// If there are no update files, we can't check the version etc
diff --git a/phpBB/phpbb/install/updater_configuration.php b/phpBB/phpbb/install/updater_configuration.php
new file mode 100644
index 0000000000..e992356290
--- /dev/null
+++ b/phpBB/phpbb/install/updater_configuration.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\install;
+
+use Symfony\Component\Config\Definition\Builder\TreeBuilder;
+use Symfony\Component\Config\Definition\ConfigurationInterface;
+
+class updater_configuration implements ConfigurationInterface
+{
+
+ /**
+ * Generates the configuration tree builder.
+ *
+ * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
+ */
+ public function getConfigTreeBuilder()
+ {
+ $treeBuilder = new TreeBuilder();
+ $rootNode = $treeBuilder->root('updater');
+ $rootNode
+ ->addDefaultsIfNotSet()
+ ->children()
+ ->enumNode('type')->values(['all','db_only'])->defaultValue('all')->end()
+ ->end()
+ ;
+
+ return $treeBuilder;
+ }
+}
diff --git a/phpBB/phpbb/notification/method/messenger_base.php b/phpBB/phpbb/notification/method/messenger_base.php
index 8a8e284e13..97bad524e1 100644
--- a/phpBB/phpbb/notification/method/messenger_base.php
+++ b/phpBB/phpbb/notification/method/messenger_base.php
@@ -97,7 +97,7 @@ abstract class messenger_base extends \phpbb\notification\method\base
continue;
}
- $messenger->template($template_dir_prefix . $notification->get_email_template(), $user['user_lang']);
+ $messenger->template($notification->get_email_template(), $user['user_lang'], '', $template_dir_prefix);
$messenger->set_addresses($user);
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index 8ecca49a60..a7439bc759 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -36,11 +36,14 @@
<!-- IF S_USER_INACTIVE --><dt>{L_USER_IS_INACTIVE}{L_COLON}</dt> <dd>{USER_INACTIVE_REASON}</dd><!-- ENDIF -->
<!-- IF AGE !== '' --><dt>{L_AGE}{L_COLON}</dt> <dd>{AGE}</dd><!-- ENDIF -->
<!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}{L_COLON}</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF -->
+ <!-- EVENT memberlist_view_non_contact_custom_fields_before -->
<!-- BEGIN custom_fields -->
<!-- IF not custom_fields.S_PROFILE_CONTACT -->
<dt>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd>
<!-- ENDIF -->
<!-- END custom_fields -->
+ <!-- EVENT memberlist_view_non_contact_custom_fields_after -->
+ <!-- EVENT memberlist_view_zebra_before -->
<!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
<!-- IF U_REMOVE_FRIEND -->
<dt>&nbsp;</dt> <dd class="zebra"><a href="{U_REMOVE_FRIEND}" data-ajax="zebra"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
@@ -55,6 +58,7 @@
<!-- ENDIF -->
<!-- ENDIF -->
<!-- ENDIF -->
+ <!-- EVENT memberlist_view_zebra_after -->
</dl>
</div>
@@ -71,6 +75,7 @@
<!-- IF U_EMAIL --><dt>{L_EMAIL_ADDRESS}{L_COLON}</dt> <dd><a href="{U_EMAIL}">{L_SEND_EMAIL_USER}</a></dd><!-- ENDIF -->
<!-- IF U_PM --><dt>{L_PM}{L_COLON}</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd><!-- ENDIF -->
<!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}{L_COLON}</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 750, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}{L_COLON}</dt> <dd>{USER_JABBER}</dd><!-- ENDIF -->
+ <!-- EVENT memberlist_view_contact_custom_fields_before -->
<!-- BEGIN custom_fields -->
<!-- IF custom_fields.S_PROFILE_CONTACT -->
<dt>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</dt>
@@ -81,6 +86,7 @@
<!-- ENDIF -->
<!-- ENDIF -->
<!-- END custom_fields -->
+ <!-- EVENT memberlist_view_contact_custom_fields_after -->
<!-- IF S_PROFILE_FIELD1 -->
<!-- NOTE: Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
<dt>{PROFILE_FIELD1_NAME}{L_COLON}</dt> <dd>{PROFILE_FIELD1_VALUE}</dd>