Better theme version check (bug #1023029).
This commit is contained in:
@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
|
||||
$Id$
|
||||
$Source$
|
||||
|
||||
2004-09-14 Michal Čihař <michal@cihar.com>
|
||||
* themes.php, libraries/common.lib.php, libraries/defines.lib.php,
|
||||
libraries/select_theme.lib.php, themes/darkblue_orange/info.inc.php,
|
||||
themes/original/info.inc.php: Better theme version check (bug #1023029).
|
||||
|
||||
2004-09-13 Garvin Hicking <me@supergarv.de>
|
||||
* browse_foreigners.php: bug #1027204 - paging did not
|
||||
work in foreigner browsing window.
|
||||
|
@@ -327,13 +327,16 @@ if (!isset($_COOKIE['pma_theme']) || empty($_COOKIE['pma_theme'])){
|
||||
}
|
||||
|
||||
// check for theme requires/name
|
||||
unset($theme_name, $theme_version);
|
||||
unset($theme_name, $theme_generation, $theme_version);
|
||||
@include($cfg['ThemePath'] . '/' . $GLOBALS['theme'] . '/info.inc.php');
|
||||
|
||||
// did it set correctly?
|
||||
if (!isset($theme_name, $theme_version))
|
||||
if (!isset($theme_name, $theme_generation, $theme_version))
|
||||
$GLOBALS['theme'] = 'original'; // invalid theme
|
||||
|
||||
if ($theme_generation != PMA_THEME_GENERATION)
|
||||
$GLOBALS['theme'] = 'original'; // different generation
|
||||
|
||||
if ($theme_version < PMA_THEME_VERSION)
|
||||
$GLOBALS['theme'] = 'original'; // too old version
|
||||
|
||||
|
@@ -7,6 +7,7 @@
|
||||
* Overview:
|
||||
* PMA_VERSION (string) - phpMyAdmin version string
|
||||
* PMA_THEME_VERSION (int) - phpMyAdmin theme version integer
|
||||
* PMA_THEME_GENERATION (int) - phpMyAdmin theme generation integer
|
||||
* PMA_PHP_INT_VERSION (int) - eg: 30017 instead of 3.0.17 or
|
||||
* 40006 instead of 4.0.6RC3
|
||||
* PMA_IS_WINDOWS (bool) - mark if phpMyAdmin running on windows
|
||||
@@ -26,6 +27,10 @@ if (!defined('PMA_THEME_VERSION')) {
|
||||
define('PMA_THEME_VERSION', 1);
|
||||
}
|
||||
|
||||
if (!defined('PMA_THEME_GENERATION')) {
|
||||
define('PMA_THEME_GENERATION', 1);
|
||||
}
|
||||
|
||||
// php version
|
||||
if (!defined('PMA_PHP_INT_VERSION')) {
|
||||
if (!preg_match('@([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2})@', phpversion(), $match)) {
|
||||
|
@@ -55,13 +55,16 @@ if ($PMA_ThemeAvailable == TRUE) { // themeManager is available
|
||||
if ($PMA_Theme != "." && $PMA_Theme != ".." && $PMA_Theme != 'CVS') { // file check
|
||||
if (@is_dir($cfg['ThemePath'].'/'.$PMA_Theme)) { // check the theme
|
||||
// check for theme requires/name
|
||||
unset($theme_name, $theme_version);
|
||||
unset($theme_name, $theme_generation, $theme_version);
|
||||
@include($cfg['ThemePath'] . '/' . $PMA_Theme . '/info.inc.php');
|
||||
|
||||
// did it set correctly?
|
||||
if (!isset($theme_name, $theme_version))
|
||||
if (!isset($theme_name, $theme_version, $theme_generation))
|
||||
continue; // invalid theme
|
||||
|
||||
if ($theme_generation != PMA_THEME_GENERATION)
|
||||
continue; // different generation
|
||||
|
||||
if ($theme_version < PMA_THEME_VERSION)
|
||||
continue; // too old version
|
||||
|
||||
|
@@ -90,13 +90,16 @@ if ($handleThemes = opendir($path_to_themes)) { // open themes
|
||||
$screen_directory = $path_to_themes . $PMA_Theme;
|
||||
|
||||
// check for theme requires/name
|
||||
unset($theme_name, $theme_version);
|
||||
unset($theme_name, $theme_generation, $theme_version);
|
||||
@include($path_to_themes . $PMA_Theme . '/info.inc.php');
|
||||
|
||||
// did it set correctly?
|
||||
if (!isset($theme_name, $theme_version))
|
||||
if (!isset($theme_name, $theme_generation, $theme_version))
|
||||
continue; // invalid theme
|
||||
|
||||
if ($theme_generation != PMA_THEME_GENERATION)
|
||||
continue; // different generation
|
||||
|
||||
if ($theme_version < PMA_THEME_VERSION)
|
||||
continue; // too old version
|
||||
|
||||
|
@@ -3,4 +3,5 @@
|
||||
/* Theme information */
|
||||
$theme_name = 'Darkblue/orange';
|
||||
$theme_version = 1;
|
||||
$theme_generation = 1;
|
||||
?>
|
||||
|
@@ -3,4 +3,5 @@
|
||||
/* Theme information */
|
||||
$theme_name = 'Original';
|
||||
$theme_version = 1;
|
||||
$theme_generation = 1;
|
||||
?>
|
||||
|
Reference in New Issue
Block a user