aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/acp/acp_board.php9
-rw-r--r--phpBB/includes/acp/acp_extensions.php256
-rw-r--r--phpBB/includes/acp/acp_main.php1
-rw-r--r--phpBB/includes/acp/acp_styles.php4
-rw-r--r--phpBB/includes/acp/acp_update.php5
-rw-r--r--phpBB/includes/acp/info/acp_logs.php27
-rw-r--r--phpBB/includes/functions_content.php2
-rw-r--r--phpBB/includes/functions_display.php4
-rw-r--r--phpBB/includes/functions_messenger.php19
-rw-r--r--phpBB/includes/functions_posting.php6
-rw-r--r--phpBB/includes/functions_user.php12
-rw-r--r--phpBB/includes/mcp/mcp_main.php2
-rw-r--r--phpBB/includes/message_parser.php2
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php4
-rw-r--r--phpBB/includes/ucp/ucp_profile.php2
15 files changed, 227 insertions, 128 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 1f9c15dbd0..956ff7cf0f 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -26,7 +26,7 @@ if (!defined('IN_PHPBB'))
class acp_board
{
var $u_action;
- var $new_config = array();
+ var $new_config;
function main($id, $mode)
{
@@ -323,7 +323,7 @@ class acp_board
'cookie_domain' => array('lang' => 'COOKIE_DOMAIN', 'validate' => 'string', 'type' => 'text::255', 'explain' => false),
'cookie_name' => array('lang' => 'COOKIE_NAME', 'validate' => 'string', 'type' => 'text::16', 'explain' => false),
'cookie_path' => array('lang' => 'COOKIE_PATH', 'validate' => 'string', 'type' => 'text::255', 'explain' => false),
- 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:disabled_enabled', 'explain' => true),
+ 'cookie_secure' => array('lang' => 'COOKIE_SECURE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
'cookie_notice' => array('lang' => 'COOKIE_NOTICE', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true),
)
);
@@ -459,6 +459,9 @@ class acp_board
'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true),
'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true),
+ 'smtp_verify_peer' => array('lang' => 'SMTP_VERIFY_PEER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'smtp_verify_peer_name' => array('lang' => 'SMTP_VERIFY_PEER_NAME', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
+ 'smtp_allow_self_signed'=> array('lang' => 'SMTP_ALLOW_SELF_SIGNED','validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend3' => 'ACP_SUBMIT_CHANGES',
)
@@ -487,7 +490,7 @@ class acp_board
$user->add_lang($display_vars['lang']);
}
- $this->new_config = $config;
+ $this->new_config = clone $config;
$cfg_array = (isset($_REQUEST['config'])) ? $request->variable('config', array('' => ''), true) : $this->new_config;
$error = array();
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php
index e915fa8c75..5c589222c6 100644
--- a/phpBB/includes/acp/acp_extensions.php
+++ b/phpBB/includes/acp/acp_extensions.php
@@ -25,71 +25,79 @@ if (!defined('IN_PHPBB'))
class acp_extensions
{
var $u_action;
+ var $tpl_name;
+ var $page_title;
- private $db;
private $config;
private $template;
private $user;
- private $cache;
private $log;
private $request;
+ private $phpbb_dispatcher;
+ private $ext_manager;
function main()
{
// Start the page
- global $config, $user, $template, $request, $phpbb_extension_manager, $db, $phpbb_root_path, $phpbb_log, $cache, $phpbb_dispatcher;
+ global $config, $user, $template, $request, $phpbb_extension_manager, $phpbb_root_path, $phpbb_log, $phpbb_dispatcher;
- $this->db = $db;
$this->config = $config;
$this->template = $template;
$this->user = $user;
- $this->cache = $cache;
$this->request = $request;
$this->log = $phpbb_log;
$this->phpbb_dispatcher = $phpbb_dispatcher;
+ $this->ext_manager = $phpbb_extension_manager;
- $user->add_lang(array('install', 'acp/extensions', 'migrator'));
+ $this->user->add_lang(array('install', 'acp/extensions', 'migrator'));
$this->page_title = 'ACP_EXTENSIONS';
- $action = $request->variable('action', 'list');
- $ext_name = $request->variable('ext_name', '');
+ $action = $this->request->variable('action', 'list');
+ $ext_name = $this->request->variable('ext_name', '');
// What is a safe limit of execution time? Half the max execution time should be safe.
$safe_time_limit = (ini_get('max_execution_time') / 2);
$start_time = time();
+ // Cancel action
+ if ($this->request->is_set_post('cancel'))
+ {
+ $action = 'list';
+ $ext_name = '';
+ }
+
+ if (in_array($action, array('enable', 'disable', 'delete_data')) && !check_link_hash($this->request->variable('hash', ''), $action . '.' . $ext_name))
+ {
+ trigger_error('FORM_INVALID', E_USER_WARNING);
+ }
+
/**
* Event to run a specific action on extension
*
- * @event core.acp_extensions_run_action
- * @var string action Action to run
+ * @event core.acp_extensions_run_action_before
+ * @var string action Action to run; if the event completes execution of the action, should be set to 'none'
* @var string u_action Url we are at
* @var string ext_name Extension name from request
* @var int safe_time_limit Safe limit of execution time
* @var int start_time Start time
+ * @var string tpl_name Template file to load
* @since 3.1.11-RC1
+ * @changed 3.2.1-RC1 Renamed to core.acp_extensions_run_action_before, added tpl_name, added action 'none'
*/
$u_action = $this->u_action;
- $vars = array('action', 'u_action', 'ext_name', 'safe_time_limit', 'start_time');
- extract($this->phpbb_dispatcher->trigger_event('core.acp_extensions_run_action', compact($vars)));
+ $tpl_name = '';
+ $vars = array('action', 'u_action', 'ext_name', 'safe_time_limit', 'start_time', 'tpl_name');
+ extract($this->phpbb_dispatcher->trigger_event('core.acp_extensions_run_action_before', compact($vars)));
- // Cancel action
- if ($request->is_set_post('cancel'))
- {
- $action = 'list';
- $ext_name = '';
- }
-
- if (in_array($action, array('enable', 'disable', 'delete_data')) && !check_link_hash($request->variable('hash', ''), $action . '.' . $ext_name))
- {
- trigger_error('FORM_INVALID', E_USER_WARNING);
- }
+ // In case they have been updated by the event
+ $this->u_action = $u_action;
+ $this->tpl_name = $tpl_name;
// If they've specified an extension, let's load the metadata manager and validate it.
if ($ext_name)
{
- $md_manager = new \phpbb\extension\metadata_manager($ext_name, $config, $phpbb_extension_manager, $phpbb_root_path);
+ $md_manager = $this->ext_manager->create_extension_metadata_manager($ext_name);
try
{
@@ -105,6 +113,10 @@ class acp_extensions
// What are we doing?
switch ($action)
{
+ case 'none':
+ // Intentionally empty, used by extensions that execute additional actions in the prior event
+ break;
+
case 'set_config_version_check_force_unstable':
$force_unstable = $this->request->variable('force_unstable', false);
@@ -114,12 +126,12 @@ class acp_extensions
'force_unstable' => $force_unstable,
));
- confirm_box(false, $user->lang('EXTENSION_FORCE_UNSTABLE_CONFIRM'), $s_hidden_fields);
+ confirm_box(false, $this->user->lang('EXTENSION_FORCE_UNSTABLE_CONFIRM'), $s_hidden_fields);
}
else
{
- $config->set('extension_force_unstable', false);
- trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
+ $this->config->set('extension_force_unstable', false);
+ trigger_error($this->user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
break;
@@ -127,17 +139,17 @@ class acp_extensions
default:
if (confirm_box(true))
{
- $config->set('extension_force_unstable', true);
- trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
+ $this->config->set('extension_force_unstable', true);
+ trigger_error($this->user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
}
- $this->list_enabled_exts($phpbb_extension_manager);
- $this->list_disabled_exts($phpbb_extension_manager);
- $this->list_available_exts($phpbb_extension_manager);
+ $this->list_enabled_exts();
+ $this->list_disabled_exts();
+ $this->list_available_exts();
$this->template->assign_vars(array(
'U_VERSIONCHECK_FORCE' => $this->u_action . '&action=list&versioncheck_force=1',
- 'FORCE_UNSTABLE' => $config['extension_force_unstable'],
+ 'FORCE_UNSTABLE' => $this->config['extension_force_unstable'],
'U_ACTION' => $this->u_action,
));
@@ -145,30 +157,30 @@ class acp_extensions
break;
case 'enable_pre':
- if (!$md_manager->validate_dir())
+ try
{
- trigger_error($user->lang['EXTENSION_DIR_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ $md_manager->validate_enable();
}
-
- if (!$md_manager->validate_enable())
+ catch (\phpbb\extension\exception $e)
{
- trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters()));
+ trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
}
- $extension = $phpbb_extension_manager->get_extension($ext_name);
+ $extension = $this->ext_manager->get_extension($ext_name);
if (!$extension->is_enableable())
{
- trigger_error($user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($this->user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- if ($phpbb_extension_manager->is_enabled($ext_name))
+ if ($this->ext_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
$this->tpl_name = 'acp_ext_enable';
- $template->assign_vars(array(
+ $this->template->assign_vars(array(
'PRE' => true,
'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')),
'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name),
@@ -176,57 +188,57 @@ class acp_extensions
break;
case 'enable':
- if (!$md_manager->validate_dir())
+ try
{
- trigger_error($user->lang['EXTENSION_DIR_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ $md_manager->validate_enable();
}
-
- if (!$md_manager->validate_enable())
+ catch (\phpbb\extension\exception $e)
{
- trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters()));
+ trigger_error($message . adm_back_link($this->u_action), E_USER_WARNING);
}
- $extension = $phpbb_extension_manager->get_extension($ext_name);
+ $extension = $this->ext_manager->get_extension($ext_name);
if (!$extension->is_enableable())
{
- trigger_error($user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
+ trigger_error($this->user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
try
{
- while ($phpbb_extension_manager->enable_step($ext_name))
+ while ($this->ext_manager->enable_step($ext_name))
{
// Are we approaching the time limit? If so we want to pause the update and continue after refreshing
if ((time() - $start_time) >= $safe_time_limit)
{
- $template->assign_var('S_NEXT_STEP', true);
+ $this->template->assign_var('S_NEXT_STEP', true);
meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('enable.' . $ext_name));
}
}
- $this->log->add('admin', $user->data['user_id'], $user->ip, 'LOG_EXT_ENABLE', time(), array($ext_name));
+ $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_ENABLE', time(), array($ext_name));
}
catch (\phpbb\db\migration\exception $e)
{
- $template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($user));
+ $this->template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($this->user));
}
$this->tpl_name = 'acp_ext_enable';
- $template->assign_vars(array(
+ $this->template->assign_vars(array(
'U_RETURN' => $this->u_action . '&action=list',
));
break;
case 'disable_pre':
- if (!$phpbb_extension_manager->is_enabled($ext_name))
+ if (!$this->ext_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
$this->tpl_name = 'acp_ext_disable';
- $template->assign_vars(array(
+ $this->template->assign_vars(array(
'PRE' => true,
'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')),
'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name),
@@ -234,38 +246,38 @@ class acp_extensions
break;
case 'disable':
- if (!$phpbb_extension_manager->is_enabled($ext_name))
+ if (!$this->ext_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
- while ($phpbb_extension_manager->disable_step($ext_name))
+ while ($this->ext_manager->disable_step($ext_name))
{
// Are we approaching the time limit? If so we want to pause the update and continue after refreshing
if ((time() - $start_time) >= $safe_time_limit)
{
- $template->assign_var('S_NEXT_STEP', true);
+ $this->template->assign_var('S_NEXT_STEP', true);
meta_refresh(0, $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('disable.' . $ext_name));
}
}
- $this->log->add('admin', $user->data['user_id'], $user->ip, 'LOG_EXT_DISABLE', time(), array($ext_name));
+ $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_DISABLE', time(), array($ext_name));
$this->tpl_name = 'acp_ext_disable';
- $template->assign_vars(array(
+ $this->template->assign_vars(array(
'U_RETURN' => $this->u_action . '&action=list',
));
break;
case 'delete_data_pre':
- if ($phpbb_extension_manager->is_enabled($ext_name))
+ if ($this->ext_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
$this->tpl_name = 'acp_ext_delete_data';
- $template->assign_vars(array(
+ $this->template->assign_vars(array(
'PRE' => true,
'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')),
'U_PURGE' => $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name),
@@ -273,75 +285,72 @@ class acp_extensions
break;
case 'delete_data':
- if ($phpbb_extension_manager->is_enabled($ext_name))
+ if ($this->ext_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
try
{
- while ($phpbb_extension_manager->purge_step($ext_name))
+ while ($this->ext_manager->purge_step($ext_name))
{
// Are we approaching the time limit? If so we want to pause the update and continue after refreshing
if ((time() - $start_time) >= $safe_time_limit)
{
- $template->assign_var('S_NEXT_STEP', true);
+ $this->template->assign_var('S_NEXT_STEP', true);
meta_refresh(0, $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name) . '&hash=' . generate_link_hash('delete_data.' . $ext_name));
}
}
- $this->log->add('admin', $user->data['user_id'], $user->ip, 'LOG_EXT_PURGE', time(), array($ext_name));
+ $this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_EXT_PURGE', time(), array($ext_name));
}
catch (\phpbb\db\migration\exception $e)
{
- $template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($user));
+ $this->template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($this->user));
}
$this->tpl_name = 'acp_ext_delete_data';
- $template->assign_vars(array(
+ $this->template->assign_vars(array(
'U_RETURN' => $this->u_action . '&action=list',
));
break;
case 'details':
// Output it to the template
- $md_manager->output_template_data($template);
-
$meta = $md_manager->get_metadata('all');
+ $this->output_metadata_to_template($meta);
+
if (isset($meta['extra']['version-check']))
{
try
{
- $updates_available = $phpbb_extension_manager->version_check($md_manager, $request->variable('versioncheck_force', false), $this->config['extension_force_unstable'] ? 'unstable' : null);
+ $updates_available = $this->ext_manager->version_check($md_manager, $this->request->variable('versioncheck_force', false), false, $this->config['extension_force_unstable'] ? 'unstable' : null);
- $template->assign_vars(array(
+ $this->template->assign_vars(array(
'S_UP_TO_DATE' => empty($updates_available),
'UP_TO_DATE_MSG' => $this->user->lang(empty($updates_available) ? 'UP_TO_DATE' : 'NOT_UP_TO_DATE', $md_manager->get_metadata('display-name')),
));
- foreach ($updates_available as $branch => $version_data)
- {
- $template->assign_block_vars('updates_available', $version_data);
- }
+ $this->template->assign_block_vars('updates_available', $updates_available);
}
catch (exception_interface $e)
{
$message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters()));
- $template->assign_vars(array(
+ $this->template->assign_vars(array(
'S_VERSIONCHECK_FAIL' => true,
'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== 'VERSIONCHECK_FAIL') ? $message : '',
));
}
- $template->assign_var('S_VERSIONCHECK', true);
+ $this->template->assign_var('S_VERSIONCHECK', true);
}
else
{
- $template->assign_var('S_VERSIONCHECK', false);
+ $this->template->assign_var('S_VERSIONCHECK', false);
}
- $template->assign_vars(array(
+ $this->template->assign_vars(array(
'U_BACK' => $this->u_action . '&action=list',
'U_VERSIONCHECK_FORCE' => $this->u_action . '&action=details&versioncheck_force=1&ext_name=' . urlencode($md_manager->get_metadata('name')),
));
@@ -349,21 +358,41 @@ class acp_extensions
$this->tpl_name = 'acp_ext_details';
break;
}
+
+ /**
+ * Event to run after a specific action on extension has completed
+ *
+ * @event core.acp_extensions_run_action_after
+ * @var string action Action that has run
+ * @var string u_action Url we are at
+ * @var string ext_name Extension name from request
+ * @var int safe_time_limit Safe limit of execution time
+ * @var int start_time Start time
+ * @var string tpl_name Template file to load
+ * @since 3.1.11-RC1
+ */
+ $u_action = $this->u_action;
+ $tpl_name = $this->tpl_name;
+ $vars = array('action', 'u_action', 'ext_name', 'safe_time_limit', 'start_time', 'tpl_name');
+ extract($this->phpbb_dispatcher->trigger_event('core.acp_extensions_run_action_after', compact($vars)));
+
+ // In case they have been updated by the event
+ $this->u_action = $u_action;
+ $this->tpl_name = $tpl_name;
}
/**
* Lists all the enabled extensions and dumps to the template
*
- * @param $phpbb_extension_manager An instance of the extension manager
* @return null
*/
- public function list_enabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
+ public function list_enabled_exts()
{
$enabled_extension_meta_data = array();
- foreach ($phpbb_extension_manager->all_enabled() as $name => $location)
+ foreach ($this->ext_manager->all_enabled() as $name => $location)
{
- $md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name);
+ $md_manager = $this->ext_manager->create_extension_metadata_manager($name);
try
{
@@ -378,7 +407,7 @@ class acp_extensions
try
{
$force_update = $this->request->variable('versioncheck_force', false);
- $updates = $phpbb_extension_manager->version_check($md_manager, $force_update, !$force_update);
+ $updates = $this->ext_manager->version_check($md_manager, $force_update, !$force_update);
$enabled_extension_meta_data[$name]['S_UP_TO_DATE'] = empty($updates);
$enabled_extension_meta_data[$name]['S_VERSIONCHECK'] = true;
@@ -426,16 +455,15 @@ class acp_extensions
/**
* Lists all the disabled extensions and dumps to the template
*
- * @param $phpbb_extension_manager An instance of the extension manager
* @return null
*/
- public function list_disabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
+ public function list_disabled_exts()
{
$disabled_extension_meta_data = array();
- foreach ($phpbb_extension_manager->all_disabled() as $name => $location)
+ foreach ($this->ext_manager->all_disabled() as $name => $location)
{
- $md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name);
+ $md_manager = $this->ext_manager->create_extension_metadata_manager($name);
try
{
@@ -448,7 +476,7 @@ class acp_extensions
if (isset($meta['extra']['version-check']))
{
$force_update = $this->request->variable('versioncheck_force', false);
- $updates = $phpbb_extension_manager->version_check($md_manager, $force_update, !$force_update);
+ $updates = $this->ext_manager->version_check($md_manager, $force_update, !$force_update);
$disabled_extension_meta_data[$name]['S_UP_TO_DATE'] = empty($updates);
$disabled_extension_meta_data[$name]['S_VERSIONCHECK'] = true;
@@ -496,18 +524,17 @@ class acp_extensions
/**
* Lists all the available extensions and dumps to the template
*
- * @param $phpbb_extension_manager An instance of the extension manager
* @return null
*/
- public function list_available_exts(\phpbb\extension\manager $phpbb_extension_manager)
+ public function list_available_exts()
{
- $uninstalled = array_diff_key($phpbb_extension_manager->all_available(), $phpbb_extension_manager->all_configured());
+ $uninstalled = array_diff_key($this->ext_manager->all_available(), $this->ext_manager->all_configured());
$available_extension_meta_data = array();
foreach ($uninstalled as $name => $location)
{
- $md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name);
+ $md_manager = $this->ext_manager->create_extension_metadata_manager($name);
try
{
@@ -520,7 +547,7 @@ class acp_extensions
if (isset($meta['extra']['version-check']))
{
$force_update = $this->request->variable('versioncheck_force', false);
- $updates = $phpbb_extension_manager->version_check($md_manager, $force_update, !$force_update);
+ $updates = $this->ext_manager->version_check($md_manager, $force_update, !$force_update);
$available_extension_meta_data[$name]['S_UP_TO_DATE'] = empty($updates);
$available_extension_meta_data[$name]['S_VERSIONCHECK'] = true;
@@ -585,4 +612,41 @@ class acp_extensions
{
return strnatcasecmp($val1['META_DISPLAY_NAME'], $val2['META_DISPLAY_NAME']);
}
+
+ /**
+ * Outputs extension metadata into the template
+ *
+ * @param array $metadata Array with all metadata for the extension
+ * @return null
+ */
+ public function output_metadata_to_template($metadata)
+ {
+ $this->template->assign_vars(array(
+ 'META_NAME' => $metadata['name'],
+ 'META_TYPE' => $metadata['type'],
+ 'META_DESCRIPTION' => (isset($metadata['description'])) ? $metadata['description'] : '',
+ 'META_HOMEPAGE' => (isset($metadata['homepage'])) ? $metadata['homepage'] : '',
+ 'META_VERSION' => $metadata['version'],
+ 'META_TIME' => (isset($metadata['time'])) ? $metadata['time'] : '',
+ 'META_LICENSE' => $metadata['license'],
+
+ 'META_REQUIRE_PHP' => (isset($metadata['require']['php'])) ? $metadata['require']['php'] : '',
+ 'META_REQUIRE_PHP_FAIL' => (isset($metadata['require']['php'])) ? false : true,
+
+ 'META_REQUIRE_PHPBB' => (isset($metadata['extra']['soft-require']['phpbb/phpbb'])) ? $metadata['extra']['soft-require']['phpbb/phpbb'] : '',
+ 'META_REQUIRE_PHPBB_FAIL' => (isset($metadata['extra']['soft-require']['phpbb/phpbb'])) ? false : true,
+
+ 'META_DISPLAY_NAME' => (isset($metadata['extra']['display-name'])) ? $metadata['extra']['display-name'] : '',
+ ));
+
+ foreach ($metadata['authors'] as $author)
+ {
+ $this->template->assign_block_vars('meta_authors', array(
+ 'AUTHOR_NAME' => $author['name'],
+ 'AUTHOR_EMAIL' => (isset($author['email'])) ? $author['email'] : '',
+ 'AUTHOR_HOMEPAGE' => (isset($author['homepage'])) ? $author['homepage'] : '',
+ 'AUTHOR_ROLE' => (isset($author['role'])) ? $author['role'] : '',
+ ));
+ }
+ }
}
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index bb85d080ce..9b1a248923 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -577,6 +577,7 @@ class acp_main
'S_TOTAL_ORPHAN' => ($total_orphan === false) ? false : true,
'GZIP_COMPRESSION' => ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'],
'DATABASE_INFO' => $db->sql_server_info(),
+ 'PHP_VERSION_INFO' => PHP_VERSION,
'BOARD_VERSION' => $config['version'],
'U_ACTION' => $this->u_action,
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 7878cbc8e9..b954f90451 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -448,6 +448,9 @@ class acp_styles
trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+ // Read style configuration file
+ $style_cfg = $this->read_style_cfg($style['style_path']);
+
// Find all available parent styles
$list = $this->find_possible_parents($styles, $id);
@@ -595,6 +598,7 @@ class acp_styles
'STYLE_ID' => $style['style_id'],
'STYLE_NAME' => htmlspecialchars($style['style_name']),
'STYLE_PATH' => htmlspecialchars($style['style_path']),
+ 'STYLE_VERSION' => htmlspecialchars($style_cfg['style_version']),
'STYLE_COPYRIGHT' => strip_tags($style['style_copyright']),
'STYLE_PARENT' => $style['style_parent_id'],
'S_STYLE_ACTIVE' => $style['style_active'],
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php
index df376765f8..b52f315d7f 100644
--- a/phpBB/includes/acp/acp_update.php
+++ b/phpBB/includes/acp/acp_update.php
@@ -52,10 +52,7 @@ class acp_update
$updates_available = array();
}
- foreach ($updates_available as $branch => $version_data)
- {
- $template->assign_block_vars('updates_available', $version_data);
- }
+ $template->assign_block_vars('updates_available', $updates_available);
$update_link = $phpbb_root_path . 'install/app.' . $phpEx;
diff --git a/phpBB/includes/acp/info/acp_logs.php b/phpBB/includes/acp/info/acp_logs.php
index efa35b2118..1be7b2883d 100644
--- a/phpBB/includes/acp/info/acp_logs.php
+++ b/phpBB/includes/acp/info/acp_logs.php
@@ -15,15 +15,30 @@ class acp_logs_info
{
function module()
{
+ global $phpbb_dispatcher;
+
+ $modes = array(
+ 'admin' => array('title' => 'ACP_ADMIN_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
+ 'mod' => array('title' => 'ACP_MOD_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
+ 'users' => array('title' => 'ACP_USERS_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
+ 'critical' => array('title' => 'ACP_CRITICAL_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
+ );
+
+ /**
+ * Event to add or modify ACP log modulemodes
+ *
+ * @event core.acp_logs_info_modify_modes
+ * @var array modes Array with modes info
+ * @since 3.1.11-RC1
+ * @since 3.2.1-RC1
+ */
+ $vars = array('modes');
+ extract($phpbb_dispatcher->trigger_event('core.acp_logs_info_modify_modes', compact($vars)));
+
return array(
'filename' => 'acp_logs',
'title' => 'ACP_LOGGING',
- 'modes' => array(
- 'admin' => array('title' => 'ACP_ADMIN_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
- 'mod' => array('title' => 'ACP_MOD_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
- 'users' => array('title' => 'ACP_USERS_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
- 'critical' => array('title' => 'ACP_CRITICAL_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
- ),
+ 'modes' => $modes,
);
}
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 9ec965a6a1..387606a300 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -686,7 +686,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
* @var bool allow_url_bbcode Whether or not to parse the [url] BBCode
* @var string mode Mode to parse text as, e.g. post or sig
* @since 3.1.0-a1
- * @changed 3.2.0-a1
+ * @changed 3.2.0-a1 Added mode
*/
$vars = array(
'text',
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 326378d815..c8b5ec8b1a 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -442,7 +442,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
* @var array root_data Array with the root forum data
* @var array row The data of the 'category'
* @since 3.1.0-RC4
- * @change 3.1.7-RC1 Removed undefined catless variable
+ * @changed 3.1.7-RC1 Removed undefined catless variable
*/
$vars = array(
'cat_row',
@@ -648,7 +648,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
* @var array row The data of the forum
* @var array subforums_row Template data of subforums
* @since 3.1.0-a1
- * @change 3.1.0-b5 Added var subforums_row
+ * @changed 3.1.0-b5 Added var subforums_row
*/
$vars = array('forum_row', 'row', 'subforums_row');
extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_template_vars', compact($vars)));
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 526e18528f..802246c1c5 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -656,7 +656,7 @@ class messenger
*/
protected function setup_template()
{
- global $phpbb_container;
+ global $phpbb_container, $phpbb_dispatcher;
if ($this->template instanceof \phpbb\template\template)
{
@@ -671,7 +671,9 @@ class messenger
$phpbb_container->get('ext.manager'),
new \phpbb\template\twig\loader(
$phpbb_container->get('filesystem')
- )
+ ),
+ $phpbb_dispatcher,
+ array()
);
$template_environment->setLexer($phpbb_container->get('template.twig.lexer'));
@@ -1076,7 +1078,18 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
}
$collector = new \phpbb\error_collector;
$collector->install();
- $smtp->socket = fsockopen($config['smtp_host'], $config['smtp_port'], $errno, $errstr, 20);
+
+ $options = array();
+ $verify_peer = (bool) $config['smtp_verify_peer'];
+ $verify_peer_name = (bool) $config['smtp_verify_peer_name'];
+ $allow_self_signed = (bool) $config['smtp_allow_self_signed'];
+ $remote_socket = $config['smtp_host'] . ':' . $config['smtp_port'];
+
+ // Set ssl context options, see http://php.net/manual/en/context.ssl.php
+ $options['ssl'] = array('verify_peer' => $verify_peer, 'verify_peer_name' => $verify_peer_name, 'allow_self_signed' => $allow_self_signed);
+ $socket_context = stream_context_create($options);
+
+ $smtp->socket = stream_socket_client($remote_socket, $errno, $errstr, 20, STREAM_CLIENT_CONNECT, $socket_context);
$collector->uninstall();
$error_contents = $collector->format_errors();
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 551165c558..7bc9608536 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1676,7 +1676,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''),
'topic_first_poster_colour' => $user->data['user_colour'],
'topic_type' => $topic_type,
- 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data_ary['topic_time_limit'] * 86400) : 0,
+ 'topic_time_limit' => $topic_type != POST_NORMAL ? ($data_ary['topic_time_limit'] * 86400) : 0,
'topic_attachment' => (!empty($data_ary['attachment_data'])) ? 1 : 0,
'topic_status' => (isset($data_ary['topic_status'])) ? $data_ary['topic_status'] : ITEM_UNLOCKED,
);
@@ -1771,7 +1771,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
'topic_title' => $subject,
'topic_first_poster_name' => $username,
'topic_type' => $topic_type,
- 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data_ary['topic_time_limit'] * 86400) : 0,
+ 'topic_time_limit' => $topic_type != POST_NORMAL ? ($data_ary['topic_time_limit'] * 86400) : 0,
'poll_title' => (isset($poll_ary['poll_options'])) ? $poll_ary['poll_title'] : '',
'poll_start' => (isset($poll_ary['poll_options'])) ? $poll_start : 0,
'poll_max_options' => (isset($poll_ary['poll_options'])) ? $poll_ary['poll_max_options'] : 1,
@@ -2386,7 +2386,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
* @var string url The "Return to topic" URL
*
* @since 3.1.0-a3
- * @change 3.1.0-RC3 Added vars mode, subject, username, topic_type,
+ * @changed 3.1.0-RC3 Added vars mode, subject, username, topic_type,
* poll, update_message, update_search_index
*/
$vars = array(
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 8e1a9007e3..3dd4b3c2e5 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -272,13 +272,15 @@ function user_add($user_row, $cp_data = false, $notifications_data = null)
* Use this event to modify the values to be inserted when a user is added
*
* @event core.user_add_modify_data
- * @var array user_row Array of user details submited to user_add
- * @var array cp_data Array of Custom profile fields submited to user_add
- * @var array sql_ary Array of data to be inserted when a user is added
+ * @var array user_row Array of user details submited to user_add
+ * @var array cp_data Array of Custom profile fields submited to user_add
+ * @var array sql_ary Array of data to be inserted when a user is added
+ * @var array notifications_data Array of notification data to be inserted when a user is added
* @since 3.1.0-a1
- * @change 3.1.0-b5
+ * @changed 3.1.0-b5 Added user_row and cp_data
+ * @changed 3.1.11-RC1 Added notifications_data
*/
- $vars = array('user_row', 'cp_data', 'sql_ary');
+ $vars = array('user_row', 'cp_data', 'sql_ary', 'notifications_data');
extract($phpbb_dispatcher->trigger_event('core.user_add_modify_data', compact($vars)));
$sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 5786aa343a..971982e4fc 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -164,7 +164,7 @@ class mcp_main
* @var string action Topic quick moderation action name
* @var bool quickmod Flag indicating whether MCP is in quick moderation mode
* @since 3.1.0-a4
- * @change 3.1.0-RC4 Added variables: action, quickmod
+ * @changed 3.1.0-RC4 Added variables: action, quickmod
*/
$vars = array('action', 'quickmod');
extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_actions', compact($vars)));
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index c68ff87cd7..d6e36fec39 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -1219,7 +1219,7 @@ class parse_message extends bbcode_firstpass
* @var bool return Do we return after the event is triggered if $warn_msg is not empty
* @var array warn_msg Array of the warning messages
* @since 3.1.2-RC1
- * @change 3.1.3-RC1 Added vars $bbcode_bitfield and $bbcode_uid
+ * @changed 3.1.3-RC1 Added vars $bbcode_bitfield and $bbcode_uid
*/
$message = $this->message;
$warn_msg = $this->warn_msg;
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index b3c0752a2f..06f76aa01a 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -280,7 +280,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
* @var bool delete Whether the user is deleting the PM
* @var int reply_to_all Value of reply_to_all request variable.
* @since 3.1.0-RC5
- * @change 3.2.0-a1 Removed undefined variables
+ * @changed 3.2.0-a1 Removed undefined variables
*/
$vars = array(
'sql',
@@ -345,7 +345,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
* @var bool delete If deleting message
* @var int reply_to_all Value of reply_to_all request variable.
* @since 3.1.0-RC5
- * @change 3.2.0-a1 Removed undefined variables
+ * @changed 3.2.0-a1 Removed undefined variables
*/
$vars = array(
'sql',
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 3356195dd6..b7f8501fe4 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -508,7 +508,7 @@ class ucp_profile
* @var bool submit Whether or not the form has been sumitted
* @var bool preview Whether or not the signature is being previewed
* @since 3.1.10-RC1
- * @change 3.2.0-RC2 Removed message parser
+ * @changed 3.2.0-RC2 Removed message parser
*/
$vars = array(
'enable_bbcode',