controluser

This commit is contained in:
Marc Delisle
2002-03-07 13:10:34 +00:00
parent d5475d1bff
commit c5a39c2ed3
2 changed files with 30 additions and 18 deletions

View File

@@ -42,13 +42,19 @@ $cfgServers[1]['host'] = 'localhost'; // MySQL hostname
$cfgServers[1]['port'] = ''; // MySQL port - leave blank for default port $cfgServers[1]['port'] = ''; // MySQL port - leave blank for default port
$cfgServers[1]['socket'] = ''; // Path to the socket - leave blank for default socket $cfgServers[1]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfgServers[1]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket') $cfgServers[1]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfgServers[1]['stduser'] = ''; // MySQL standard user settings (this user must have read-only $cfgServers[1]['controluser'] = ''; // MySQL control user settings
$cfgServers[1]['stdpass'] = ''; // access to the "mysql/user" and "mysql/db" tables) // (this user must have read-only
$cfgServers[1]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)? $cfgServers[1]['controlpass'] = ''; // access to the "mysql/user"
// and "mysql/db" tables)
$cfgServers[1]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
$cfgServers[1]['user'] = 'root'; // MySQL user $cfgServers[1]['user'] = 'root'; // MySQL user
$cfgServers[1]['password'] = ''; // MySQL password (only needed with 'config' auth) $cfgServers[1]['password'] = ''; // MySQL password (only needed
$cfgServers[1]['only_db'] = ''; // If set to a db-name, only this db is displayed at left frame // with 'config' auth_type)
// It may also be an array of db-names $cfgServers[1]['only_db'] = ''; // If set to a db-name, only
// this db is displayed
// at left frame
// It may also be an array
// of db-names
$cfgServers[1]['verbose'] = ''; // Verbose name for this host - leave blank to show the hostname $cfgServers[1]['verbose'] = ''; // Verbose name for this host - leave blank to show the hostname
$cfgServers[1]['bookmarkdb'] = ''; // Bookmark db - leave blank for no bookmark support $cfgServers[1]['bookmarkdb'] = ''; // Bookmark db - leave blank for no bookmark support
$cfgServers[1]['bookmarktable'] = ''; // Bookmark table - leave blank for no bookmark support $cfgServers[1]['bookmarktable'] = ''; // Bookmark table - leave blank for no bookmark support
@@ -59,8 +65,8 @@ $cfgServers[2]['host'] = '';
$cfgServers[2]['port'] = ''; $cfgServers[2]['port'] = '';
$cfgServers[2]['socket'] = ''; $cfgServers[2]['socket'] = '';
$cfgServers[2]['connect_type'] = 'tcp'; $cfgServers[2]['connect_type'] = 'tcp';
$cfgServers[2]['stduser'] = ''; $cfgServers[2]['controluser'] = '';
$cfgServers[2]['stdpass'] = ''; $cfgServers[2]['controlpass'] = '';
$cfgServers[2]['auth_type'] = 'config'; $cfgServers[2]['auth_type'] = 'config';
$cfgServers[2]['user'] = 'root'; $cfgServers[2]['user'] = 'root';
$cfgServers[2]['password'] = ''; $cfgServers[2]['password'] = '';
@@ -74,8 +80,8 @@ $cfgServers[3]['host'] = '';
$cfgServers[3]['port'] = ''; $cfgServers[3]['port'] = '';
$cfgServers[3]['socket'] = ''; $cfgServers[3]['socket'] = '';
$cfgServers[3]['connect_type'] = 'tcp'; $cfgServers[3]['connect_type'] = 'tcp';
$cfgServers[3]['stduser'] = ''; $cfgServers[3]['controluser'] = '';
$cfgServers[3]['stdpass'] = ''; $cfgServers[3]['controlpass'] = '';
$cfgServers[3]['auth_type'] = 'config'; $cfgServers[3]['auth_type'] = 'config';
$cfgServers[3]['user'] = 'root'; $cfgServers[3]['user'] = 'root';
$cfgServers[3]['password'] = ''; $cfgServers[3]['password'] = '';

View File

@@ -71,8 +71,9 @@ 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($cfgExecTimeLimit)) {
$cfgExecTimeLimit = 300; // 5 minuts $cfgExecTimeLimit = 300; // 5 minutes
} }
if (!isset($cfgShowStats)) { if (!isset($cfgShowStats)) {
$cfgShowStats = TRUE; $cfgShowStats = TRUE;
@@ -424,6 +425,11 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
: 'config'; : 'config';
} }
if (isset($cfgServer['stduser'])) {
$cfgServer['controluser'] = $cfgServer['stduser'];
$cfgServer['controlpass'] = $cfgServer['stdpass'];
}
// Gets the authentication library that fits the cfgServer settings // Gets the authentication library that fits the cfgServer settings
// and run authentication // and run authentication
include('./libraries/auth/' . $cfgServer['auth_type'] . '.auth.lib.php3'); include('./libraries/auth/' . $cfgServer['auth_type'] . '.auth.lib.php3');
@@ -446,15 +452,15 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
$bkp_track_err = @ini_set('track_errors', 1); $bkp_track_err = @ini_set('track_errors', 1);
} }
// Try to connect MySQL with the standard user profile (will be used to // Try to connect MySQL with the control user profile (will be used to
// 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['stduser'] != '') { if ($cfgServer['controluser'] != '') {
$dbh = @$connect_func( $dbh = @$connect_func(
$cfgServer['host'] . $server_port . $server_socket, $cfgServer['host'] . $server_port . $server_socket,
$cfgServer['stduser'], $cfgServer['controluser'],
$cfgServer['stdpass'] $cfgServer['controlpass']
); );
if ($dbh == FALSE) { if ($dbh == FALSE) {
if (mysql_error()) { if (mysql_error()) {
@@ -466,7 +472,7 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
} }
$local_query = $connect_func . '(' $local_query = $connect_func . '('
. $cfgServer['host'] . $server_port . $server_socket . ', ' . $cfgServer['host'] . $server_port . $server_socket . ', '
. $cfgServer['stduser'] . ', ' . $cfgServer['controluser'] . ', '
. $cfgServer['stdpass'] . ')'; . $cfgServer['stdpass'] . ')';
PMA_mysqlDie($conn_error, $local_query, FALSE); PMA_mysqlDie($conn_error, $local_query, FALSE);
} // end if } // end if
@@ -486,9 +492,9 @@ if (!defined('PMA_COMMON_LIB_INCLUDED')){
@ini_set('track_errors', $bkp_track_err); @ini_set('track_errors', $bkp_track_err);
} }
// If stduser isn't defined, use the current user settings to get his // If controluser isn't defined, use the current user settings to get his
// rights // rights
if ($cfgServer['stduser'] == '') { if ($cfgServer['controluser'] == '') {
$dbh = $userlink; $dbh = $userlink;
} }