diff options
Diffstat (limited to 'phpBB/includes/acp')
| -rw-r--r-- | phpBB/includes/acp/acp_board.php | 13 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_extensions.php | 207 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_main.php | 18 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_styles.php | 4 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_update.php | 16 | ||||
| -rw-r--r-- | phpBB/includes/acp/info/acp_logs.php | 27 | 
6 files changed, 174 insertions, 111 deletions
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index c8f6f426c6..5c3c7f30aa 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)  	{ @@ -318,9 +318,9 @@ class acp_board  					'title'	=> 'ACP_COOKIE_SETTINGS',  					'vars'	=> array(  						'legend1'		=> 'ACP_COOKIE_SETTINGS', -						'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_domain'	=> array('lang' => 'COOKIE_DOMAIN',	'validate' => 'string',	'type' => 'text::255', 'explain' => true), +						'cookie_name'	=> array('lang' => 'COOKIE_NAME',	'validate' => 'string',	'type' => 'text::16', 'explain' => true), +						'cookie_path'	=> array('lang'	=> 'COOKIE_PATH',	'validate' => 'string',	'type' => 'text::255', 'explain' => true),  						'cookie_secure'	=> array('lang' => 'COOKIE_SECURE',	'validate' => 'bool',	'type' => 'radio:disabled_enabled', 'explain' => true),  					)  				); @@ -454,6 +454,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',  					) @@ -482,7 +485,7 @@ class acp_board  			$user->add_lang($display_vars['lang']);  		} -		$this->new_config = $config; +		$this->new_config = clone $config;  		$cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('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 5a2ded91e2..9e72ab83f8 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -22,21 +22,23 @@ 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, $phpEx, $phpbb_log, $cache, $phpbb_dispatcher; +		global $config, $user, $template, $request, $phpbb_extension_manager, $phpbb_root_path, $phpEx, $phpbb_log, $cache, $phpbb_dispatcher; -		$this->db = $db;  		$this->config = $config;  		$this->template = $template;  		$this->user = $user; @@ -44,49 +46,57 @@ class acp_extensions  		$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, $template, $user, $phpbb_root_path); +			$md_manager = $this->ext_manager->create_extension_metadata_manager($ext_name, $this->template);  			try  			{ @@ -101,6 +111,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); @@ -110,12 +124,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; @@ -123,17 +137,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,  				)); @@ -141,30 +155,29 @@ 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); +					trigger_error($e . 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), @@ -172,57 +185,56 @@ 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); +					trigger_error($e . 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), @@ -230,38 +242,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), @@ -269,33 +281,33 @@ 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; @@ -306,28 +318,25 @@ class acp_extensions  				try  				{ -					$updates_available = $this->version_check($md_manager, $request->variable('versioncheck_force', false)); +					$updates_available = $this->version_check($md_manager, $this->request->variable('versioncheck_force', false)); -					$template->assign_vars(array( +					$this->template->assign_vars(array(  						'S_UP_TO_DATE'		=> empty($updates_available),  						'S_VERSIONCHECK'	=> true,  						'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 (\RuntimeException $e)  				{ -					$template->assign_vars(array( +					$this->template->assign_vars(array(  						'S_VERSIONCHECK_STATUS'			=> $e->getCode(), -						'VERSIONCHECK_FAIL_REASON'		=> ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '', +						'VERSIONCHECK_FAIL_REASON'		=> ($e->getMessage() !== $this->user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '',  					));  				} -				$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')),  				)); @@ -335,21 +344,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, $this->template); +			$md_manager = $this->ext_manager->create_extension_metadata_manager($name, $this->template);  			try  			{ @@ -397,16 +426,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, $this->template); +			$md_manager = $this->ext_manager->create_extension_metadata_manager($name, $this->template);  			try  			{ @@ -455,18 +483,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, $this->template); +			$md_manager = $this->ext_manager->create_extension_metadata_manager($name, $this->template);  			try  			{ @@ -535,7 +562,7 @@ class acp_extensions  	* @param \phpbb\extension\metadata_manager $md_manager The metadata manager for the version to check.  	* @param bool $force_update Ignores cached data. Defaults to false.  	* @param bool $force_cache Force the use of the cache. Override $force_update. -	* @return string +	* @return array  	* @throws RuntimeException  	*/  	protected function version_check(\phpbb\extension\metadata_manager $md_manager, $force_update = false, $force_cache = false) @@ -554,7 +581,7 @@ class acp_extensions  		$version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename'], isset($version_check['ssl']) ? $version_check['ssl'] : false);  		$version_helper->force_stability($this->config['extension_force_unstable'] ? 'unstable' : null); -		return $updates = $version_helper->get_suggested_updates($force_update, $force_cache); +		return $version_helper->get_ext_update_on_branch($force_update, $force_cache);  	}  	/** diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 848cafeb67..6e7bd91a86 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -421,23 +421,33 @@ class acp_main  		// Version check  		$user->add_lang('install'); -		if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.3', '<')) +		if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.4.0', '<'))  		{  			$template->assign_vars(array(  				'S_PHP_VERSION_OLD'	=> true, -				'L_PHP_VERSION_OLD'	=> sprintf($user->lang['PHP_VERSION_OLD'], '<a href="https://www.phpbb.com/community/viewtopic.php?f=14&t=2152375">', '</a>'), +				'L_PHP_VERSION_OLD'	=> sprintf($user->lang['PHP_VERSION_OLD'], PHP_VERSION, '5.4.0', '<a href="https://www.phpbb.com/support/docs/en/3.2/ug/quickstart/requirements">', '</a>'),  			));  		}  		if ($auth->acl_get('a_board'))  		{ +			/** @var \phpbb\version_helper $version_helper */  			$version_helper = $phpbb_container->get('version_helper');  			try  			{  				$recheck = $request->variable('versioncheck_force', false); -				$updates_available = $version_helper->get_suggested_updates($recheck); +				$updates_available = $version_helper->get_update_on_branch($recheck); +				$upgrades_available = $version_helper->get_suggested_updates(); +				if (!empty($upgrades_available)) +				{ +					$upgrades_available = array_pop($upgrades_available); +				} -				$template->assign_var('S_VERSION_UP_TO_DATE', empty($updates_available)); +				$template->assign_vars(array( +					'S_VERSION_UP_TO_DATE'		=> empty($updates_available), +					'S_VERSION_UPGRADEABLE'		=> !empty($upgrades_available), +					'UPGRADE_INSTRUCTIONS'		=> !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false, +				));  			}  			catch (\RuntimeException $e)  			{ diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 5181b87ecb..c29fb062d8 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -433,6 +433,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); @@ -579,6 +582,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 529f0f2185..cee2ce222e 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -37,7 +37,12 @@ class acp_update  		try  		{  			$recheck = $request->variable('versioncheck_force', false); -			$updates_available = $version_helper->get_suggested_updates($recheck); +			$updates_available = $version_helper->get_update_on_branch($recheck); +			$upgrades_available = $version_helper->get_suggested_updates(); +			if (!empty($upgrades_available)) +			{ +				$upgrades_available = array_pop($upgrades_available); +			}  		}  		catch (\RuntimeException $e)  		{ @@ -46,12 +51,9 @@ 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 = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update'); +		$update_link = append_sid($phpbb_root_path . 'install/');  		$template->assign_vars(array(  			'S_UP_TO_DATE'			=> empty($updates_available), @@ -61,6 +63,8 @@ class acp_update  			'CURRENT_VERSION'		=> $config['version'],  			'UPDATE_INSTRUCTIONS'	=> sprintf($user->lang['UPDATE_INSTRUCTIONS'], $update_link), +			'S_VERSION_UPGRADEABLE'		=> !empty($upgrades_available), +			'UPGRADE_INSTRUCTIONS'		=> !empty($upgrades_available) ? $user->lang('UPGRADE_INSTRUCTIONS', $upgrades_available['current'], $upgrades_available['announcement']) : false,  		));  		// Incomplete update? diff --git a/phpBB/includes/acp/info/acp_logs.php b/phpBB/includes/acp/info/acp_logs.php index e9e6034cd4..3b2764c4dc 100644 --- a/phpBB/includes/acp/info/acp_logs.php +++ b/phpBB/includes/acp/info/acp_logs.php @@ -15,16 +15,31 @@ 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',  			'version'	=> '1.0.0', -			'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,  		);  	}  | 
