diff --git a/doc/config.rst b/doc/config.rst index 6aeef8f3f6..e5a2696d72 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -577,6 +577,10 @@ Server connection settings :type: boolean :default: false + .. deprecated:: 4.7.0 + + This setting was removed as it can produce unexpected results. + Allow attempt to log in without password when a login with password fails. This can be used together with http authentication, when authentication is done some other way and phpMyAdmin gets user name diff --git a/libraries/config.default.php b/libraries/config.default.php index 04d905d5a8..d2e4434e79 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -297,13 +297,6 @@ $cfg['Servers'][$i]['SignonURL'] = ''; */ $cfg['Servers'][$i]['LogoutURL'] = ''; -/** - * Whether to try to connect without password - * - * @global boolean $cfg['Servers'][$i]['nopassword'] - */ -$cfg['Servers'][$i]['nopassword'] = false; - /** * If set to a db-name, only this db is displayed in navigation panel * It may also be an array of db-names diff --git a/libraries/config/ConfigFile.php b/libraries/config/ConfigFile.php index b74c1cc838..4006dc2053 100644 --- a/libraries/config/ConfigFile.php +++ b/libraries/config/ConfigFile.php @@ -416,9 +416,7 @@ class ConfigFile $dsn = 'mysqli://'; if ($this->getValue("$path/auth_type") == 'config') { $dsn .= $this->getValue("$path/user"); - if (! $this->getValue("$path/nopassword") - || ! empty($this->getValue("$path/password")) - ) { + if (! empty($this->getValue("$path/password"))) { $dsn .= ':***'; } $dsn .= '@'; diff --git a/libraries/config/Validator.php b/libraries/config/Validator.php index faa115e899..5b2fa3a83f 100644 --- a/libraries/config/Validator.php +++ b/libraries/config/Validator.php @@ -285,23 +285,6 @@ class Validator 'Server' ); - // If failed 'with' password, try 'without' password - if ($test !== true - && !empty($values['Servers/1/nopassword']) - && $values['Servers/1/nopassword'] - ) { - $password = ''; - $test = static::testDBConnection( - empty($values['Servers/1/connect_type']) ? '' : $values['Servers/1/connect_type'], - empty($values['Servers/1/host']) ? '' : $values['Servers/1/host'], - empty($values['Servers/1/port']) ? '' : $values['Servers/1/port'], - empty($values['Servers/1/socket']) ? '' : $values['Servers/1/socket'], - empty($values['Servers/1/user']) ? '' : $values['Servers/1/user'], - $password, - 'Server' - ); - } - if ($test !== true) { $result = array_merge($result, $test); } diff --git a/libraries/config/messages.inc.php b/libraries/config/messages.inc.php index 3cb93604a0..33bd8df169 100644 --- a/libraries/config/messages.inc.php +++ b/libraries/config/messages.inc.php @@ -705,8 +705,6 @@ $strConfigServers_central_columns_desc = __( 'Leave blank for no central columns support, suggested: ' . '[kbd]pma__central_columns[/kbd].' ); -$strConfigServers_nopassword_desc = __('Try to connect without password.'); -$strConfigServers_nopassword_name = __('Connect without password'); $strConfigServers_only_db_desc = __( 'You can use MySQL wildcard characters (% and _), escape them if you want to ' . 'use their literal instances, i.e. use [kbd]\'my\_db\'[/kbd] and not ' diff --git a/libraries/config/setup.forms.php b/libraries/config/setup.forms.php index a509bf94dd..d4034d9118 100644 --- a/libraries/config/setup.forms.php +++ b/libraries/config/setup.forms.php @@ -33,8 +33,7 @@ $forms['Servers']['Server'] = array('Servers' => array(1 => array( 'socket', 'ssl', 'connect_type', - 'compress', - 'nopassword'))); + 'compress'))); $forms['Servers']['Server_auth'] = array('Servers' => array(1 => array( 'auth_type', ':group:' . __('Config authentication'), diff --git a/test/classes/config/ConfigFileTest.php b/test/classes/config/ConfigFileTest.php index df77943322..61fb4afbce 100644 --- a/test/classes/config/ConfigFileTest.php +++ b/test/classes/config/ConfigFileTest.php @@ -506,7 +506,7 @@ class ConfigFileTest extends PMATestCase ) ); $this->assertEquals( - "mysqli://testUser:***@example.com:21", + "mysqli://testUser@example.com:21", $this->object->getServerDSN(1) ); @@ -519,8 +519,8 @@ class ConfigFileTest extends PMATestCase "connect_type" => "socket", "host" => "example.com", "port" => "21", - "nopassword" => "yes", - "socket" => "123" + "socket" => "123", + "password" => "", ) ) ) @@ -539,7 +539,6 @@ class ConfigFileTest extends PMATestCase "connect_type" => "tcp", "host" => "example.com", "port" => "21", - "nopassword" => "yes", "password" => "testPass" ) )