diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2008-12-24 14:08:15 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2008-12-24 14:08:15 +0000 |
commit | 68aa6bd29a0ea8c3e5b981677ace1ac188469bb8 (patch) | |
tree | bad33f1f9cd6d3efde039b2d11d250ad2dc9a960 /phpBB/modules/acp/acp_update.php | |
parent | 799ee3caae5de9f044ffad3e4d34010365a0005d (diff) | |
download | forums-68aa6bd29a0ea8c3e5b981677ace1ac188469bb8.tar forums-68aa6bd29a0ea8c3e5b981677ace1ac188469bb8.tar.gz forums-68aa6bd29a0ea8c3e5b981677ace1ac188469bb8.tar.bz2 forums-68aa6bd29a0ea8c3e5b981677ace1ac188469bb8.tar.xz forums-68aa6bd29a0ea8c3e5b981677ace1ac188469bb8.zip |
put acp, mcp and ucp into modules/ directory
git-svn-id: file:///svn/phpbb/trunk@9223 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/modules/acp/acp_update.php')
-rw-r--r-- | phpBB/modules/acp/acp_update.php | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/phpBB/modules/acp/acp_update.php b/phpBB/modules/acp/acp_update.php new file mode 100644 index 0000000000..a6440c8364 --- /dev/null +++ b/phpBB/modules/acp/acp_update.php @@ -0,0 +1,80 @@ +<?php +/** +* +* @package acp +* @version $Id$ +* @copyright (c) 2005 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* +*/ + +/** +* @ignore +*/ +if (!defined('IN_PHPBB')) +{ + exit; +} + +/** +* @package acp +*/ +class acp_update +{ + var $u_action; + + function main($id, $mode) + { + global $config, $db, $user, $auth, $template, $cache; + + $user->add_lang('install'); + + $this->tpl_name = 'acp_update'; + $this->page_title = 'ACP_VERSION_CHECK'; + + // Get current and latest version + $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 = explode("\n", $info); + $latest_version = trim($info[0]); + + $announcement_url = trim($info[1]); + $update_link = append_sid('install/index', 'mode=update'); + + // Determine automatic update... + $sql = 'SELECT config_value + FROM ' . CONFIG_TABLE . " + WHERE config_name = 'version_update_from'"; + $result = $db->sql_query($sql); + $version_update_from = (string) $db->sql_fetchfield('config_value'); + $db->sql_freeresult($result); + + $current_version = (!empty($version_update_from)) ? $version_update_from : $config['version']; + + $up_to_date_automatic = (version_compare(str_replace('rc', 'RC', strtolower($current_version)), str_replace('rc', 'RC', strtolower($latest_version)), '<')) ? false : true; + $up_to_date = (version_compare(str_replace('rc', 'RC', strtolower($config['version'])), str_replace('rc', 'RC', strtolower($latest_version)), '<')) ? false : true; + + $template->assign_vars(array( + 'S_UP_TO_DATE' => $up_to_date, + 'S_UP_TO_DATE_AUTO' => $up_to_date_automatic, + 'S_VERSION_CHECK' => true, + 'U_ACTION' => $this->u_action, + + 'LATEST_VERSION' => $latest_version, + 'CURRENT_VERSION' => $config['version'], + 'AUTO_VERSION' => $version_update_from, + + 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link), + )); + } +} + +?>
\ No newline at end of file |