1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 03:34:04 +02:00

- Display version check on ACP main page.

- Cache version check.

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9880 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Marek A. R
2009-07-28 13:58:01 +00:00
parent 6510aef869
commit da169625a6
7 changed files with 88 additions and 11 deletions

View File

@@ -395,6 +395,25 @@ class acp_main
}
}
// Version check
$user->add_lang('install');
$latest_version_info = false;
if (($latest_version_info = obtain_latest_version_info(request_var('versioncheck_force', false))) === false)
{
$template->assign_var('S_VERSIONCHECK_FAIL', true);
}
else
{
$latest_version_info = explode("\n", $latest_version_info);
$latest_version = trim($latest_version_info[0]);
$template->assign_var('S_VERSION_UP_TO_DATE',
version_compare(
str_replace('rc', 'RC', strtolower($config['version'])),
str_replace('rc', 'RC', strtolower($latest_version)),
'<') ? false : true);
}
// Get forum statistics
$total_posts = $config['num_posts'];
$total_topics = $config['num_topics'];
@@ -492,6 +511,8 @@ class acp_main
'U_ACTION' => $this->u_action,
'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
'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", 'i=1&amp;versioncheck_force=1'),
'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,

View File

@@ -37,12 +37,7 @@ class acp_update
$errstr = '';
$errno = 0;
$info = get_remote_file('www.phpbb.com', '/updatecheck', ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
if ($info === false)
{
trigger_error($errstr, E_USER_WARNING);
}
$info = obtain_latest_version_info(request_var('versioncheck_force', false), true);
$info = explode("\n", $info);
$latest_version = trim($info[0]);
@@ -68,6 +63,7 @@ class acp_update
'S_UP_TO_DATE_AUTO' => $up_to_date_automatic,
'S_VERSION_CHECK' => true,
'U_ACTION' => $this->u_action,
'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&amp;versioncheck_force=1'),
'LATEST_VERSION' => $latest_version,
'CURRENT_VERSION' => $config['version'],