aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-09-02 13:39:21 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-09-02 13:39:21 +0000
commitf3b545bb593b61611883084dc91d279b93d8e21c (patch)
tree100d8e58517897e4ad65a634235c5e6e534967ed
parent49a94efe1f9abb06fbdd0422606b02cd17ffe054 (diff)
downloadforums-f3b545bb593b61611883084dc91d279b93d8e21c.tar
forums-f3b545bb593b61611883084dc91d279b93d8e21c.tar.gz
forums-f3b545bb593b61611883084dc91d279b93d8e21c.tar.bz2
forums-f3b545bb593b61611883084dc91d279b93d8e21c.tar.xz
forums-f3b545bb593b61611883084dc91d279b93d8e21c.zip
add version check to acp. Now no longer directly displayed at the acp index but accessible through the System tab and viewable by any admin (no special permisison needed).
git-svn-id: file:///svn/phpbb/trunk@6347 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/adm/style/acp_update.html40
-rw-r--r--phpBB/includes/acp/acp_update.php61
-rw-r--r--phpBB/includes/acp/info/acp_update.php37
3 files changed, 138 insertions, 0 deletions
diff --git a/phpBB/adm/style/acp_update.html b/phpBB/adm/style/acp_update.html
new file mode 100644
index 0000000000..06672f39ae
--- /dev/null
+++ b/phpBB/adm/style/acp_update.html
@@ -0,0 +1,40 @@
+<!-- INCLUDE overall_header.html -->
+
+<a name="maincontent"></a>
+
+<!-- IF S_VERSION_CHECK -->
+
+ <h1>{L_VERSION_CHECK}</h1>
+
+ <p>{L_VERSION_CHECK_EXPLAIN}</p>
+
+ <!-- IF S_UP_TO_DATE -->
+ <div class="successbox">
+ <p>{L_VERSION_UP_TO_DATE_ACP}</p>
+ </div>
+ <!-- ELSE -->
+ <div class="errorbox">
+ <p>{L_VERSION_NOT_UP_TO_DATE_ACP}</p>
+ </div>
+ <!-- ENDIF -->
+
+ <fieldset>
+ <legend></legend>
+ <dl>
+ <dt><label>{L_CURRENT_VERSION}</label></dt>
+ <dd><b>{CURRENT_VERSION}</b></dd>
+ </dl>
+ <dl>
+ <dt><label>{L_LATEST_VERSION}</label></dt>
+ <dd><b>{LATEST_VERSION}</b></dd>
+ </dl>
+ </fieldset>
+
+ <!-- IF not S_UP_TO_DATE -->
+ {UPDATE_INSTRUCTIONS}
+ <br /><br />
+ <!-- ENDIF -->
+
+<!-- ENDIF -->
+
+<!-- INCLUDE overall_footer.html --> \ No newline at end of file
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php
new file mode 100644
index 0000000000..fac20449bc
--- /dev/null
+++ b/phpBB/includes/acp/acp_update.php
@@ -0,0 +1,61 @@
+<?php
+/**
+*
+* @package acp
+* @version $Id$
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package acp
+*/
+class acp_update
+{
+ var $u_action;
+
+ function main($id, $mode)
+ {
+ global $config, $db, $user, $auth, $template, $cache;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx;
+
+ $user->add_lang('install');
+
+ $this->tpl_name = 'acp_update';
+ $this->page_title = 'ACP_UPDATE';
+
+ // Get current and latest version
+ $errstr = '';
+ $errno = 0;
+
+ $info = get_remote_file('www.phpbb.com', '/updatecheck', '30x.txt', $errstr, $errno);
+
+ if ($info === false)
+ {
+ trigger_error($errstr . adm_back_link($this->u_action));
+ }
+
+ $info = explode("\n", $info);
+ $latest_version = trim($info[0]);
+
+ $announcement_url = trim($info[1]);
+ $update_archive_link = 'http://www.phpbb.com/files/releases/phpBB-' . $config['version'] . '_to_' . $latest_version . '.zip';
+ $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
+
+ $up_to_date = (version_compare(strtolower($config['version']), strtolower($latest_version), '<')) ? false : true;
+
+ $template->assign_vars(array(
+ 'S_UP_TO_DATE' => $up_to_date,
+ 'S_VERSION_CHECK' => true,
+ 'U_ACTION' => $this->u_action,
+
+ 'LATEST_VERSION' => $latest_version,
+ 'CURRENT_VERSION' => $config['version'],
+
+ 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_archive_link, $update_link),
+ ));
+ }
+}
+
+?> \ No newline at end of file
diff --git a/phpBB/includes/acp/info/acp_update.php b/phpBB/includes/acp/info/acp_update.php
new file mode 100644
index 0000000000..014d67ff2b
--- /dev/null
+++ b/phpBB/includes/acp/info/acp_update.php
@@ -0,0 +1,37 @@
+<?php
+/**
+*
+* @package acp
+* @version $Id$
+* @copyright (c) 2005 phpBB Group
+* @license http://opensource.org/licenses/gpl-license.php GNU Public License
+*
+*/
+
+/**
+* @package module_install
+*/
+class acp_update_info
+{
+ function module()
+ {
+ return array(
+ 'filename' => 'acp_update',
+ 'title' => 'ACP_UPDATE',
+ 'version' => '1.0.0',
+ 'modes' => array(
+ 'version_check' => array('title' => 'ACP_VERSION_CHECK', 'auth' => 'acl_a_', 'cat' => array('ACP_AUTOMATION')),
+ ),
+ );
+ }
+
+ function install()
+ {
+ }
+
+ function uninstall()
+ {
+ }
+}
+
+?> \ No newline at end of file