This commit was manufactured by cvs2svn to create branch 'MAINT_2_9_0'.

This commit is contained in:
Michal Čihař
2006-09-29 21:12:52 +00:00
parent 37319e821b
commit 59a92cd8ff
92 changed files with 7318 additions and 7371 deletions

View File

@@ -10,10 +10,12 @@ chdir('..');
require_once('./libraries/common.lib.php');
// Grab configuration defaults
$PMA_Config = new PMA_Config();
// Do not use $PMA_Config, it interferes with the one in $_SESSION
// on servers with register_globals enabled
$PMA_Config_Setup = new PMA_Config();
// Script information
$script_info = 'phpMyAdmin ' . $PMA_Config->get('PMA_VERSION') . ' setup script by Michal Čihař <michal@cihar.com>';
$script_info = 'phpMyAdmin ' . $PMA_Config_Setup->get('PMA_VERSION') . ' setup script by Michal Čihař <michal@cihar.com>';
$script_version = '$Id$';
// Grab action
@@ -60,7 +62,7 @@ echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
<head>
<link rel="icon" href="../favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<title>phpMyAdmin <?php echo $PMA_Config->get('PMA_VERSION'); ?> setup</title>
<title>phpMyAdmin <?php echo $PMA_Config_Setup->get('PMA_VERSION'); ?> setup</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" language="javascript">
@@ -214,7 +216,7 @@ echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
</head>
<body>
<h1>phpMyAdmin <?php echo $PMA_Config->get('PMA_VERSION'); ?> setup</h1>
<h1>phpMyAdmin <?php echo $PMA_Config_Setup->get('PMA_VERSION'); ?> setup</h1>
<?php
} // end show html header
@@ -369,19 +371,19 @@ function footer() {
* @return string authentication method description
*/
function get_server_auth($val) {
global $PMA_Config;
global $PMA_Config_Setup;
if (isset($val['auth_type'])) {
$auth = $val['auth_type'];
} else {
$auth = $PMA_Config->default_server['auth_type'];
$auth = $PMA_Config_Setup->default_server['auth_type'];
}
$ret = $auth;
if ($auth == 'config') {
if (isset($val['user'])) {
$ret .= ':' . $val['user'];
} else {
$ret .= ':' . $PMA_Config->default_server['user'];
$ret .= ':' . $PMA_Config_Setup->default_server['user'];
}
}
return $ret;
@@ -632,7 +634,7 @@ function show_overview($title, $list, $buttons = '') {
}
/**
* Displays configuration, fallback defaults are taken from global $PMA_Config
* Displays configuration, fallback defaults are taken from global $PMA_Config_Setup
*
* @param array list of values to display (each element is array of two or
* three values - desription, name and optional type
@@ -648,7 +650,7 @@ function show_overview($title, $list, $buttons = '') {
* @return nothing
*/
function show_config_form($list, $legend, $help, $defaults = array(), $save = '', $prefix = '') {
global $PMA_Config;
global $PMA_Config_Setup;
if (empty($save)) {
$save = 'Update';
@@ -677,7 +679,7 @@ function show_config_form($list, $legend, $help, $defaults = array(), $save = ''
if (isset($defaults[$val[1]])) {
echo ' value="' . htmlspecialchars($defaults[$val[1]]) . '"';
} else {
echo ' value="' . htmlspecialchars($PMA_Config->get($val[1])) . '"';
echo ' value="' . htmlspecialchars($PMA_Config_Setup->get($val[1])) . '"';
}
echo ' />';
break;
@@ -688,7 +690,7 @@ function show_config_form($list, $legend, $help, $defaults = array(), $save = ''
echo ' checked="checked"';
}
} else {
if ($PMA_Config->get($val[1])) {
if ($PMA_Config_Setup->get($val[1])) {
echo ' checked="checked"';
}
}
@@ -711,7 +713,7 @@ function show_config_form($list, $legend, $help, $defaults = array(), $save = ''
}
}
} else {
$def_val = $PMA_Config->get($val[1]);
$def_val = $PMA_Config_Setup->get($val[1]);
if (is_bool($val)) {
if (($def_val && $opt == 'TRUE') || (!$def_val && $opt == 'FALSE')) {
echo ' selected="selected"';
@@ -759,7 +761,7 @@ function show_security_form($defaults = array()) {
array('Show phpinfo output', 'ShowPhpInfo', 'Whether to allow users to see phpinfo() output', FALSE),
array('Show password change form', 'ShowChgPassword', 'Whether to show form for changing password, this does not limit ability to execute the same command directly', FALSE),
array('Allow login to any MySQL server', 'AllowArbitraryServer', 'If enabled user can enter any MySQL server in login form for cookie auth.', FALSE),
array('Recall user name', 'LoginCookieRecall', 'Whether to recall user name while using cookie auth.', TRUE),
array('Recall user name', 'LoginCookieRecall', 'Whether to recall user name on log in prompt while using cookie auth.', TRUE),
array('Login cookie validity', 'LoginCookieValidity', 'How long is login valid without performing any action.'),
),
'Configure security features',
@@ -804,7 +806,7 @@ function show_manual_form($defaults = array()) {
* @return nothing
*/
function show_charset_form($defaults = array()) {
global $PMA_Config;
global $PMA_Config_Setup;
?>
<form method="post" action="">
<input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
@@ -813,7 +815,7 @@ function show_charset_form($defaults = array()) {
echo get_hidden_cfg();
show_config_form(array(
array('Allow charset conversion', 'AllowAnywhereRecoding', 'If you want to use such functions.', FALSE),
array('Default charset', 'DefaultCharset', 'Default charset for conversion.', $PMA_Config->get('AvailableCharsets')),
array('Default charset', 'DefaultCharset', 'Default charset for conversion.', $PMA_Config_Setup->get('AvailableCharsets')),
array('Recoding engine', 'RecodingEngine', 'PHP can contain iconv and/or recode, select which one to use or keep autodetection.', array('auto', 'iconv', 'recode')),
array('Extra params for iconv', 'IconvExtraParams', 'Iconv can get some extra parameters for conversion see man iconv_open.'),
),
@@ -858,7 +860,7 @@ function show_extensions_form($defaults = array()) {
* @return nothing
*/
function show_relation_form($defaults = array()) {
global $PMA_Config;
global $PMA_Config_Setup;
?>
<form method="post" action="">
<input type="hidden" name="token" value="<?php echo $_SESSION['PMA_token']; ?>" />
@@ -869,10 +871,10 @@ function show_relation_form($defaults = array()) {
array('Permanent query history', 'QueryHistoryDB', 'Store history into database.', FALSE),
array('Maximal history size', 'QueryHistoryMax', 'How many queries are kept in history.'),
array('Use MIME transformations', 'BrowseMIME', 'Use MIME transformations while browsing.', TRUE),
array('PDF default page size', 'PDFDefaultPageSize', 'Default page size for PDF, you can change this while creating page.', $PMA_Config->get('PDFPageSizes')),
array('PDF default page size', 'PDFDefaultPageSize', 'Default page size for PDF, you can change this while creating page.', $PMA_Config_Setup->get('PDFPageSizes')),
),
'Configure MIME/relation/history',
'phpMyAdmin can provide additional featrues like MIME transformation, internal relations, permanent history and PDF pages generating. You have to configure database and tables that will store such information on server page. Behaviour of those functions is configured here.',
'phpMyAdmin can provide additional features like MIME transformation, internal relations, permanent history and PDF pages generation. You have to configure the database and tables that will store this information on the server page. Behaviour of those functions is configured here.',
$defaults);
?>
</form>
@@ -931,9 +933,9 @@ function show_server_form($defaults = array(), $number = FALSE) {
}
show_config_form(array(
array('Server hostname', 'host', 'Hostname where MySQL server is running'),
array('Server port', 'port', 'Port on which MySQL server is listening, leave empty if don\'t know'),
array('Server socket', 'socket', 'Socket on which MySQL server is listening, leave empty if don\'t know'),
array('Connection type', 'connect_type', 'How to connect to server, keep tcp if don\'t know', array('tcp', 'socket')),
array('Server port', 'port', 'Port on which MySQL server is listening, leave empty for default'),
array('Server socket', 'socket', 'Socket on which MySQL server is listening, leave empty for default'),
array('Connection type', 'connect_type', 'How to connect to server, keep tcp if unsure', array('tcp', 'socket')),
array('PHP extension to use', 'extension', 'What PHP extension to use, use mysqli if supported', array('mysql', 'mysqli')),
array('Compress connection', 'compress', 'Whether to compress connection to MySQL server', FALSE),
array('Authentication type', 'auth_type', 'Authentication method to use', array('cookie', 'http', 'config')),
@@ -972,13 +974,13 @@ function show_left_form($defaults = array()) {
array('Display databases in tree', 'LeftFrameDBTree', 'Whether to display databases in tree (determined by separator defined lower)', TRUE),
array('Databases tree separator', 'LeftFrameDBSeparator', 'String that separates databases into different tree level'),
array('Table tree separator', 'LeftFrameTableSeparator', 'String that separates tables into different tree level'),
array('Maximum table tree nesting', 'LeftFrameTableLevel', 'Maximum number of childs in table tree'),
array('Maximum table tree nesting', 'LeftFrameTableLevel', 'Maximum number of children in table tree'),
array('Show logo', 'LeftDisplayLogo', 'Whether to show logo in left frame', TRUE),
array('Display servers selection', 'LeftDisplayServers', 'Whether to show server selection in left frame', FALSE),
array('Enable pointer highlighting', 'LeftPointerEnable', 'Whether you want to highlight server under mouse', TRUE),
),
'Configure left frame',
'Choose how do you like left frame.',
'Customize the appears of the navigation frame.',
$defaults);
?>
</form>
@@ -1094,7 +1096,7 @@ function show_edit_form($defaults = array()) {
array('Textarea columns', 'TextareaCols', 'Number of columns in textarea while editing TEXT fields'),
array('Textarea rows', 'TextareaRows', 'Number of rows in textarea while editing TEXT fields'),
array('Double textarea for LONGTEXT', 'LongtextDoubleTextarea', 'Whether to double textarea size for LONGTEXT fields', TRUE),
array('Edit CHAR fields in textarea', 'CharEditing', 'Whether to edit CHAR fields in textaread', array('input', 'textarea')),
array('Edit CHAR fields in textarea', 'CharEditing', 'Whether to edit CHAR fields in textarea', array('input', 'textarea')),
array('CHAR textarea columns', 'CharTextareaCols', 'Number of columns in textarea while editing CHAR fields (must be enabled above)'),
array('CHAR textarea rows', 'CharTextareaRows', 'Number of rows in textarea while editing CHAR fields (must be enabled above)'),
),
@@ -1339,7 +1341,7 @@ switch ($action) {
case 'addserver':
if (count($configuration['Servers']) == 0) {
// First server will use defaults as in config.default.php
$defaults = $PMA_Config->default_server;
$defaults = $PMA_Config_Setup->default_server;
unset($defaults['AllowDeny']); // Ignore this for now
} else {
$defaults = array();
@@ -1357,7 +1359,7 @@ switch ($action) {
} elseif (function_exists('mysql_get_client_info')) {
$defaults['extension'] = 'mysql';
} else {
message('warning', 'Could not load neither mysql nor mysqli extension, you might not be able to use phpMyAdmin!');
message('warning', 'Could not load either mysql or mysqli extension, you might not be able to use phpMyAdmin! Check your PHP configuration.');
}
if (isset($defaults['extension'])) {
message('notice', 'Autodetected MySQL extension to use: ' . $defaults['extension']);
@@ -1391,7 +1393,7 @@ switch ($action) {
$data[] = array('Verbose name', $srv['verbose']);
}
$data[] = array('Host', $srv['host']);
$data[] = array('MySQL extension', isset($srv['extension']) ? $srv['extension'] : $PMA_Config->default_server['extension']);
$data[] = array('MySQL extension', isset($srv['extension']) ? $srv['extension'] : $PMA_Config_Setup->default_server['extension']);
$data[] = array('Authentication type', get_server_auth($srv));
$data[] = array('phpMyAdmin advanced features', empty($srv['pmadb']) || empty($srv['controluser']) || empty($srv['controlpass']) ? 'disabled' : 'enabled, db: ' . $srv['pmadb'] . ', user: ' . $srv['controluser']);
$buttons =
@@ -1467,7 +1469,7 @@ switch ($action) {
$vals = grab_values('MySQLManualBase;MySQLManualType');
$err = FALSE;
if ($vals['MySQLManualType'] != 'none' && empty($vals['MySQLManualBase'])) {
message('error', 'You need to set manual base URL or choone none type.');
message('error', 'You need to set manual base URL or choose type \'none\'.');
$err = TRUE;
}
if ($err) {
@@ -1512,7 +1514,7 @@ switch ($action) {
if (!@extension_loaded('iconv')) {
PMA_dl('recode');
if (!@extension_loaded('recode')) {
message('warning', 'Could not load neither recode nor iconv so charset conversion will most likely not work.');
message('warning', 'Neither recode nor iconv could be loaded so charset conversion will most likely not work.');
} else {
$d['RecodingEngine'] = 'recode';
}
@@ -1569,7 +1571,7 @@ switch ($action) {
$vals = grab_values('QueryHistoryDB:bool;QueryHistoryMax:int;BrowseMIME:bool;PDFDefaultPageSize');
$err = FALSE;
if (isset($vals['QueryHistoryMax']) && $vals['QueryHistoryMax'] < 1) {
message('error', 'Invalid value for query maximal history size!');
message('error', 'Invalid value for query maximum history size!');
$err = TRUE;
}
if ($err) {
@@ -1787,7 +1789,7 @@ switch ($action) {
curl_close($ch);
}
if (empty($data)) {
message('error', 'Reading of version failed. Maybe you\'re offline or server does not respond.');
message('error', 'Reading of version failed. Maybe you\'re offline or the upgrade server does not respond.');
break;
}
@@ -1806,7 +1808,7 @@ switch ($action) {
break;
}
$version_local = version_to_int( $GLOBALS['PMA_Config']->get('PMA_VERSION') );
$version_local = version_to_int( $PMA_Config_Setup->get('PMA_VERSION') );
if ($version_local === FALSE) {
message('error', 'Unparsable version string.');
break;
@@ -1831,7 +1833,7 @@ switch ($action) {
case '':
message('notice', 'You want to configure phpMyAdmin using web interface. Please note that this only allows basic setup, please read <a href="../Documentation.html#config">documentation</a> to see full description of all configuration directives.', 'Welcome');
if ( $GLOBALS['PMA_Config']->get( 'PMA_PHP_INT_VERSION' ) < 40100) {
if ( $PMA_Config_Setup->get( 'PMA_PHP_INT_VERSION' ) < 40100) {
message('warning', 'Please upgrade to PHP 4.1.0, it is required for phpMyAdmin.', 'Too old PHP');
}