libraries/*: $cfg system changes.

This commit is contained in:
Alexander M. Turek
2002-04-24 18:38:28 +00:00
parent a80446dd11
commit 04b272c39c
9 changed files with 147 additions and 209 deletions

View File

@@ -5,7 +5,10 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2004-04-24 Robin Johnson <robbat2@users.sourceforge.net> 2002-04-24 Alexander M. Turek <rabus@bugfixes.info>
* libraries/*: $cfg system changes.
2002-04-24 Robin Johnson <robbat2@users.sourceforge.net>
* *.php3 NOT tbl_*.php, Documentation.*: $cfg system changes. * *.php3 NOT tbl_*.php, Documentation.*: $cfg system changes.
2002-04-23 Marc Delisle <lem9@users.sourceforge.net> 2002-04-23 Marc Delisle <lem9@users.sourceforge.net>

View File

@@ -68,7 +68,7 @@ if (!defined('PMA_CONFIG_AUTH_INCLUDED')) {
function PMA_auth_fails() function PMA_auth_fails()
{ {
global $php_errormsg; global $php_errormsg;
global $connect_func, $server_port, $server_socket, $cfgServer; global $connect_func, $server_port, $server_socket, $cfg;
global $right_font_family, $font_size, $font_bigger; global $right_font_family, $font_size, $font_bigger;
if (mysql_error()) { if (mysql_error()) {
@@ -79,9 +79,9 @@ if (!defined('PMA_CONFIG_AUTH_INCLUDED')) {
$conn_error = 'Cannot connect: invalid settings.'; $conn_error = 'Cannot connect: invalid settings.';
} }
$local_query = $connect_func . '(' $local_query = $connect_func . '('
. $cfgServer['host'] . $server_port . $server_socket . ', ' . $cfg['Server']['host'] . $server_port . $server_socket . ', '
. $cfgServer['user'] . ', ' . $cfg['Server']['user'] . ', '
. $cfgServer['password'] . ')'; . $cfg['Server']['password'] . ')';
// Defines the charset to be used // Defines the charset to be used
header('Content-Type: text/html; charset=' . $GLOBALS['charset']); header('Content-Type: text/html; charset=' . $GLOBALS['charset']);
@@ -100,7 +100,7 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
</style> </style>
</head> </head>
<body bgcolor="<?php echo $GLOBALS['cfgRightBgColor']; ?>"> <body bgcolor="<?php echo $cfg['RightBgColor']; ?>">
<br /><br /> <br /><br />
<center> <center>
<h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION); ?></h1> <h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION); ?></h1>

View File

@@ -14,7 +14,7 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
// Gets the default font sizes // Gets the default font sizes
PMA_setFontSizes(); PMA_setFontSizes();
// Defines the cookie path and whether the server is using https or not // Defines the cookie path and whether the server is using https or not
$pma_uri_parts = parse_url($cfgPmaAbsoluteUri); $pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
$cookie_path = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/')); $cookie_path = substr($pma_uri_parts['path'], 0, strrpos($pma_uri_parts['path'], '/'));
$is_https = ($pma_uri_parts['scheme'] == 'https') ? 1 : 0; $is_https = ($pma_uri_parts['scheme'] == 'https') ? 1 : 0;
@@ -55,14 +55,14 @@ if (!defined('PMA_COOKIE_AUTH_INCLUDED')) {
function PMA_auth() function PMA_auth()
{ {
global $right_font_family, $font_size, $font_bigger; global $right_font_family, $font_size, $font_bigger;
global $cfgServers, $available_languages; global $cfg, $available_languages;
global $lang, $server; global $lang, $server;
global $HTTP_COOKIE_VARS; global $HTTP_COOKIE_VARS;
// Tries to get the username from cookie whatever are the values of the // Tries to get the username from cookie whatever are the values of the
// 'register_globals' and the 'variables_order' directives if last login // 'register_globals' and the 'variables_order' directives if last login
// should be recalled, else skip the IE autocomplete feature. // should be recalled, else skip the IE autocomplete feature.
if ($GLOBALS['cfgLoginCookieRecall']) { if ($cfg['LoginCookieRecall']) {
if (!empty($GLOBALS['pma_cookie_username'])) { if (!empty($GLOBALS['pma_cookie_username'])) {
$default_user = $GLOBALS['pma_cookie_username']; $default_user = $GLOBALS['pma_cookie_username'];
} }
@@ -104,14 +104,14 @@ input.textfield {font-family: <?php echo $right_font_family; ?>; font-size: <?ph
</style> </style>
</head> </head>
<body bgcolor="<?php echo $GLOBALS['cfgRightBgColor']; ?>"> <body bgcolor="<?php echo $cfg['RightBgColor']; ?>">
<center> <center>
<h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION . ' - ' . $GLOBALS['strLogin']); ?></h1> <h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION . ' - ' . $GLOBALS['strLogin']); ?></h1>
<br /> <br />
<?php <?php
// Displays the languages form // Displays the languages form
if (empty($cfgLang)) { if (empty($cfg['Lang'])) {
echo "\n"; echo "\n";
?> ?>
<!-- Language selection --> <!-- Language selection -->
@@ -165,7 +165,7 @@ input.textfield {font-family: <?php echo $right_font_family; ?>; font-size: <?ph
</td> </td>
</tr> </tr>
<?php <?php
if (count($cfgServers) > 1) { if (count($cfg['Servers']) > 1) {
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
@@ -175,8 +175,8 @@ input.textfield {font-family: <?php echo $right_font_family; ?>; font-size: <?ph
<?php <?php
echo "\n"; echo "\n";
// Displays the MySQL servers choice // Displays the MySQL servers choice
reset($cfgServers); reset($cfg['Servers']);
while (list($key, $val) = each($cfgServers)) { while (list($key, $val) = each($cfg['Servers'])) {
if (!empty($val['host'])) { if (!empty($val['host'])) {
echo ' <option value="' . $key . '"'; echo ' <option value="' . $key . '"';
if (!empty($server) && ($server == $key)) { if (!empty($server) && ($server == $key)) {
@@ -219,7 +219,7 @@ input.textfield {font-family: <?php echo $right_font_family; ?>; font-size: <?ph
<tr> <tr>
<td colspan="2" align="center"> <td colspan="2" align="center">
<?php <?php
if (count($cfgServers) == 1) { if (count($cfg['Servers']) == 1) {
echo ' <input type="hidden" name="server" value="' . $server . '" />'; echo ' <input type="hidden" name="server" value="' . $server . '" />';
} }
echo "\n"; echo "\n";
@@ -347,37 +347,37 @@ if (uname.value == '') {
*/ */
function PMA_auth_set_user() function PMA_auth_set_user()
{ {
global $cfgServers, $server, $cfgServer; global $cfg, $server;
global $PHP_AUTH_USER, $PHP_AUTH_PW; global $PHP_AUTH_USER, $PHP_AUTH_PW;
global $from_cookie; global $from_cookie;
// Ensures the valid 'only_db' setting is used // Ensures the valid 'only_db' setting is used
if ($cfgServer['user'] != $PHP_AUTH_USER) { if ($cfg['Server']['user'] != $PHP_AUTH_USER) {
$servers_cnt = count($cfgServers); $servers_cnt = count($cfg['Servers']);
for ($i = 1; $i <= $servers_cnt; $i++) { for ($i = 1; $i <= $servers_cnt; $i++) {
if (isset($cfgServers[$i]) if (isset($cfg['Servers'][$i])
&& ($cfgServers[$i]['host'] == $cfgServer['host'] && $cfgServers[$i]['user'] == $PHP_AUTH_USER)) { && ($cfg['Servers'][$i]['host'] == $cfg['Server']['host'] && $cfg['Servers'][$i]['user'] == $PHP_AUTH_USER)) {
$server = $i; $server = $i;
$cfgServer = $cfgServers[$i]; $cfg['Server'] = $cfg['Servers'][$i];
break; break;
} }
} // end for } // end for
} // end if } // end if
$cfgServer['user'] = $PHP_AUTH_USER; $cfg['Server']['user'] = $PHP_AUTH_USER;
$cfgServer['password'] = $PHP_AUTH_PW; $cfg['Server']['password'] = $PHP_AUTH_PW;
// Set cookies if required (once per session) // Set cookies if required (once per session)
if (!$from_cookie) { if (!$from_cookie) {
// Duration = one month for username // Duration = one month for username
setcookie('pma_cookie_username', setcookie('pma_cookie_username',
$cfgServer['user'], $cfg['Server']['user'],
time() + (60 * 60 * 24 * 30), time() + (60 * 60 * 24 * 30),
$GLOBALS['cookie_path'], '' , $GLOBALS['cookie_path'], '' ,
$GLOBALS['is_https']); $GLOBALS['is_https']);
// Duration = till the browser is closed for password // Duration = till the browser is closed for password
setcookie('pma_cookie_password', setcookie('pma_cookie_password',
$cfgServer['password'], $cfg['Server']['password'],
0, 0,
$GLOBALS['cookie_path'], '', $GLOBALS['cookie_path'], '',
$GLOBALS['is_https']); $GLOBALS['is_https']);

View File

@@ -25,7 +25,7 @@ if (!defined('PMA_HTTP_AUTH_INCLUDED')) {
{ {
global $right_font_family, $font_size, $font_bigger; global $right_font_family, $font_size, $font_bigger;
header('WWW-Authenticate: Basic realm="phpMyAdmin ' . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfgServer']['verbose']) ? str_replace('\'', '\\\'',$GLOBALS['cfgServer']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfgServer']['verbose']))) . '"'); header('WWW-Authenticate: Basic realm="phpMyAdmin ' . sprintf($GLOBALS['strRunning'], (empty($GLOBALS['cfg']['Server']['verbose']) ? str_replace('\'', '\\\'',$GLOBALS['cfg']['Server']['host']) : str_replace('\'', '\\\'', $GLOBALS['cfg']['Server']['verbose']))) . '"');
header('HTTP/1.0 401 Unauthorized'); header('HTTP/1.0 401 Unauthorized');
header('status: 401 Unauthorized'); header('status: 401 Unauthorized');
@@ -46,7 +46,7 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
</style> </style>
</head> </head>
<body bgcolor="<?php echo $GLOBALS['cfgRightBgColor']; ?>"> <body bgcolor="<?php echo $GLOBALS['cfg']['RightBgColor']; ?>">
<br /><br /> <br /><br />
<center> <center>
<h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION); ?></h1> <h1><?php echo sprintf($GLOBALS['strWelcome'], ' phpMyAdmin ' . PMA_VERSION); ?></h1>
@@ -220,24 +220,24 @@ h1 {font-family: <?php echo $right_font_family; ?>; font-size: <?php echo
*/ */
function PMA_auth_set_user() function PMA_auth_set_user()
{ {
global $cfgServers, $server, $cfgServer; global $cfg, $server;
global $PHP_AUTH_USER, $PHP_AUTH_PW; global $PHP_AUTH_USER, $PHP_AUTH_PW;
// Ensures the valid 'only_db' setting is used // Ensures the valid 'only_db' setting is used
if ($cfgServer['user'] != $PHP_AUTH_USER) { if ($cfg['Server']['user'] != $PHP_AUTH_USER) {
$servers_cnt = count($cfgServers); $servers_cnt = count($cfg['Servers']);
for ($i = 1; $i <= $servers_cnt; $i++) { for ($i = 1; $i <= $servers_cnt; $i++) {
if (isset($cfgServers[$i]) if (isset($cfg['Servers'][$i])
&& ($cfgServers[$i]['host'] == $cfgServer['host'] && $cfgServers[$i]['user'] == $PHP_AUTH_USER)) { && ($cfg['Servers'][$i]['host'] == $cfg['Server']['host'] && $cfg['Servers'][$i]['user'] == $PHP_AUTH_USER)) {
$server = $i; $server = $i;
$cfgServer = $cfgServers[$i]; $cfg['Server'] = $cfg['Servers'][$i];
break; break;
} }
} // end for } // end for
} // end if } // end if
$cfgServer['user'] = $PHP_AUTH_USER; $cfg['Server']['user'] = $PHP_AUTH_USER;
$cfgServer['password'] = $PHP_AUTH_PW; $cfg['Server']['password'] = $PHP_AUTH_PW;
return TRUE; return TRUE;
} // end of the 'PMA_auth_set_user()' function } // end of the 'PMA_auth_set_user()' function

View File

@@ -23,7 +23,6 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')){
*/ */
function PMA_getBookmarksParam() function PMA_getBookmarksParam()
{ {
global $cfgServer;
global $server; global $server;
$cfgBookmark = ''; $cfgBookmark = '';
@@ -33,9 +32,9 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')){
return ''; return '';
} }
$cfgBookmark['user'] = $cfgServer['user']; $cfgBookmark['user'] = $GLOBALS['cfg']['Server']['user'];
$cfgBookmark['db'] = $cfgServer['bookmarkdb']; $cfgBookmark['db'] = $GLOBALS['cfg']['Server']['bookmarkdb'];
$cfgBookmark['table'] = $cfgServer['bookmarktable']; $cfgBookmark['table'] = $GLOBALS['cfg']['Server']['bookmarktable'];
return $cfgBookmark; return $cfgBookmark;
} // end of the 'PMA_getBookmarksParam()' function } // end of the 'PMA_getBookmarksParam()' function
@@ -151,7 +150,7 @@ if (!defined('PMA_BOOKMARK_LIB_INCLUDED')){
/** /**
* Bookmark Support * Bookmark Support
*/ */
$cfgBookmark = PMA_getBookmarksParam(); $cfg['Bookmark'] = PMA_getBookmarksParam();
} // $__PMA_BOOKMARK_LIB__ } // $__PMA_BOOKMARK_LIB__

View File

@@ -208,7 +208,7 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
$replace = array('\0', '\n', '\r', '\Z'); $replace = array('\0', '\n', '\r', '\Z');
$current_row = 0; $current_row = 0;
@set_time_limit($GLOBALS['cfgExecTimeLimit']); @set_time_limit($GLOBALS['cfg']['ExecTimeLimit']);
// loic1: send a fake header to bypass browser timeout if data // loic1: send a fake header to bypass browser timeout if data
// are bufferized - part 1 // are bufferized - part 1
@@ -309,7 +309,7 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
$fields_cnt = mysql_num_fields($result); $fields_cnt = mysql_num_fields($result);
$rows_cnt = mysql_num_rows($result); $rows_cnt = mysql_num_rows($result);
@set_time_limit($GLOBALS['cfgExecTimeLimit']); // HaRa @set_time_limit($GLOBALS['cfg']['ExecTimeLimit']); // HaRa
// loic1: send a fake header to bypass browser timeout if data // loic1: send a fake header to bypass browser timeout if data
// are bufferized - part 1 // are bufferized - part 1
@@ -510,7 +510,7 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
$result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url); $result = mysql_query($local_query) or PMA_mysqlDie('', $local_query, '', $error_url);
$fields_cnt = mysql_num_fields($result); $fields_cnt = mysql_num_fields($result);
@set_time_limit($GLOBALS['cfgExecTimeLimit']); @set_time_limit($GLOBALS['cfg']['ExecTimeLimit']);
// Format the data // Format the data
$i = 0; $i = 0;

View File

@@ -71,79 +71,15 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
include('./config.inc.php3'); include('./config.inc.php3');
// For compatibility with old config.inc.php3 // For compatibility with old config.inc.php3
if (!isset($cfgExecTimeLimit)) { if (!isset($cfg)) {
$cfgExecTimeLimit = 300; // 5 minutes if (empty($GLOBALS['is_header_sent'])) {
include('./header.inc.php3');
} }
if (!isset($cfgShowStats)) { echo '<p class="warning">Your config file version is not supported any longer!</p>' . "\n";
$cfgShowStats = TRUE; include('./footer.inc.php3');
} exit();
if (!isset($cfgLoginCookieRecall)) {
$cfgLoginCookieRecall = TRUE;
}
if (!isset($cfgShowTooltip)) {
$cfgShowTooltip = TRUE;
}
if (!isset($cfgShowMysqlInfo)) {
$cfgShowMysqlInfo = FALSE;
}
if (!isset($cfgShowMysqlVars)) {
$cfgShowMysqlVars = FALSE;
}
if (!isset($cfgShowPhpInfo)) {
$cfgShowPhpInfo = FALSE;
}
if (!isset($cfgShowAll)) {
$cfgShowAll = FALSE;
}
if (!isset($cfgNavigationBarIconic)) {
$cfgNavigationBarIconic = TRUE;
}
if (!isset($cfgProtectBinary)) {
if (isset($cfgProtectBlob)) {
$cfgProtectBinary = ($cfgProtectBlob ? 'blob' : FALSE);
unset($cfgProtectBlob);
} else {
$cfgProtectBinary = 'blob';
}
}
if (!isset($cfgShowFunctionFields)) {
$cfgShowFunctionFields = TRUE;
}
if (!isset($cfgZipDump)) {
$cfgZipDump = (isset($cfgGZipDump) ? $cfgGZipDump : TRUE);
}
if (!isset($cfgLeftBgColor)) {
$cfgLeftBgColor = '#D0DCE0';
}
if (!isset($cfgLeftPointerColor)) {
$cfgLeftPointerColor = '';
}
if (!isset($cfgRightBgColor)) {
$cfgRightBgColor = '#F5F5F5';
}
if (!isset($cfgBrowsePointerColor)) {
$cfgBrowsePointerColor = '';
}
if (!isset($cfgBrowseMarkerColor)) {
$cfgBrowseMarkerColor = (!empty($cfgBrowsePointerColor) && !empty($cfgBrowseMarkRow))
? '#FFCC99'
: '';
}
if (!isset($cfgTextareaCols)) {
$cfgTextareaCols = 40;
}
if (!isset($cfgTextareaRows)) {
$cfgTextareaRows = 7;
}
if (!isset($cfgDefaultDisplay)) {
$cfgDefaultDisplay = 'horizontal';
}
if (!isset($cfgRepeatCells)) {
$cfgRepeatCells = 100;
}
if (!isset($cfgLeftFrameLight)) {
$cfgLeftFrameLight = TRUE;
} }
// rabus: The new backwards compatibility code will follow soon...
/** /**
* Gets constants that defines the PHP, MySQL... releases. * Gets constants that defines the PHP, MySQL... releases.
@@ -373,11 +309,11 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
/** /**
* $cfgPmaAbsoluteUri is a required directive else cookies won't be set * $cfg['PmaAbsoluteUri'] is a required directive else cookies won't be
* properly and, depending on browsers, inserting or updating a record * set properly and, depending on browsers, inserting or updating a
* record might fail * record might fail
*/ */
if (empty($cfgPmaAbsoluteUri)) { if (empty($cfg['PmaAbsoluteUri'])) {
if (empty($GLOBALS['is_header_sent'])) { if (empty($GLOBALS['is_header_sent'])) {
include('./header.inc.php3'); include('./header.inc.php3');
} }
@@ -387,78 +323,78 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
} }
// Adds a trailing slash et the end of the phpMyAdmin uri if it does not // Adds a trailing slash et the end of the phpMyAdmin uri if it does not
// exist // exist
else if (substr($cfgPmaAbsoluteUri, -1) != '/') { else if (substr($cfg['PmaAbsoluteUri'], -1) != '/') {
$cfgPmaAbsoluteUri .= '/'; $cfg['PmaAbsoluteUri'] .= '/';
} }
/** /**
* Use mysql_connect() or mysql_pconnect()? * Use mysql_connect() or mysql_pconnect()?
*/ */
$connect_func = ($cfgPersistentConnections) ? 'mysql_pconnect' : 'mysql_connect'; $connect_func = ($cfg['PersistentConnections']) ? 'mysql_pconnect' : 'mysql_connect';
$dblist = array(); $dblist = array();
/** /**
* Gets the valid servers list and parameters * Gets the valid servers list and parameters
*/ */
reset($cfgServers); reset($cfg['Servers']);
while (list($key, $val) = each($cfgServers)) { while (list($key, $val) = each($cfg['Servers'])) {
// Don't use servers with no hostname // Don't use servers with no hostname
if (empty($val['host'])) { if (empty($val['host'])) {
unset($cfgServers[$key]); unset($cfg['Servers'][$key]);
} }
} }
if (empty($server) || !isset($cfgServers[$server]) || !is_array($cfgServers[$server])) { if (empty($server) || !isset($cfg['Servers'][$server]) || !is_array($cfg['Servers'][$server])) {
$server = $cfgServerDefault; $server = $cfg['ServerDefault'];
} }
/** /**
* If no server is selected, make sure that $cfgServer is empty (so that * If no server is selected, make sure that $cfg['Server'] is empty (so
* nothing will work), and skip server authentication. * that nothing will work), and skip server authentication.
* We do NOT exit here, but continue on without logging into any server. * We do NOT exit here, but continue on without logging into any server.
* This way, the welcome page will still come up (with no server info) and * This way, the welcome page will still come up (with no server info) and
* present a choice of servers in the case that there are multiple servers * present a choice of servers in the case that there are multiple servers
* and '$cfgServerDefault = 0' is set. * and '$cfg['ServerDefault'] = 0' is set.
*/ */
if ($server == 0) { if ($server == 0) {
$cfgServer = array(); $cfg['Server'] = array();
} }
/** /**
* Otherwise, set up $cfgServer and do the usual login stuff. * Otherwise, set up $cfg['Server'] and do the usual login stuff.
*/ */
else if (isset($cfgServers[$server])) { else if (isset($cfg['Servers'][$server])) {
$cfgServer = $cfgServers[$server]; $cfgServer = $cfg['Servers'][$server];
// Check how the config says to connect to the server // Check how the config says to connect to the server
$server_port = (empty($cfgServer['port'])) $server_port = (empty($cfg['Server']['port']))
? '' ? ''
: ':' . $cfgServer['port']; : ':' . $cfg['Server']['port'];
if (strtolower($cfgServer['connect_type']) == 'tcp') { if (strtolower($cfg['Server']['connect_type']) == 'tcp') {
$cfgServer['socket'] = ''; $cfg['Server']['socket'] = '';
} }
$server_socket = (empty($cfgServer['socket']) || PMA_PHP_INT_VERSION < 30010) $server_socket = (empty($cfg['Server']['socket']) || PMA_PHP_INT_VERSION < 30010)
? '' ? ''
: ':' . $cfgServer['socket']; : ':' . $cfg['Server']['socket'];
// Ensures compatibility with old config files // Ensures compatibility with old config files
if (!isset($cfgServer['auth_type'])) { if (!isset($cfg['Server']['auth_type'])) {
$cfgServer['auth_type'] = (isset($cfgServer['adv_auth']) && $cfgServer['adv_auth']) $cfg['Server']['auth_type'] = (isset($cfg['Server']['adv_auth']) && $cfg['Server']['adv_auth'])
? 'http' ? 'http'
: 'config'; : 'config';
} }
if (isset($cfgServer['stduser'])) { if (isset($cfg['Server']['stduser'])) {
$cfgServer['controluser'] = $cfgServer['stduser']; $cfg['Server']['controluser'] = $cfg['Server']['stduser'];
$cfgServer['controlpass'] = $cfgServer['stdpass']; $cfg['Server']['controlpass'] = $cfg['Server']['stdpass'];
} }
// Gets the authentication library that fits the cfgServer settings // Gets the authentication library that fits the $cfg['Server'] settings
// and run authentication // and run authentication
include('./libraries/auth/' . $cfgServer['auth_type'] . '.auth.lib.php3'); include('./libraries/auth/' . $cfg['Server']['auth_type'] . '.auth.lib.php3');
if (!PMA_auth_check()) { if (!PMA_auth_check()) {
PMA_auth(); PMA_auth();
} else { } else {
@@ -466,11 +402,11 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
} }
// The user can work with only some databases // The user can work with only some databases
if (isset($cfgServer['only_db']) && $cfgServer['only_db'] != '') { if (isset($cfg['Server']['only_db']) && $cfg['Server']['only_db'] != '') {
if (is_array($cfgServer['only_db'])) { if (is_array($cfg['Server']['only_db'])) {
$dblist = $cfgServer['only_db']; $dblist = $cfg['Server']['only_db'];
} else { } else {
$dblist[] = $cfgServer['only_db']; $dblist[] = $cfg['Server']['only_db'];
} }
} // end if } // end if
@@ -482,11 +418,11 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
// get the privileges list for the current user but the true user link // get the privileges list for the current user but the true user link
// must be open after this one so it would be default one for all the // must be open after this one so it would be default one for all the
// scripts) // scripts)
if ($cfgServer['controluser'] != '') { if ($cfg['Server']['controluser'] != '') {
$dbh = @$connect_func( $dbh = @$connect_func(
$cfgServer['host'] . $server_port . $server_socket, $cfg['Server']['host'] . $server_port . $server_socket,
$cfgServer['controluser'], $cfg['Server']['controluser'],
$cfgServer['controlpass'] $cfg['Server']['controlpass']
); );
if ($dbh == FALSE) { if ($dbh == FALSE) {
if (mysql_error()) { if (mysql_error()) {
@@ -497,18 +433,18 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
$conn_error = 'Cannot connect: invalid settings.'; $conn_error = 'Cannot connect: invalid settings.';
} }
$local_query = $connect_func . '(' $local_query = $connect_func . '('
. $cfgServer['host'] . $server_port . $server_socket . ', ' . $cfg['Server']['host'] . $server_port . $server_socket . ', '
. $cfgServer['controluser'] . ', ' . $cfg['Server']['controluser'] . ', '
. $cfgServer['stdpass'] . ')'; . $cfg['Server']['stdpass'] . ')';
PMA_mysqlDie($conn_error, $local_query, FALSE); PMA_mysqlDie($conn_error, $local_query, FALSE);
} // end if } // end if
} // end if } // end if
// Connects to the server (validates user's login) // Connects to the server (validates user's login)
$userlink = @$connect_func( $userlink = @$connect_func(
$cfgServer['host'] . $server_port . $server_socket, $cfg['Server']['host'] . $server_port . $server_socket,
$cfgServer['user'], $cfg['Server']['user'],
$cfgServer['password'] $cfg['Server']['password']
); );
if ($userlink == FALSE) { if ($userlink == FALSE) {
PMA_auth_fails(); PMA_auth_fails();
@@ -520,7 +456,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
// If controluser isn't defined, use the current user settings to get // If controluser isn't defined, use the current user settings to get
// his rights // his rights
if ($cfgServer['controluser'] == '') { if ($cfg['Server']['controluser'] == '') {
$dbh = $userlink; $dbh = $userlink;
} }
@@ -587,7 +523,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
if (!$dblist_cnt) { if (!$dblist_cnt) {
$auth_query = 'SELECT User, Select_priv ' $auth_query = 'SELECT User, Select_priv '
. 'FROM mysql.user ' . 'FROM mysql.user '
. 'WHERE User = \'' . PMA_sqlAddslashes($cfgServer['user']) . '\''; . 'WHERE User = \'' . PMA_sqlAddslashes($cfg['Server']['user']) . '\'';
$rs = mysql_query($auth_query, $dbh); // Debug: or PMA_mysqlDie('', $auth_query, FALSE); $rs = mysql_query($auth_query, $dbh); // Debug: or PMA_mysqlDie('', $auth_query, FALSE);
} // end } // end
} // end if (!$dblist_cnt) } // end if (!$dblist_cnt)
@@ -611,7 +547,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
// 1. get allowed dbs from the "mysql.db" table // 1. get allowed dbs from the "mysql.db" table
// lem9: User can be blank (anonymous user) // lem9: User can be blank (anonymous user)
$local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Select_priv = \'Y\' AND (User = \'' . PMA_sqlAddslashes($cfgServer['user']) . '\' OR User = \'\')'; $local_query = 'SELECT DISTINCT Db FROM mysql.db WHERE Select_priv = \'Y\' AND (User = \'' . PMA_sqlAddslashes($cfg['Server']['user']) . '\' OR User = \'\')';
$rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE); $rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
if (@mysql_numrows($rs)) { if (@mysql_numrows($rs)) {
// Will use as associative array of the following 2 code // Will use as associative array of the following 2 code
@@ -672,7 +608,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
} // end if } // end if
// 2. get allowed dbs from the "mysql.tables_priv" table // 2. get allowed dbs from the "mysql.tables_priv" table
$local_query = 'SELECT DISTINCT Db FROM mysql.tables_priv WHERE Table_priv LIKE \'%Select%\' AND User = \'' . PMA_sqlAddslashes($cfgServer['user']) . '\''; $local_query = 'SELECT DISTINCT Db FROM mysql.tables_priv WHERE Table_priv LIKE \'%Select%\' AND User = \'' . PMA_sqlAddslashes($cfg['Server']['user']) . '\'';
$rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE); $rs = mysql_query($local_query, $dbh); // Debug: or PMA_mysqlDie('', $local_query, FALSE);
if (@mysql_numrows($rs)) { if (@mysql_numrows($rs)) {
while ($row = mysql_fetch_array($rs)) { while ($row = mysql_fetch_array($rs)) {
@@ -891,18 +827,18 @@ window.parent.frames['nav'].location.replace('<?php echo $reload_url; ?>');
echo "\n"; echo "\n";
?> ?>
<div align="<?php echo $GLOBALS['cell_align_left']; ?>"> <div align="<?php echo $GLOBALS['cell_align_left']; ?>">
<table border="<?php echo $GLOBALS['cfgBorder']; ?>" cellpadding="5"> <table border="<?php echo $GLOBALS['cfg']['Border']; ?>" cellpadding="5">
<tr> <tr>
<td bgcolor="<?php echo $GLOBALS['cfgThBgcolor']; ?>"> <td bgcolor="<?php echo $GLOBALS['cfg']['ThBgcolor']; ?>">
<b><?php echo (get_magic_quotes_gpc()) ? stripslashes($message) : $message; ?></b><br /> <b><?php echo (get_magic_quotes_gpc()) ? stripslashes($message) : $message; ?></b><br />
</td> </td>
</tr> </tr>
<?php <?php
if ($GLOBALS['cfgShowSQL'] == TRUE && !empty($GLOBALS['sql_query'])) { if ($GLOBALS['cfg']['ShowSQL'] == TRUE && !empty($GLOBALS['sql_query'])) {
echo "\n"; echo "\n";
?> ?>
<tr> <tr>
<td bgcolor="<?php echo $GLOBALS['cfgBgcolorOne']; ?>"> <td bgcolor="<?php echo $GLOBALS['cfg']['BgcolorOne']; ?>">
<?php <?php
echo "\n"; echo "\n";
// The nl2br function isn't used because its result isn't a valid // The nl2br function isn't used because its result isn't a valid
@@ -960,8 +896,8 @@ window.parent.frames['nav'].location.replace('<?php echo $reload_url; ?>');
*/ */
function PMA_showDocuShort($link) function PMA_showDocuShort($link)
{ {
if (!empty($GLOBALS['cfgManualBaseShort'])) { if (!empty($GLOBALS['cfg']['ManualBaseShort'])) {
return '[<a href="' . $GLOBALS['cfgManualBaseShort'] . '/' . $link .'" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]'; return '[<a href="' . $GLOBALS['cfg']['ManualBaseShort'] . '/' . $link .'" target="mysql_doc">' . $GLOBALS['strDocu'] . '</a>]';
} }
} // end of the 'PMA_showDocuShort()' function } // end of the 'PMA_showDocuShort()' function

View File

@@ -206,7 +206,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
// Move to the beginning or to the previous page // Move to the beginning or to the previous page
if ($pos > 0 && $session_max_rows != 'all') { if ($pos > 0 && $session_max_rows != 'all') {
// loic1: patch #474210 from Gosha Sakovich - part 1 // loic1: patch #474210 from Gosha Sakovich - part 1
if ($GLOBALS['cfgNavigationBarIconic']) { if ($GLOBALS['cfg']['NavigationBarIconic']) {
$caption1 = '&lt;&lt;'; $caption1 = '&lt;&lt;';
$caption2 = '&nbsp;&lt;&nbsp;'; $caption2 = '&nbsp;&lt;&nbsp;';
$title1 = ' title="' . $GLOBALS['strPos1'] . '"'; $title1 = ' title="' . $GLOBALS['strPos1'] . '"';
@@ -268,7 +268,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
<input type="hidden" name="goto" value="<?php echo $goto; ?>" /> <input type="hidden" name="goto" value="<?php echo $goto; ?>" />
<input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" /> <input type="hidden" name="dontlimitchars" value="<?php echo $dontlimitchars; ?>" />
<input type="submit" name="navig" value="<?php echo $GLOBALS['strShow']; ?>&nbsp;:" /> <input type="submit" name="navig" value="<?php echo $GLOBALS['strShow']; ?>&nbsp;:" />
<input type="text" name="session_max_rows" size="3" value="<?php echo (($session_max_rows != 'all') ? $session_max_rows : $GLOBALS['cfgMaxRows']); ?>" class="textfield" onfocus="this.select()" /> <input type="text" name="session_max_rows" size="3" value="<?php echo (($session_max_rows != 'all') ? $session_max_rows : $GLOBALS['cfg']['MaxRows']); ?>" class="textfield" onfocus="this.select()" />
<?php echo $GLOBALS['strRowsFrom'] . "\n"; ?> <?php echo $GLOBALS['strRowsFrom'] . "\n"; ?>
<input type="text" name="pos" size="3" value="<?php echo (($pos_next >= $unlim_num_rows) ? 0 : $pos_next); ?>" class="textfield" onfocus="this.select()" /> <input type="text" name="pos" size="3" value="<?php echo (($pos_next >= $unlim_num_rows) ? 0 : $pos_next); ?>" class="textfield" onfocus="this.select()" />
<br /> <br />
@@ -293,7 +293,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
if (($pos + $session_max_rows < $unlim_num_rows) && $num_rows >= $session_max_rows if (($pos + $session_max_rows < $unlim_num_rows) && $num_rows >= $session_max_rows
&& $session_max_rows != 'all') { && $session_max_rows != 'all') {
// loic1: patch #474210 from Gosha Sakovich - part 2 // loic1: patch #474210 from Gosha Sakovich - part 2
if ($GLOBALS['cfgNavigationBarIconic']) { if ($GLOBALS['cfg']['NavigationBarIconic']) {
$caption3 = '&nbsp;&gt;&nbsp;'; $caption3 = '&nbsp;&gt;&nbsp;';
$caption4 = '&gt;&gt;'; $caption4 = '&gt;&gt;';
$title3 = ' title="' . $GLOBALS['strNext'] . '"'; $title3 = ' title="' . $GLOBALS['strNext'] . '"';
@@ -343,7 +343,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
} // end move toward } // end move toward
// Show all the records if allowed // Show all the records if allowed
if ($GLOBALS['cfgShowAll'] && ($num_rows < $unlim_num_rows)) { if ($GLOBALS['cfg']['ShowAll'] && ($num_rows < $unlim_num_rows)) {
echo "\n"; echo "\n";
?> ?>
<td> <td>
@@ -479,7 +479,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
// ... at the left column of the result table header if possible // ... at the left column of the result table header if possible
// and required // and required
else if ($GLOBALS['cfgModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') { else if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && $is_display['text_btn'] == '1') {
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if ($disp_direction == 'horizontal') { if ($disp_direction == 'horizontal') {
echo "\n"; echo "\n";
@@ -499,7 +499,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
} }
// ... else if no button, displays empty(ies) col(s) if required // ... else if no button, displays empty(ies) col(s) if required
else if ($GLOBALS['cfgModifyDeleteAtLeft'] else if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) { && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')) {
$vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if ($disp_direction == 'horizontal') { if ($disp_direction == 'horizontal') {
@@ -562,11 +562,11 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
// 2.1.4 Do define the sorting url // 2.1.4 Do define the sorting url
if (!$is_in_sort) { if (!$is_in_sort) {
// loic1: patch #455484 ("Smart" order) // loic1: patch #455484 ("Smart" order)
$cfgOrder = strtoupper($GLOBALS['cfgOrder']); $cfg['Order'] = strtoupper($GLOBALS['cfg']['Order']);
if ($cfgOrder == 'SMART') { if ($cfg['Order'] == 'SMART') {
$cfgOrder = (eregi('time|date', $fields_meta[$i]->type)) ? 'DESC' : 'ASC'; $cfg['Order'] = (eregi('time|date', $fields_meta[$i]->type)) ? 'DESC' : 'ASC';
} }
$sort_order = ' ORDER BY ' . $sort_tbl . PMA_backquote($fields_meta[$i]->name) . ' ' . $cfgOrder; $sort_order = ' ORDER BY ' . $sort_tbl . PMA_backquote($fields_meta[$i]->name) . ' ' . $cfg['Order'];
$order_img = ''; $order_img = '';
} }
else if (substr($sql_order, -3) == 'ASC' && $is_in_sort) { else if (substr($sql_order, -3) == 'ASC' && $is_in_sort) {
@@ -627,7 +627,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
// 3. Displays the full/partial text button (part 2) at the right // 3. Displays the full/partial text button (part 2) at the right
// column of the result table header if possible and required... // column of the result table header if possible and required...
if ($GLOBALS['cfgModifyDeleteAtRight'] if ($GLOBALS['cfg']['ModifyDeleteAtRight']
&& ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') && ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn')
&& $is_display['text_btn'] == '1') { && $is_display['text_btn'] == '1') {
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; $vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
@@ -649,7 +649,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
} }
// ... else if no button, displays empty cols if required // ... else if no button, displays empty cols if required
else if ($GLOBALS['cfgModifyDeleteAtRight'] else if ($GLOBALS['cfg']['ModifyDeleteAtRight']
&& ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')) { && ($is_display['edit_lnk'] == 'nn' && $is_display['del_lnk'] == 'nn')) {
$vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1; $vertical_display['emptyafter'] = ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn') ? 2 : 1;
if ($disp_direction == 'horizontal') { if ($disp_direction == 'horizontal') {
@@ -764,17 +764,17 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
echo '</tr>' . "\n"; echo '</tr>' . "\n";
} // end if } // end if
$bgcolor = ($foo % 2) ? $GLOBALS['cfgBgcolorOne'] : $GLOBALS['cfgBgcolorTwo']; $bgcolor = ($foo % 2) ? $GLOBALS['cfg']['BgcolorOne'] : $GLOBALS['cfg']['BgcolorTwo'];
if ($disp_direction == 'horizontal') { if ($disp_direction == 'horizontal') {
// loic1: pointer code part // loic1: pointer code part
$on_mouse = ''; $on_mouse = '';
if ($GLOBALS['cfgBrowsePointerColor'] != '') { if ($GLOBALS['cfg']['BrowsePointerColor'] != '') {
$on_mouse = ' onmouseover="setPointer(this, \'over\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfgBrowsePointerColor'] . '\', \'' . $GLOBALS['cfgBrowseMarkerColor'] . '\')"' $on_mouse = ' onmouseover="setPointer(this, \'over\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\')"'
. ' onmouseout="setPointer(this, \'out\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfgBrowsePointerColor'] . '\', \'' . $GLOBALS['cfgBrowseMarkerColor'] . '\')"'; . ' onmouseout="setPointer(this, \'out\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\')"';
} }
if ($GLOBALS['cfgBrowseMarkerColor'] != '') { if ($GLOBALS['cfg']['BrowseMarkerColor'] != '') {
$on_mouse .= ' onmousedown="setPointer(this, \'click\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfgBrowsePointerColor'] . '\', \'' . $GLOBALS['cfgBrowseMarkerColor'] . '\')"'; $on_mouse .= ' onmousedown="setPointer(this, \'click\', \'' . $bgcolor . '\', \'' . $GLOBALS['cfg']['BrowsePointerColor'] . '\', \'' . $GLOBALS['cfg']['BrowseMarkerColor'] . '\')"';
} }
?> ?>
<tr<?php echo $on_mouse; ?>> <tr<?php echo $on_mouse; ?>>
@@ -883,7 +883,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
} // end if (1.2.2) } // end if (1.2.2)
// 1.3 Displays the links at left if required // 1.3 Displays the links at left if required
if ($GLOBALS['cfgModifyDeleteAtLeft'] if ($GLOBALS['cfg']['ModifyDeleteAtLeft']
&& ($disp_direction == 'horizontal')) { && ($disp_direction == 'horizontal')) {
if (!empty($edit_url)) { if (!empty($edit_url)) {
?> ?>
@@ -936,10 +936,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
} else { } else {
$vertical_display['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n"; $vertical_display['data'][$foo][$i] = ' <td align="right" valign="top" bgcolor="' . $bgcolor . '">&nbsp;</td>' . "\n";
} }
} else if ($GLOBALS['cfgShowBlob'] == FALSE && eregi('BLOB', $meta->type)) { } else if ($GLOBALS['cfg']['ShowBlob'] == FALSE && eregi('BLOB', $meta->type)) {
// loic1 : mysql_fetch_fields returns BLOB in place of TEXT // loic1 : mysql_fetch_fields returns BLOB in place of TEXT
// fields type, however TEXT fields must be displayed even // fields type, however TEXT fields must be displayed even
// if $cfgShowBlob is false -> get the true type of the // if $cfg['ShowBlob'] is false -> get the true type of the
// fields. // fields.
$field_flags = mysql_field_flags($dt_result, $i); $field_flags = mysql_field_flags($dt_result, $i);
if (eregi('BINARY', $field_flags)) { if (eregi('BINARY', $field_flags)) {
@@ -949,8 +949,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
|| (function_exists('is_null') && is_null($row[$pointer]))) { || (function_exists('is_null') && is_null($row[$pointer]))) {
$vertical_display['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n"; $vertical_display['data'][$foo][$i] = ' <td valign="top" bgcolor="' . $bgcolor . '"><i>NULL</i></td>' . "\n";
} else if ($row[$pointer] != '') { } else if ($row[$pointer] != '') {
if (strlen($row[$pointer]) > $GLOBALS['cfgLimitChars'] && ($dontlimitchars != 1)) { if (strlen($row[$pointer]) > $GLOBALS['cfg']['LimitChars'] && ($dontlimitchars != 1)) {
$row[$pointer] = substr($row[$pointer], 0, $GLOBALS['cfgLimitChars']) . '...'; $row[$pointer] = substr($row[$pointer], 0, $GLOBALS['cfg']['LimitChars']) . '...';
} }
// loic1: displays all space characters, 4 space // loic1: displays all space characters, 4 space
// characters for tabulations and <cr>/<lf> // characters for tabulations and <cr>/<lf>
@@ -970,10 +970,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
// loic1: support blanks in the key // loic1: support blanks in the key
$relation_id = $row[$pointer]; $relation_id = $row[$pointer];
// loic1: Cut text/blob fields even if $cfgShowBlob is true // loic1: Cut text/blob fields even if $cfg['ShowBlob'] is true
if (eregi('BLOB', $meta->type)) { if (eregi('BLOB', $meta->type)) {
if (strlen($row[$pointer]) > $GLOBALS['cfgLimitChars'] && ($dontlimitchars != 1)) { if (strlen($row[$pointer]) > $GLOBALS['cfg']['LimitChars'] && ($dontlimitchars != 1)) {
$row[$pointer] = substr($row[$pointer], 0, $GLOBALS['cfgLimitChars']) . '...'; $row[$pointer] = substr($row[$pointer], 0, $GLOBALS['cfg']['LimitChars']) . '...';
} }
} }
// loic1: displays special characters from binaries // loic1: displays special characters from binaries
@@ -1022,7 +1022,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
} // end for (2) } // end for (2)
// 3. Displays the modify/delete links on the right if required // 3. Displays the modify/delete links on the right if required
if ($GLOBALS['cfgModifyDeleteAtRight'] if ($GLOBALS['cfg']['ModifyDeleteAtRight']
&& ($disp_direction == 'horizontal')) { && ($disp_direction == 'horizontal')) {
if (!empty($edit_url)) { if (!empty($edit_url)) {
?> ?>
@@ -1105,7 +1105,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
reset($vertical_display); reset($vertical_display);
// Displays "edit" link at top if required // Displays "edit" link at top if required
if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($vertical_display['edit'])) { if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['edit'])) {
echo '<tr>' . "\n"; echo '<tr>' . "\n";
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
reset($vertical_display['edit']); reset($vertical_display['edit']);
@@ -1122,7 +1122,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
} // end if } // end if
// Displays "delete" link at top if required // Displays "delete" link at top if required
if ($GLOBALS['cfgModifyDeleteAtLeft'] && is_array($vertical_display['delete'])) { if ($GLOBALS['cfg']['ModifyDeleteAtLeft'] && is_array($vertical_display['delete'])) {
echo '<tr>' . "\n"; echo '<tr>' . "\n";
if (!is_array($vertical_display['edit'])) { if (!is_array($vertical_display['edit'])) {
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
@@ -1160,7 +1160,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
} // end while } // end while
// Displays "edit" link at bottom if required // Displays "edit" link at bottom if required
if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($vertical_display['edit'])) { if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['edit'])) {
echo '<tr>' . "\n"; echo '<tr>' . "\n";
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
reset($vertical_display['edit']); reset($vertical_display['edit']);
@@ -1177,7 +1177,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
} // end if } // end if
// Displays "delete" link at bottom if required // Displays "delete" link at bottom if required
if ($GLOBALS['cfgModifyDeleteAtRight'] && is_array($vertical_display['delete'])) { if ($GLOBALS['cfg']['ModifyDeleteAtRight'] && is_array($vertical_display['delete'])) {
echo '<tr>' . "\n"; echo '<tr>' . "\n";
if (!is_array($vertical_display['edit'])) { if (!is_array($vertical_display['edit'])) {
echo $vertical_display['textbtn']; echo $vertical_display['textbtn'];
@@ -1236,7 +1236,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
*/ */
function PMA_displayTable(&$dt_result, &$the_disp_mode) function PMA_displayTable(&$dt_result, &$the_disp_mode)
{ {
global $lang, $server, $cfgServer, $db, $table; global $lang, $server, $cfg, $db, $table;
global $goto; global $goto;
global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt; global $sql_query, $num_rows, $unlim_num_rows, $pos, $fields_meta, $fields_cnt;
global $vertical_display, $disp_direction, $repeat_cells; global $vertical_display, $disp_direction, $repeat_cells;
@@ -1261,8 +1261,8 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$pos_next = 0; $pos_next = 0;
$pos_prev = 0; $pos_prev = 0;
} else { } else {
$pos_next = $pos + $GLOBALS['cfgMaxRows']; $pos_next = $pos + $GLOBALS['cfg']['MaxRows'];
$pos_prev = $pos - $GLOBALS['cfgMaxRows']; $pos_prev = $pos - $GLOBALS['cfg']['MaxRows'];
if ($pos_prev < 0) { if ($pos_prev < 0) {
$pos_prev = 0; $pos_prev = 0;
} }
@@ -1313,7 +1313,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
// init map // init map
$map = array(); $map = array();
if (!empty($cfgServer['relation'])) { if (!empty($cfg['Server']['relation'])) {
// find tables // find tables
// $tabs = '(\'' . join('\',\'', spliti('`? *((on [^,]+)?,|(NATURAL )?(inner|left|right)( outer)? join) *`?', // $tabs = '(\'' . join('\',\'', spliti('`? *((on [^,]+)?,|(NATURAL )?(inner|left|right)( outer)? join) *`?',
// eregi_replace('^.*FROM +`?|`? *(on [^,]+)?(WHERE.*)?$', '', $sql_query))) . '\')'; // eregi_replace('^.*FROM +`?|`? *(on [^,]+)?(WHERE.*)?$', '', $sql_query))) . '\')';
@@ -1322,7 +1322,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
$tabs = '(\'' . join('\',\'', split($pattern, $target)) . '\')'; $tabs = '(\'' . join('\',\'', split($pattern, $target)) . '\')';
$local_query = 'SELECT src_column, dest_table, dest_column' $local_query = 'SELECT src_column, dest_table, dest_column'
. ' FROM ' . $cfgServer['relation'] . ' FROM ' . $cfg['Server']['relation']
. ' WHERE src_table IN ' . $tabs; . ' WHERE src_table IN ' . $tabs;
$result = @mysql_query($local_query); $result = @mysql_query($local_query);
if ($result) { if ($result) {
@@ -1335,7 +1335,7 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')){
// 3. ----- Displays the results table ----- // 3. ----- Displays the results table -----
?> ?>
<!-- Results table --> <!-- Results table -->
<table border="<?php echo $GLOBALS['cfgBorder']; ?>" cellpadding="5"> <table border="<?php echo $GLOBALS['cfg']['Border']; ?>" cellpadding="5">
<?php <?php
echo "\n"; echo "\n";
PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt); PMA_displayTableHeaders($is_display, $fields_meta, $fields_cnt);

View File

@@ -164,8 +164,8 @@ if (!isset($lang)) {
* Do the work! * Do the work!
*/ */
// Lang forced // Lang forced
if (!empty($cfgLang)) { if (!empty($cfg['Lang'])) {
$lang = $cfgLang; $lang = $cfg['Lang'];
} }
// If '$lang' is defined, ensure this is a valid translation // If '$lang' is defined, ensure this is a valid translation
@@ -191,7 +191,7 @@ if (empty($lang) && !empty($HTTP_USER_AGENT)) {
// 3. Didn't catch any valid lang : we use the default settings // 3. Didn't catch any valid lang : we use the default settings
if (empty($lang)) { if (empty($lang)) {
$lang = $cfgDefaultLang; $lang = $cfg['DefaultLang'];
} }
// 4. Defines the associated filename and load the translation // 4. Defines the associated filename and load the translation