Compare commits
2 Commits
41d9e77a5b
...
46e8124525
Author | SHA1 | Date | |
---|---|---|---|
46e8124525 | |||
fe090bc88f |
@@ -86,25 +86,6 @@ function parseVersionString (str) {
|
||||
return maj * 100000000 + min * 1000000 + pat * 10000 + hotfix * 100 + add;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates current available version on main page.
|
||||
*/
|
||||
function PMA_current_version() {
|
||||
var current = parseVersionString(pmaversion);
|
||||
var latest = parseVersionString(PMA_latest_version);
|
||||
$('#li_pma_version').append(PMA_messages['strLatestAvailable'] + ' ' + PMA_latest_version);
|
||||
if (latest > current) {
|
||||
var message = $.sprintf(PMA_messages['strNewerVersion'], PMA_latest_version, PMA_latest_date);
|
||||
if (Math.floor(latest / 10000) == Math.floor(current / 10000)) {
|
||||
/* Security update */
|
||||
klass = 'error';
|
||||
} else {
|
||||
klass = 'notice';
|
||||
}
|
||||
$('#maincontainer').after('<div class="' + klass + '">' + message + '</div>');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* for libraries/display_change_password.lib.php
|
||||
* libraries/user_password.php
|
||||
@@ -2197,13 +2178,6 @@ $(document).ready(function() {
|
||||
$(this).closest("form").submit();
|
||||
});
|
||||
|
||||
/**
|
||||
* Load version information asynchronously.
|
||||
*/
|
||||
if ($('.jsversioncheck').length > 0) {
|
||||
$.getScript('http://www.phpmyadmin.net/home_page/version.js', PMA_current_version);
|
||||
}
|
||||
|
||||
/**
|
||||
* Slider effect.
|
||||
*/
|
||||
|
@@ -96,7 +96,7 @@ class PMA_Config
|
||||
*/
|
||||
function checkSystem()
|
||||
{
|
||||
$this->set('PMA_VERSION', '3.4.11.1');
|
||||
$this->set('PMA_VERSION', 'Retro');
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
|
@@ -174,7 +174,7 @@ $cfg['Servers'][$i]['controlpass'] = '';
|
||||
*
|
||||
* @global string $cfg['Servers'][$i]['auth_type']
|
||||
*/
|
||||
$cfg['Servers'][$i]['auth_type'] = 'cookie';
|
||||
$cfg['Servers'][$i]['auth_type'] = 'http';
|
||||
|
||||
/**
|
||||
* HTTP Basic Auth Realm name to display (only used with 'HTTP' auth_type)
|
||||
@@ -501,13 +501,6 @@ $cfg['ServerDefault'] = 1;
|
||||
*/
|
||||
$cfg['AjaxEnable'] = true;
|
||||
|
||||
/**
|
||||
* whether version check is active
|
||||
*
|
||||
* @global boolean $cfg['VersionCheck']
|
||||
*/
|
||||
$cfg['VersionCheck'] = VERSION_CHECK_DEFAULT;
|
||||
|
||||
/**
|
||||
* maximum number of db's displayed in left frame and database list
|
||||
*
|
||||
|
@@ -55,11 +55,6 @@ define('CUSTOM_HEADER_FILE', CONFIG_DIR . 'config.header.inc.php');
|
||||
*/
|
||||
define('CUSTOM_FOOTER_FILE', CONFIG_DIR . 'config.footer.inc.php');
|
||||
|
||||
/**
|
||||
* Default value for check for version upgrades.
|
||||
*/
|
||||
define('VERSION_CHECK_DEFAULT', true);
|
||||
|
||||
/**
|
||||
* Path to gettext.inc file. Useful when you want php-gettext somewhere else,
|
||||
* eg. /usr/share/php/gettext/gettext.inc.
|
||||
|
@@ -26,13 +26,6 @@ $separator = PMA_get_arg_separator('html');
|
||||
// message handling
|
||||
messages_begin();
|
||||
|
||||
//
|
||||
// Check phpMyAdmin version
|
||||
//
|
||||
if (isset($_GET['version_check'])) {
|
||||
PMA_version_check();
|
||||
}
|
||||
|
||||
//
|
||||
// Perform various security, compatibility and consistency checks
|
||||
//
|
||||
@@ -226,5 +219,4 @@ display_form_bottom();
|
||||
<div id="footer">
|
||||
<a href="http://phpmyadmin.net"><?php echo __('phpMyAdmin homepage') ?></a>
|
||||
<a href="http://sourceforge.net/donate/index.php?group_id=23067"><?php echo __('Donate') ?></a>
|
||||
<a href="?version_check=1<?php echo "{$separator}token=" . $_SESSION[' PMA_token '] ?>"><?php echo __('Check for latest version') ?></a>
|
||||
</div>
|
||||
|
@@ -89,84 +89,6 @@ function messages_show_html()
|
||||
echo "\n</script>\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for newest phpMyAdmin version and sets result as a new notice
|
||||
*/
|
||||
function PMA_version_check()
|
||||
{
|
||||
// version check messages should always be visible so let's make
|
||||
// a unique message id each time we run it
|
||||
$message_id = uniqid('version_check');
|
||||
// wait 3s at most for server response, it's enough to get information
|
||||
// from a working server
|
||||
$connection_timeout = 3;
|
||||
|
||||
$url = 'http://phpmyadmin.net/home_page/version.php';
|
||||
$context = stream_context_create(array(
|
||||
'http' => array(
|
||||
'timeout' => $connection_timeout)));
|
||||
$data = @file_get_contents($url, null, $context);
|
||||
if ($data === false) {
|
||||
if (function_exists('curl_init')) {
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_HEADER, false);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $connection_timeout);
|
||||
$data = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
} else {
|
||||
messages_set('error', $message_id, __('Version check'),
|
||||
__('Neither URL wrapper nor CURL is available. Version check is not possible.'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($data)) {
|
||||
messages_set('error', $message_id, __('Version check'),
|
||||
__('Reading of version failed. Maybe you\'re offline or the upgrade server does not respond.'));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Format: version\ndate\n(download\n)* */
|
||||
$data_list = explode("\n", $data);
|
||||
|
||||
if (count($data_list) > 1) {
|
||||
$version = $data_list[0];
|
||||
$date = $data_list[1];
|
||||
} else {
|
||||
$version = $date = '';
|
||||
}
|
||||
|
||||
$version_upstream = version_to_int($version);
|
||||
if ($version_upstream === false) {
|
||||
messages_set('error', $message_id, __('Version check'),
|
||||
__('Got invalid version string from server'));
|
||||
return;
|
||||
}
|
||||
|
||||
$version_local = version_to_int($GLOBALS['PMA_Config']->get('PMA_VERSION'));
|
||||
if ($version_local === false) {
|
||||
messages_set('error', $message_id, __('Version check'),
|
||||
__('Unparsable version string'));
|
||||
return;
|
||||
}
|
||||
|
||||
if ($version_upstream > $version_local) {
|
||||
$version = htmlspecialchars($version);
|
||||
$date = htmlspecialchars($date);
|
||||
messages_set('notice', $message_id, __('Version check'),
|
||||
sprintf(__('A newer version of phpMyAdmin is available and you should consider upgrading. The newest version is %s, released on %s.'), $version, $date));
|
||||
} else {
|
||||
if ($version_local % 100 == 0) {
|
||||
messages_set('notice', $message_id, __('Version check'),
|
||||
PMA_sanitize(sprintf(__('You are using Git version, run [kbd]git pull[/kbd] :-)[br]The latest stable version is %s, released on %s.'), $version, $date)));
|
||||
} else {
|
||||
messages_set('notice', $message_id, __('Version check'),
|
||||
__('No newer stable version is available'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates numerical equivalent of phpMyAdmin version string
|
||||
*
|
||||
|
@@ -111,15 +111,6 @@ div.notice h4 {
|
||||
border-color: #FFD700;
|
||||
}
|
||||
|
||||
div.notice[id^=version_check] {
|
||||
border-color: #002DFF;
|
||||
background-color: #EEF;
|
||||
}
|
||||
|
||||
div.notice[id^=version_check] h4 {
|
||||
border-color: #002DFF;
|
||||
}
|
||||
|
||||
div.warning {
|
||||
border-color: #C00;
|
||||
background-color: #FFC;
|
||||
|
Reference in New Issue
Block a user