diff options
| author | Marek A. R <aptx@phpbb.com> | 2009-07-28 13:58:01 +0000 |
|---|---|---|
| committer | Marek A. R <aptx@phpbb.com> | 2009-07-28 13:58:01 +0000 |
| commit | da169625a6a4e7682f0b3a2623f2081e52ad4a49 (patch) | |
| tree | 09ad1ecf555513d8fb3054a3dc2be5bf297a5f22 /phpBB/includes/acp | |
| parent | 6510aef869e455ae6748e4719cb6cb187264f4bb (diff) | |
| download | forums-da169625a6a4e7682f0b3a2623f2081e52ad4a49.tar forums-da169625a6a4e7682f0b3a2623f2081e52ad4a49.tar.gz forums-da169625a6a4e7682f0b3a2623f2081e52ad4a49.tar.bz2 forums-da169625a6a4e7682f0b3a2623f2081e52ad4a49.tar.xz forums-da169625a6a4e7682f0b3a2623f2081e52ad4a49.zip | |
- 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
Diffstat (limited to 'phpBB/includes/acp')
| -rw-r--r-- | phpBB/includes/acp/acp_main.php | 21 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_update.php | 8 |
2 files changed, 23 insertions, 6 deletions
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index f9d611f8db..8a5918b558 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -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&mode=admin'), 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&mode=list'), + 'U_VERSIONCHECK' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&mode=version_check'), + 'U_VERSIONCHECK_FORCE' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=1&versioncheck_force=1'), 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false, 'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false, diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php index dbb25bdbbd..121c72aeb3 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -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 . '&versioncheck_force=1'), 'LATEST_VERSION' => $latest_version, 'CURRENT_VERSION' => $config['version'], |
