aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_main.php
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-10-14 16:56:44 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-10-14 16:56:44 +0200
commit886fb7c3f4f8e8221579a0313ab73d0fe87a173e (patch)
treeb4043e2638bf34d99cc237bdf2596c6734ee21f0 /phpBB/includes/acp/acp_main.php
parent9ac79453e12e5840f8fa06a6323fb67b132726c1 (diff)
parent240d07d0cf82604fca83c506afdb20ffa3ec9261 (diff)
downloadforums-886fb7c3f4f8e8221579a0313ab73d0fe87a173e.tar
forums-886fb7c3f4f8e8221579a0313ab73d0fe87a173e.tar.gz
forums-886fb7c3f4f8e8221579a0313ab73d0fe87a173e.tar.bz2
forums-886fb7c3f4f8e8221579a0313ab73d0fe87a173e.tar.xz
forums-886fb7c3f4f8e8221579a0313ab73d0fe87a173e.zip
Merge branch '3.1.x'
* 3.1.x: [ticket/14159] Hide version info on ACP if we don't have the permission
Diffstat (limited to 'phpBB/includes/acp/acp_main.php')
-rw-r--r--phpBB/includes/acp/acp_main.php31
1 files changed, 20 insertions, 11 deletions
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 47e2660770..529c3a1835 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -434,21 +434,29 @@ class acp_main
));
}
- /* @var $version_helper \phpbb\version_helper */
- $version_helper = $phpbb_container->get('version_helper');
- try
+ if ($auth->acl_get('a_board'))
{
- $recheck = $request->variable('versioncheck_force', false);
- $updates_available = $version_helper->get_suggested_updates($recheck);
+ /* @var $version_helper \phpbb\version_helper */
+ $version_helper = $phpbb_container->get('version_helper');
+ try
+ {
+ $recheck = $request->variable('versioncheck_force', false);
+ $updates_available = $version_helper->get_suggested_updates($recheck);
- $template->assign_var('S_VERSION_UP_TO_DATE', empty($updates_available));
+ $template->assign_var('S_VERSION_UP_TO_DATE', empty($updates_available));
+ }
+ catch (\RuntimeException $e)
+ {
+ $template->assign_vars(array(
+ 'S_VERSIONCHECK_FAIL' => true,
+ 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '',
+ ));
+ }
}
- catch (\RuntimeException $e)
+ else
{
- $template->assign_vars(array(
- 'S_VERSIONCHECK_FAIL' => true,
- 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '',
- ));
+ // We set this template var to true, to not display an outdated version notice.
+ $template->assign_var('S_VERSION_UP_TO_DATE', true);
}
/**
@@ -559,6 +567,7 @@ class acp_main
'U_VERSIONCHECK' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&amp;mode=version_check'),
'U_VERSIONCHECK_FORCE' => append_sid("{$phpbb_admin_path}index.$phpEx", 'versioncheck_force=1'),
+ 'S_VERSIONCHECK' => ($auth->acl_get('a_board')) ? true : false,
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
)