mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00: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:
parent
6510aef869
commit
da169625a6
7 changed files with 88 additions and 11 deletions
|
@ -14,6 +14,22 @@
|
||||||
|
|
||||||
<p>{L_ADMIN_INTRO}</p>
|
<p>{L_ADMIN_INTRO}</p>
|
||||||
|
|
||||||
|
<!-- IF S_VERSIONCHECK_FAIL -->
|
||||||
|
<div class="errorbox notice">
|
||||||
|
<p>{L_VERSIONCHECK_FAIL} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> - <a href="{U_VERSIONCHECK}">{L_MORE}</a></p>
|
||||||
|
</div>
|
||||||
|
<!-- ELSE -->
|
||||||
|
<!-- IF S_VERSION_UP_TO_DATE -->
|
||||||
|
<div class="successbox">
|
||||||
|
<p>{L_VERSION_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> - <a href="{U_VERSIONCHECK}">{L_MORE}</a></p>
|
||||||
|
</div>
|
||||||
|
<!-- ELSE -->
|
||||||
|
<div class="errorbox">
|
||||||
|
<p>{L_VERSION_NOT_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> - <a href="{U_VERSIONCHECK}">{L_MORE}</a></p>
|
||||||
|
</div>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
<!-- ENDIF -->
|
||||||
|
|
||||||
<!-- IF S_REMOVE_INSTALL -->
|
<!-- IF S_REMOVE_INSTALL -->
|
||||||
<div class="errorbox">
|
<div class="errorbox">
|
||||||
<h3>{L_WARNING}</h3>
|
<h3>{L_WARNING}</h3>
|
||||||
|
|
|
@ -10,11 +10,11 @@
|
||||||
|
|
||||||
<!-- IF S_UP_TO_DATE and S_UP_TO_DATE_AUTO -->
|
<!-- IF S_UP_TO_DATE and S_UP_TO_DATE_AUTO -->
|
||||||
<div class="successbox">
|
<div class="successbox">
|
||||||
<p>{L_VERSION_UP_TO_DATE_ACP}</p>
|
<p>{L_VERSION_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
|
||||||
</div>
|
</div>
|
||||||
<!-- ELSE -->
|
<!-- ELSE -->
|
||||||
<div class="errorbox">
|
<div class="errorbox">
|
||||||
<p>{L_VERSION_NOT_UP_TO_DATE_ACP}</p>
|
<p>{L_VERSION_NOT_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
|
||||||
</div>
|
</div>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
|
||||||
|
|
|
@ -201,6 +201,7 @@
|
||||||
<li>[Change] Add confirm-box when deleting permissions (Bug #13673 - Patch by nickvergessen)</li>
|
<li>[Change] Add confirm-box when deleting permissions (Bug #13673 - Patch by nickvergessen)</li>
|
||||||
<li>[Change] Add pagination for icons and smilies in the ACP and smilies in the smiley popup</li>
|
<li>[Change] Add pagination for icons and smilies in the ACP and smilies in the smiley popup</li>
|
||||||
<li>[Change] Cache get_username_string() function calls on viewtopic.</li>
|
<li>[Change] Cache get_username_string() function calls on viewtopic.</li>
|
||||||
|
<li>[Change] Cache version check.</li>
|
||||||
<li>[Feature] Add language selection on the registration terms page (Bug #15085 - Patch by leviatan21)</li>
|
<li>[Feature] Add language selection on the registration terms page (Bug #15085 - Patch by leviatan21)</li>
|
||||||
<li>[Feature] Backported 3.2 captcha plugins.
|
<li>[Feature] Backported 3.2 captcha plugins.
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -247,6 +248,7 @@
|
||||||
<li>Show date of last reminder sent to user.</li>
|
<li>Show date of last reminder sent to user.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
<li>[Feature] Display version check on ACP main page.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<a name="v304"></a><h3>1.ii. Changes since 3.0.4</h3>
|
<a name="v304"></a><h3>1.ii. Changes since 3.0.4</h3>
|
||||||
|
|
|
@ -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
|
// Get forum statistics
|
||||||
$total_posts = $config['num_posts'];
|
$total_posts = $config['num_posts'];
|
||||||
$total_topics = $config['num_topics'];
|
$total_topics = $config['num_topics'];
|
||||||
|
@ -492,6 +511,8 @@ class acp_main
|
||||||
'U_ACTION' => $this->u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=admin'),
|
'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_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_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false,
|
||||||
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
|
'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
|
||||||
|
|
|
@ -37,12 +37,7 @@ class acp_update
|
||||||
$errstr = '';
|
$errstr = '';
|
||||||
$errno = 0;
|
$errno = 0;
|
||||||
|
|
||||||
$info = get_remote_file('www.phpbb.com', '/updatecheck', ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
|
$info = obtain_latest_version_info(request_var('versioncheck_force', false), true);
|
||||||
|
|
||||||
if ($info === false)
|
|
||||||
{
|
|
||||||
trigger_error($errstr, E_USER_WARNING);
|
|
||||||
}
|
|
||||||
|
|
||||||
$info = explode("\n", $info);
|
$info = explode("\n", $info);
|
||||||
$latest_version = trim($info[0]);
|
$latest_version = trim($info[0]);
|
||||||
|
@ -68,6 +63,7 @@ class acp_update
|
||||||
'S_UP_TO_DATE_AUTO' => $up_to_date_automatic,
|
'S_UP_TO_DATE_AUTO' => $up_to_date_automatic,
|
||||||
'S_VERSION_CHECK' => true,
|
'S_VERSION_CHECK' => true,
|
||||||
'U_ACTION' => $this->u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
|
'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&versioncheck_force=1'),
|
||||||
|
|
||||||
'LATEST_VERSION' => $latest_version,
|
'LATEST_VERSION' => $latest_version,
|
||||||
'CURRENT_VERSION' => $config['version'],
|
'CURRENT_VERSION' => $config['version'],
|
||||||
|
|
|
@ -3054,4 +3054,43 @@ function add_permission_language()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Obtains the latest version information
|
||||||
|
*
|
||||||
|
* @param bool $force_update Ignores cached data. Defaults to false.
|
||||||
|
* @param bool $warn_fail Trigger a warning if obtaining the latest version information fails. Defaults to false.
|
||||||
|
* @param int $ttl Cache version information for $ttl seconds. Defaults to 86400 (24 hours).
|
||||||
|
*
|
||||||
|
* @return string | false Version info on success, false on failure.
|
||||||
|
*/
|
||||||
|
function obtain_latest_version_info($force_update = false, $warn_fail = false, $ttl = 86400)
|
||||||
|
{
|
||||||
|
global $cache;
|
||||||
|
|
||||||
|
$info = $cache->get('versioncheck');
|
||||||
|
|
||||||
|
if ($info === false || $force_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)
|
||||||
|
{
|
||||||
|
$cache->destroy('versioncheck');
|
||||||
|
if ($warn_fail)
|
||||||
|
{
|
||||||
|
trigger_error($errstr, E_USER_WARNING);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$cache->put('versioncheck', $info, $ttl);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $info;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -249,6 +249,7 @@ $lang = array_merge($lang, array(
|
||||||
|
|
||||||
'MANAGE' => 'Manage',
|
'MANAGE' => 'Manage',
|
||||||
'MENU_TOGGLE' => 'Hide or display the side menu',
|
'MENU_TOGGLE' => 'Hide or display the side menu',
|
||||||
|
'MORE' => 'More »',
|
||||||
'MOVE_DOWN' => 'Move down',
|
'MOVE_DOWN' => 'Move down',
|
||||||
'MOVE_UP' => 'Move up',
|
'MOVE_UP' => 'Move up',
|
||||||
|
|
||||||
|
@ -374,9 +375,11 @@ $lang = array_merge($lang, array(
|
||||||
'UPLOAD_DIR_SIZE' => 'Size of posted attachments',
|
'UPLOAD_DIR_SIZE' => 'Size of posted attachments',
|
||||||
'USERS_PER_DAY' => 'Users per day',
|
'USERS_PER_DAY' => 'Users per day',
|
||||||
|
|
||||||
'VALUE' => 'Value',
|
'VALUE' => 'Value',
|
||||||
'VIEW_ADMIN_LOG' => 'View administrator log',
|
'VERSIONCHECK_FAIL' => 'Failed to obtain latest version',
|
||||||
'VIEW_INACTIVE_USERS' => 'View inactive users',
|
'VERSIONCHECK_FORCE_UPDATE' => 'Re-Check version',
|
||||||
|
'VIEW_ADMIN_LOG' => 'View administrator log',
|
||||||
|
'VIEW_INACTIVE_USERS' => 'View inactive users',
|
||||||
|
|
||||||
'WELCOME_PHPBB' => 'Welcome to phpBB',
|
'WELCOME_PHPBB' => 'Welcome to phpBB',
|
||||||
'WRITABLE_CONFIG' => 'Your config file (config.php) is currently world-writable. We strongly encourage you to change the permissions to 640 or at least to 644 (for example: <a href="http://en.wikipedia.org/wiki/Chmod" rel="external">chmod</a> 640 config.php).',
|
'WRITABLE_CONFIG' => 'Your config file (config.php) is currently world-writable. We strongly encourage you to change the permissions to 640 or at least to 644 (for example: <a href="http://en.wikipedia.org/wiki/Chmod" rel="external">chmod</a> 640 config.php).',
|
||||||
|
|
Loading…
Add table
Reference in a new issue